[pfcwd]: support BIG_RED_SWITCH mode#467
Conversation
Signed-off-by: Sihui Han <sihan@microsoft.com>
|
retest this please |
| { | ||
| if (entry->second.handler != nullptr) | ||
| { | ||
| SWSS_LOG_NOTICE( |
There was a problem hiding this comment.
Why move logs from handler to this orch?
There was a problem hiding this comment.
Since in big-red-switch mode, we don't want to have log relates to storm detect/restore. Moving log out of handler class provides flexibility for users to input various logs depending on the use case when they create action handler
orchagent/pfcwdorch.cpp
Outdated
| for (auto & it: allPorts) | ||
| { | ||
| Port port = it.second; | ||
| if (port.m_alias != "Ethernet8") |
There was a problem hiding this comment.
What's this magic ifname?
| void setBigRedSwitchMode(string value); | ||
|
|
||
| map<sai_object_id_t, PfcWdQueueEntry> m_entryMap; | ||
| map<sai_object_id_t, PfcWdQueueEntry> m_brsEntryMap; |
There was a problem hiding this comment.
Why separate map for BRS?
There was a problem hiding this comment.
After disable big-red-switch, we need to keep the PFC WD original configuration. This information actually is stored in m_entryMap. It would be better if we don't mix this information with brs.
There was a problem hiding this comment.
In line 398 in .cpp file entry is removed from the regular map when BRS is enabled, but it is not added back when BRS is disabled.
In case we had some handler, and BRS is flipped on/off, will we end up with no handler after BRS off?
There was a problem hiding this comment.
That’s true. The previous active handlers mark the storm happens when BRS was enabled. After BRS runs for a while, the previous state is out of date so it’s unecessary to recreate those handlers. Instead we just need to recover the PWCWD configuration and let it detect storm again. And the configuration comes from entrymap
| string queueIdStr = sai_serialize_object_id(queueId); | ||
|
|
||
| vector<FieldValueTuple> countersFieldValues; | ||
| countersFieldValues.emplace_back("BIG_RED_SWITCH_MODE", "enable"); |
There was a problem hiding this comment.
I don't think that plugins should know about BRS. Since you chose to keep them running, you might as well ignore notifications from plugins by checking a flag in orch.
There was a problem hiding this comment.
I would prefer to let plugins aware of BRS. Otherwise, syncd will runplugin and keeps sending notification every 100ms. Even though swss can ingore, it still consumes a lot unnecessary resources.
There was a problem hiding this comment.
Maybe then it is better to unregister plugins or have some field in DB along with poll interval that will globally turn plugins on/off?
There was a problem hiding this comment.
I think both method are mostly identical, and the only difference is how to skip plugins. The benefit to achieve this in lua script is it's lightweight and only affect pfcwd, also it don't need modification of syncd and makes syncd logic simpler. If you would prefer to change the logic to syncd, I can add it to backlog and change it later.
There was a problem hiding this comment.
Have added it to backlog. sonic-net/sonic-sairedis#314
| return; | ||
| } | ||
|
|
||
| uint8_t pfcMask = attr.value.u8; |
There was a problem hiding this comment.
This is not aligned with asymmetric PFC
There was a problem hiding this comment.
This need to be updated once asym PFC is supported. There was one comment above this part of the code to remind us to update this part once asy is enabled.
There was a problem hiding this comment.
Oh, I thought it already was. My bad.
* [pfcwd]: enable BIG_RED_SWITCH mode Signed-off-by: Sihui Han <sihan@microsoft.com> * update as comments
* Option '-d' means read the EEPROM information from DB directly * CLI "show platform syseeprom" will invoke decode-syseeprom with '-d' option Signed-off-by: Kevin Wang <kevinw@mellanox.com>
* Rename to fix typo Signed-off-by: Wenda Ni <wenni@microsoft.com> * Correct shared_ptr creation parameters Signed-off-by: Wenda Ni <wenni@microsoft.com>
* [pfcwd]: enable BIG_RED_SWITCH mode Signed-off-by: Sihui Han <sihan@microsoft.com> * update as comments
* [pfcwd]: enable BIG_RED_SWITCH mode Signed-off-by: Sihui Han <sihan@microsoft.com> * update as comments
Signed-off-by: Sihui Han sihan@microsoft.com
What I did
Enable support for BIG_RED_SWITCH mode:
The Expect behavior:
When BIG_RED_SWITCH mode is disabled:
PFCWD goes back to normal, and start to check/restore pfc storm.
BIG_RED_SWITCH mode can be enabled and disabled anytime even if PFCWD was not enabled on any port before.
Why I did it
Per request, BIG_RED_SWITCH mode provides a button to drop all lossless packets on a switch.
How I verified it
Tested on DUT
Details if related