Skip to content

Commit

Permalink
enable pfcwd for backplane ports (#3792)
Browse files Browse the repository at this point in the history
* 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 2866ccd)

* enable pfcwd for backplane ports

co-authorized by: jianquanye@microsoft.com
  • Loading branch information
sdszhang authored Mar 7, 2025
1 parent 4bed4d7 commit 51a2e9e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions pfcwd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(set(external_ports + bp_ports))

if not enable or enable.lower() != "enable":
return
Expand Down

0 comments on commit 51a2e9e

Please sign in to comment.