-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add host_tx_ready enhancements #2930
Add host_tx_ready enhancements #2930
Conversation
7c4f5c4
to
68ccc1d
Compare
68ccc1d
to
62a59ae
Compare
62a59ae
to
adaf4be
Compare
/azpw run Azure.sonic-swss |
/AzurePipelines run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
adaf4be
to
28fbbec
Compare
28fbbec
to
7efd62e
Compare
/azpw run Azure.sonic-swss |
/AzurePipelines run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
7efd62e
to
45242f5
Compare
@@ -60,6 +60,19 @@ def check_port_oper_status(appl_db, port_name, state): | |||
break | |||
assert oper_status == state | |||
|
|||
def check_port_host_tx_ready_status(state_db, port_name, status): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx have you tested in actual switch host_tx_ready is not deleted during warm-reboot? If its not delted, what is preventing it from deleted from STATE_DB's port table? Any code pointers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table is deleted.
The thing is, that after warm reboot, host_tx_ready value will be false, and we won't get any new notification from lower layers saying that host_tx_ready=true.
That's the reason we need to take the current value of host_tx_ready using the new API
@@ -7345,6 +7521,18 @@ void PortsOrch::doTask(NotificationConsumer &consumer) | |||
|
|||
sai_deserialize_free_port_oper_status_ntf(count, portoperstatus); | |||
} | |||
else if (&consumer == m_portHostTxReadyNotificationConsumer && op == "port_host_tx_ready") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx Have you tested, when user does admin down, the host_tx_ready becomes false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
orchagent/portsorch.cpp
Outdated
@@ -4469,6 +4561,69 @@ void PortsOrch::doVlanMemberTask(Consumer &consumer) | |||
} | |||
} | |||
|
|||
void PortsOrch::doTransceiverInfoTableTask(Consumer &consumer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx I would suggest to rename "doTransceiverPresenceCheck" since this routine is checking the presence of the module as notified in TRANSCEIVER_INFO SET/DEL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
bool PortsOrch::setSaiHostTxSignal(const Port &port, bool enable) | ||
{ | ||
sai_attribute_t attr; | ||
attr.id = SAI_PORT_ATTR_HOST_TX_SIGNAL_ENABLE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx Will this crash for platform that doesn't support this new SAI attribute? See failure message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A vendor which doesn't support this function should not get to this flow.
setSaiHostTxSignal is called only from doTransceiverPresenceCheck() function.
This function will be called when TRANSCEIVER_INFO table in STATE DB will change.
OA will listen to the table, only if the flow is supported:
if (saiHwTxSignalSupported && saiTxReadyNotifySupported)
{
SWSS_LOG_DEBUG("m_cmisModuleAsicSyncSupported is true");
m_cmisModuleAsicSyncSupported = true;
Orch::addExecutor(new Consumer(new SubscriberStateTable(stateDb, STATE_TRANSCEIVER_INFO_TABLE_NAME, TableConsumable::DEFAULT_POP_BATCH_SIZE, 0), this, STATE_TRANSCEIVER_INFO_TABLE_NAME));
}
ab22f5c
to
f30fc35
Compare
/azpw run Azure.sonic-swss |
/AzurePipelines run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
@noaOrMlnx please check if failure is due to some other PR dependency |
f30fc35
to
3d1a6f3
Compare
c3301ba
to
1c6a1fb
Compare
orchagent/portsorch.cpp
Outdated
return; | ||
} | ||
|
||
SWSS_LOG_NOTICE("Setting host_tx_ready status = %s, port_id = 0x%" PRIx64, status.c_str(), portId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx please log the logical port name (port.m_alias) as well for easy identification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx please add the logical port name as done previously port.m_alias.c_Str()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prgeor Done
{ | ||
m_portStateTable.hset(port.m_alias, "host_tx_ready", "false"); | ||
SWSS_LOG_NOTICE("Set host_tx_ready to false as gbstatus is false " | ||
"for port %s", port.m_alias.c_str()); | ||
} | ||
|
||
/* Update the state table for host_tx_ready*/ | ||
if (state && (gbstatus == true) && (status == SAI_STATUS_SUCCESS) ) | ||
if (state && (gbstatus == true) && (status == SAI_STATUS_SUCCESS) && !m_cmisModuleAsicSyncSupported) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx can we use the newly introduced API setHostTxReady() here as well instead of directly calling hset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
orchagent/portsorch.cpp
Outdated
|
||
if (!m_cmisModuleAsicSyncSupported) | ||
{ | ||
m_portStateTable.hset(port.m_alias, "host_tx_ready", "false"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx can we use the newly introduced API setHostTxReady() here as well instead of directly calling hset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/* Update the host_tx_ready to false before setting admin_state, when admin state is false */ | ||
if (!state) | ||
if (!state && !m_cmisModuleAsicSyncSupported) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noaOrMlnx can we use the newly introduced API setHostTxReady() here as well instead of directly calling hset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
7a929f4
to
7a2ab85
Compare
and add log with port alias
7a2ab85
to
56eb52d
Compare
What I did Add host_tx_ready enhancements to sonic-swss branch according to HLD Why I did it Module and Asic configurations must be synchronized in order to not configure an non-existing module.
Cherry-pick PR to 202311: #3016 |
@noaOrMlnx cherry pick PR didn't pass PR checker. Please check!!! |
What I did Add host_tx_ready enhancements to sonic-swss branch according to HLD Why I did it Module and Asic configurations must be synchronized in order to not configure an non-existing module.
Depending on sonic-net/sonic-swss-common#824
Depending on sonic-net/sonic-sairedis#1307
HLD: sonic-net/SONiC#1453
What I did
Add host_tx_ready enhancements to sonic-swss branch according to HLD mentioned above.
Why I did it
Module and Asic configurations must be synchronized in order to not configure an non-existing module.
How I verified it
Manually & unit tests.
Details if related