Skip to content

Commit 235c61c

Browse files
smaheshmabdosi
authored andcommitted
[ecnconfig] handle backend port names when extracting port I/F ID from the port name (sonic-net#1361)
1 parent 7f5c3b4 commit 235c61c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/ecnconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ class EcnQ(object):
199199
port_table = self.config_db.get_table(DEVICE_NEIGHBOR_TABLE_NAME)
200200
self.ports_key = port_table.keys()
201201

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

204208
def set(self, enable):
205209
if os.geteuid() != 0:

0 commit comments

Comments
 (0)