-
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
[orchagent]: Added support of PFC WD for BFN platform #823
Conversation
Signed-off-by: Vitaliy Senchyshyn <vsenchyshyn@barefootnetworks.com>
@stcheng @marian-pritsak @lguohan Please review |
Signed-off-by: Vitaliy Senchyshyn <vsenchyshyn@barefootnetworks.com>
@@ -21,70 +21,81 @@ for i = n, 1, -1 do | |||
local is_deadlock = false | |||
local pfc_wd_status = redis.call('HGET', counters_table_name .. ':' .. KEYS[i], 'PFC_WD_STATUS') | |||
local pfc_wd_action = redis.call('HGET', counters_table_name .. ':' .. KEYS[i], 'PFC_WD_ACTION') | |||
if pfc_wd_status == 'operational' or pfc_wd_action == 'alert' then |
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.
Is this file identical to Mellanox too? If yes, will the symlink work?
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.
Since it was there before and it's related to a different platform It's better to leave it as is.
Has it passed the pfc watchdog test? |
|
(occupancy_bytes == 0 and packets - packets_last == 0 and (pfc_duration - pfc_duration_last) > poll_time * 0.8) then | ||
if time_left <= poll_time then | ||
redis.call('HDEL', counters_table_name .. ':' .. port_id, pfc_rx_pkt_key .. '_last') | ||
redis.call('HDEL', counters_table_name .. ':' .. port_id, pfc_duration_key .. '_last') |
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.
You do not need to learn hdel _RX_PKTS_last and _RX_PAUSE_DURATION_last on lines 74 & 75 from the Mellanox script. This is to solve the double storm signaling that was observed on Mellanox platforms. I assume barefoot platforms do not have this issue. #697
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.
@andriymoroz-mlnx for comments
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 is not Mellanox issue. It is common for this approach. If Barefoot uses the same solution (approach, counters, etc) they can use the same script
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 issue should not be related to the counters set Mellanox chooses. Excluding the counter factors, this should also happen on brcm platforms. However, we do not observe the issue on brcm platforms so far.
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.
I think Broadcom uses different way to detect storm and thus do not have this issue
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.
Difference is only in the counter set. The idea behind is the same---no packets going out of the queue and the queue is paused.
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 dual storm signaling should only happen if the drop action is not installed by the orchagent fast enough. pfcactionhandler initCounters() will flip the PFC_WD_STATUS from operational to stormed as part of its drop actions. If PFC_WD_STATUS is not operational, the detect script logic will exit early on line 26 without running the actual detect state machine. So there should be no occurrence of dual storm signaling at all. The possible cause I can think of is that the control-plane cpu is not fast enough to schedule running the orchagent drop actions within a polling interval of 200 ms https://github.com/Azure/sonic-swss/blob/f22fb80bdfa10ea38e718996235c99233e08c31a/orchagent/pfc_detect_barefoot.lua#L26
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.
Let's better keep it as is. In case race condition really happens it will be very hard to catch and fix.
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.
I suggest we start from a clean implementation rather than patch it here and there. The double storming signaling can be captured by PFC watchdog test. This is how mlnx found the problem on their platforms. Function-wise, double signaling does not affect the proper detection and the proper restoration.
Last time, you said bfn still uses manual test for PFC watchdog validation. If you have proof that it does exist also on bfn, we can later add the patch back.
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.
@wendani the ct test passed for bfn with these changes. If we are talking about fast or not fast cpu I would say it hard to catch the race condition on all possible CPUs, as bfn sdk could run on different platform vendors and this value could differ. Could we leave this check to avoid further patching and would see in context this feature will evolve?
-- Save values for next run | ||
redis.call('HSET', counters_table_name .. ':' .. KEYS[i], 'SAI_QUEUE_STAT_PACKETS_last', packets) | ||
redis.call('HSET', counters_table_name .. ':' .. KEYS[i], 'PFC_WD_DETECTION_TIME_LEFT', time_left) | ||
if is_deadlock == false then |
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.
Drop the 'if is_deadlock == false' condition. #697
@lguohan I've updated the PR according to baseline changes, but the test log is quite strange as well as the "No test results found" result. Not sure how the PFC WD changes could cause all these fails in mirror and other stuff: https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/sonic-swss-build-pr/40/consoleFull Is this something on your side? |
retest this please |
3d4145e
to
e52721c
Compare
retest this please |
3 similar comments
retest this please |
retest this please |
retest this please |
After the change in master branch updating SAI from 3.5.3.1m-25 to 3.7.3.2, we always found kernel panic after running fast-reboot command in testing SONiC with traffic. In the up path of fast-reboot, we can find warning messages like "unhandled irq 16 error" before kernel panic, which implies that some components are not properly closed in the down path. This fix will unload certain kernel modules by stopping opennsl before fast-reboot, which is suggested by BRCM. Note that another part of the fix is to add 'ExecStop=-/etc/init.d/opennsl-modules stop' to sonic-buildimage:platform/broadcom/saibcm-modules/systemd/opennsl-modules.service, which will be included in another pull request.
This fix brings in support for cisco-8000 platform into sonic-sairedis/syncd. It checks for the SONIC_ASIC_TYPE keyword and picks up the PLATFORM type to see if "cisco-8000" word is available. Accordingly, it sources the required paths for SDK to carry on its operations.
Signed-off-by: Vitaliy Senchyshyn vsenchyshyn@barefootnetworks.com
What I did
Added instance of PfcWdSwOrch in OrchDaemon::init() in case of Barefoot platform. Fixed PFC WD detection logic in pfc_detect_barefoot.lua script.
Why I did it
PFC WD wasn't working for BFN platform.
How I verified it
pfc_wd community test has passed
Tested it manually with BFN platform by simulating PFC storm and verified that PWC storm was successfully detected wen occurred and restored when disappeared by the WD. Validated all the counters used by PFC WD functionality worked properly.
Details if related