Skip to content

Commit

Permalink
[ecnconfig] handle backend port names when extracting port I/F ID fro…
Browse files Browse the repository at this point in the history
…m the port name (#1361)
  • Loading branch information
smaheshm committed Jan 20, 2021
1 parent 37695c8 commit f4edba1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/ecnconfig
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ class EcnQ(object):
port_table = self.config_db.get_table(DEVICE_NEIGHBOR_TABLE_NAME)
self.ports_key = port_table.keys()

self.ports_key = sorted(self.ports_key, key = lambda k: int(k[8:]))
# In multi-ASIC platforms backend ethernet ports are identified as
# 'Ethernet-BPxy'. Add 1024 to sort backend ports to the end.
self.ports_key.sort(
key = lambda k: int(k[8:]) if "BP" not in k else int(k[11:]) + 1024
)

def set(self, enable):
if os.geteuid() != 0:
Expand Down

0 comments on commit f4edba1

Please sign in to comment.