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 authored and abdosi committed Jan 28, 2021
1 parent 7f5c3b4 commit 235c61c
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 @@ -199,7 +199,11 @@ class EcnQ(object):
port_table = self.config_db.get_table(DEVICE_NEIGHBOR_TABLE_NAME)
self.ports_key = port_table.keys()

self.ports_key.sort(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 235c61c

Please sign in to comment.