-
Notifications
You must be signed in to change notification settings - Fork 558
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
[PFCWD + Asym PFC]: Allow PFCWD to detect PFC storm on all priorities when Asym PFC is enabled #1360
[PFCWD + Asym PFC]: Allow PFCWD to detect PFC storm on all priorities when Asym PFC is enabled #1360
Conversation
retest vs please |
retest this please |
1 similar comment
retest this please |
retest this please |
8193edb
to
cb791cc
Compare
… when Asym PFC is enabled Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com>
cb791cc
to
0f3e9f3
Compare
retest this please |
retest this please |
sai_status_t status = sai_port_api->set_port_attribute(portId, &attr); | ||
if (status != SAI_STATUS_SUCCESS) | ||
{ | ||
SWSS_LOG_ERROR("Failed to set PFC bitmask 0x%x for the port 0x%" PRIx64 " (rc:%d)", |
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.
not sure i understand this part.
you are using the tx pfc bitmask for setting flow control and the message in the log is still pfc bitmask which i can see later on you have one for rx and tx.
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.
This logic is explained in the "Asymmentric PFC" HLD in the "2.2.1 PortsOrch" section
https://github.com/Azure/SONiC/wiki/Asymmetric-PFC-High-Level-Design#221-portsorch
} | ||
else | ||
{ | ||
pfc_rx_bitmask = pfc_tx_bitmask; |
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.
logic has changed, can you elaborate it in the code?
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.
Logic is exactly the same but code was refactored according to changes for set/getPortPfc API.
orchagent/portsorch.cpp
Outdated
|
||
sai_status_t status = sai_port_api->set_port_attribute(port.m_port_id, &attr); | ||
if (status != SAI_STATUS_SUCCESS) | ||
{ | ||
SWSS_LOG_ERROR("Failed to set PFC mode %d to port id 0x%" PRIx64 " (rc:%d)", port.m_pfc_asym, port.m_port_id, status); | ||
SWSS_LOG_ERROR("Failed to set PFC mode %d for the port 0x%" PRIx64 " (rc:%d)", |
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.
IMO you should remove 'the' after the 'for'
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.
changed
@@ -1329,7 +1329,7 @@ task_process_status QosOrch::handlePortQosMapTable(Consumer& consumer) | |||
|
|||
if (pfc_enable) | |||
{ | |||
if (!gPortsOrch->setPortPfc(port.m_port_id, pfc_enable)) | |||
if (!gPortsOrch->setPortPfc(port.m_port_id, pfc_enable, pfc_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.
the pfc_enable is on/off? if this is the case all other places are mask. can you please elaborate on that?
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, it is according to requirements, "Asym PFC" is "on"/"off" port attribute for the user but SAI requires PFC value to be as bit vector.
https://github.com/Azure/SONiC/wiki/Asymmetric-PFC-High-Level-Design#11-functional-requirements
retest this please |
@volodymyrsamotiy please handle conflicts |
…wd_asym_pfc Conflicts: orchagent/port.h orchagent/portsorch.h
… when Asym PFC is enabled * Correct error message for setting PFC mode Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
handled |
… when Asym PFC is enabled * Fix LGTM failure Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
@neethajohn kindly reminder. this PR should go to 202012 as well. |
@neethajohn Kindly Reminder, we are waiting for the merge of this PR. Thanks. |
@neethajohn - Who can merge this PR ? Thanks. |
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.
Please add unit tests
orchagent/pfcactionhandler.cpp
Outdated
{ | ||
SWSS_LOG_ERROR("Failed to get PFC mask on port 0x%" PRIx64, port); | ||
} | ||
|
||
pfcMask = static_cast<uint8_t>(pfcMask & ~(1 << queueId)); | ||
pfcTxMask = static_cast<uint8_t>(pfcTxMask & ~(1 << queueId)); |
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.
Why do we need to modify Tx Mask? In any case, its a noop if pfcwd is triggered on a lossy priority because the txMask only contains priorities 3 and 4
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.
Agree, we don' need it. Fixed to modify only Rx mask.
orchagent/pfcactionhandler.cpp
Outdated
{ | ||
SWSS_LOG_ERROR("Failed to get PFC mask on port 0x%" PRIx64, getPort()); | ||
} | ||
|
||
pfcMask = static_cast<uint8_t>(pfcMask | (1 << getQueueId())); | ||
pfcTxMask = static_cast<uint8_t>(pfcTxMask | (1 << getQueueId())); |
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.
We shouldn't be modifying Tx Mask since it contains only priorities 3 and 4. We will setting tx mask to incorrect values on pfcwd storm restore if pfcwd was triggered on a lossy priority
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.
Agree, we don' need it. Fixed to modify only Rx mask.
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.
Thinking about this more, we need to set the txmask but need to do it only for queues set in 'pfc_enable' field
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.
Ok, I will change it back and verify
…wd_asym_pfc Conflicts: orchagent/port.h orchagent/portsorch.cpp
… when Asym PFC is enabled * Fix review comments Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
… when Asym PFC is enabled * Fix SAI errors handling for setPortPfc() Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
This pull request fixes 1 alert when merging d710235 into a4c80c3 - view on LGTM.com fixed alerts:
|
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
…wd_asym_pfc Conflicts: tests/test_pfcwd.py
This pull request fixes 1 alert when merging 6fd9206 into 8fd6e48 - view on LGTM.com fixed alerts:
|
…witch" for deriving tor ipv4_address (sonic-net#1360) This PR provides the support for fixing the show muxcable config. There was a change in the Config_DB schema where there was an addition of key-value pair "peer_switch:tor_name" in DEVICE_METADATA|localhost table which actually gives the other TOR's name (hostname). This TOR name is then utilized in PEER_SWITCH|switchname table which has "address_ipv4: IPv4 address" key-value pair, which correctly gives the ip address for displaying on the show mux config What is the motivation for this PR? To add the fix the working for show muxcable config Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
…orch Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
…w one Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
@neethajohn please note comments were addressed. please review and signoff. |
@neethajohn - Can you please approve this PR ? |
@neethajohn - as discussed yesterday, please review. Thanks. |
@volodymyrsamotiy please handle conflicts and we will have it merged. |
@volodymyrsamotiy kindly reminder to handle conflicts so I can merge |
The issue was reported many many releases a go. |
Signed-off-by: Volodymyr Samotiy volodymyrs@mellanox.com
What I did
Add possibility for PFCWD to detect PFC storm on all priorities when asymmetric PFC is enabled.
According to requirements PFCWD should detect PFC storm on the lossy priorities for the port on which asymmetric PFC is enabled.
(when asymmetric PFC is enabled on some port that means such port is enabled for receiving PFC frames on all priorities)
Why I did it
To fix issue #1128.
How I verified it
pause
frames to the test port for all priorities.Details if related
N/A