From 3ed05c0e2c29bd678cacc628b30f86d6488be562 Mon Sep 17 00:00:00 2001 From: Dashuai Zhang <164845223+sdszhang@users.noreply.github.com> Date: Fri, 14 Feb 2025 17:07:19 +1100 Subject: [PATCH 1/2] enable pfcwd for backplane ports (#3759) Currently, in Cisco 8800 chassis, PFCWD is only enabled for front end ports, not on backplane. As we have PFC enabled for backplane ports, need to enable pfcwd there too. What I did. Enable PFCWD for backplane ports. How I did it Include backplane ports into the port list to be enabled for pfcwd How to verify it manually copied the file to device, and run pfcwd start_default. (cherry picked from commit 2866ccd9c20231bca87369b93f41f198ce55852b) --- pfcwd/main.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pfcwd/main.py b/pfcwd/main.py index 7813bbd759..aeef59efa5 100644 --- a/pfcwd/main.py +++ b/pfcwd/main.py @@ -105,6 +105,17 @@ def get_server_facing_ports(db): return server_facing_ports +def get_bp_ports(db): + """ Get all the backplane ports. """ + candidates = db.get_table('PORT') + bp_ports = [] + for port in candidates: + if candidates[port].get('admin_status') == 'up' \ + and candidates[port].get('role') == 'Int': + bp_ports.append(port) + return bp_ports + + class PfcwdCli(object): def __init__( self, db=None, namespace=None, display=constants.DISPLAY_ALL @@ -365,9 +376,10 @@ def start_default(self): ) # Get active ports from Config DB - active_ports = natsorted( - list(self.config_db.get_table('DEVICE_NEIGHBOR').keys()) - ) + external_ports = list(self.config_db.get_table('DEVICE_NEIGHBOR').keys()) + bp_ports = get_bp_ports(self.config_db) + + active_ports = natsorted(list(set(external_ports + bp_ports))) if not enable or enable.lower() != "enable": return From 7e656844c874ffc4f62b1aafeccb50e9c94fe521 Mon Sep 17 00:00:00 2001 From: Dashuai Zhang Date: Fri, 7 Mar 2025 11:10:31 +1100 Subject: [PATCH 2/2] enable pfcwd for backplane ports --- pfcwd/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfcwd/main.py b/pfcwd/main.py index aeef59efa5..ac6075385b 100644 --- a/pfcwd/main.py +++ b/pfcwd/main.py @@ -379,7 +379,7 @@ def start_default(self): external_ports = list(self.config_db.get_table('DEVICE_NEIGHBOR').keys()) bp_ports = get_bp_ports(self.config_db) - active_ports = natsorted(list(set(external_ports + bp_ports))) + active_ports = natsorted(set(external_ports + bp_ports)) if not enable or enable.lower() != "enable": return