Skip to content

Commit b7b1070

Browse files
authored
Fix TODO to get/set active ports only (sonic-net#494)
Signed-off-by: Wenda Ni <wenni@microsoft.com>
1 parent 0e81375 commit b7b1070

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

scripts/ecnconfig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ WRED_CONFIG_FIELDS = {
6868
"rdrop": "red_drop_probability"
6969
}
7070

71-
PORT_TABLE_NAME = "PORT"
72-
QUEUE_TABLE_NAME = "QUEUE"
73-
FIELD = "wred_profile"
74-
ON = "[WRED_PROFILE|AZURE_LOSSLESS]"
75-
OFF = "[]"
71+
PORT_TABLE_NAME = "PORT"
72+
QUEUE_TABLE_NAME = "QUEUE"
73+
DEVICE_NEIGHBOR_TABLE_NAME = "DEVICE_NEIGHBOR"
74+
FIELD = "wred_profile"
75+
ON = "[WRED_PROFILE|AZURE_LOSSLESS]"
76+
OFF = "[]"
7677

7778
lossless_queues = ['3', '4']
7879

@@ -153,10 +154,9 @@ class EcnQ(object):
153154
if q not in lossless_queues:
154155
sys.exit('Invalid queue index: %s' % q)
155156

156-
# TODO: Change to use active ports only
157157
def gen_ports_key(self):
158158
if self.ports_key is not None:
159-
port_table = self.config_db.get_table(PORT_TABLE_NAME)
159+
port_table = self.config_db.get_table(DEVICE_NEIGHBOR_TABLE_NAME)
160160
self.ports_key = port_table.keys()
161161

162162
self.ports_key.sort(key = lambda k: int(k[8:]))

0 commit comments

Comments
 (0)