From 6922014b5dbcbc7de171e87771f387c10debde3b Mon Sep 17 00:00:00 2001 From: Dashuai Zhang <164845223+sdszhang@users.noreply.github.com> Date: Thu, 25 Sep 2025 11:55:24 +1000 Subject: [PATCH] Fix SONiC PFC storm generation script on Arista devices (#20764) This script will only be called on fanout, the new change includes: create the PORT_QOS_MAP entry before calling config interface pfc priority {intf} {prio} on Remove the PORT_QOS_MAP when stopping pfc storm, For SONiC fanout, use self._shellCmd() instead of incorrect self._cliCmd() when disabling PFC. How did you verify/test it? On local testbed. Any platform specific information? Arista SONiC fanout only. --- tests/common/helpers/pfc_gen_brcm_xgs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/common/helpers/pfc_gen_brcm_xgs.py b/tests/common/helpers/pfc_gen_brcm_xgs.py index 8232d117425..cb098f8c5a8 100755 --- a/tests/common/helpers/pfc_gen_brcm_xgs.py +++ b/tests/common/helpers/pfc_gen_brcm_xgs.py @@ -148,11 +148,12 @@ def _endPfcStorm(self, intf): self._bcmltshellCmd(f"pt MMU_INTFO_TO_XPORT_BKPr set BCMLT_PT_PORT={mmuPort} PAUSE_PFC_BKP=0") else: self._bcmshellCmd(f"setreg CHFC2PFC_STATE.{port} PRI_BKP=0") - self._cliCmd(f"en\nconf\n\nint {intf}\nno priority-flow-control on") if self.os == 'sonic': for prio in range(8): - self._cliCmd(f"config interface pfc priority {intf} {prio} off") + self._shellCmd(f"config interface pfc priority {intf} {prio} off") + self._shellCmd(f"redis-cli -n 4 DEL \"PORT_QOS_MAP|{intf}\"") else: + self._cliCmd(f"en\nconf\n\nint {intf}\nno priority-flow-control on") for prio in range(8): self._cliCmd(f"en\nconf\n\nint {intf}\nno priority-flow-control priority {prio} no-drop") @@ -164,6 +165,7 @@ def startPfcStorm(self, intf): mmuPort = self.intfToMmuPort[intf] port = self.intfToPort[intf] if self.os == 'sonic': + self._shellCmd(f"redis-cli -n 4 HSET \"PORT_QOS_MAP|{intf}\" \"pfc_enable\" \"\"") for prio in range(8): if (1 << prio) & self.priority: self._shellCmd(f"config interface pfc priority {intf} {prio} on")