Skip to content

Commit

Permalink
Use max queues
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZagury committed Dec 18, 2023
1 parent 44c9da4 commit 79a5b82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ def init_sync_d_queue_tables(db_conn):
port_index = get_index_from_str(port_name)
key = queue_key(port_index, queue_index)
port_queues_map[key] = sai_id

queue_stat_name = queue_table(sai_id)
queue_stat = db_conn.get_all(COUNTERS_DB, queue_stat_name, blocking=False)
if queue_stat is not None:
Expand Down
6 changes: 4 additions & 2 deletions src/sonic_ax_impl/mibs/vendor/cisco/ciscoSwitchQosMIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def update_stats(self):

# The first half of queue id is for ucast, and second half is for mcast
# To simulate vendor OID, we wrap queues by max priority groups
port_max_priority_groups = self.statedb.get_all(self.statedb.STATE_DB, mibs.buffer_max_parm_table(self.oid_name_map[if_index]))['max_priority_groups']
port_max_queues = self.statedb.get_all(self.statedb.STATE_DB,
mibs.buffer_max_parm_table(self.oid_name_map[if_index]))['max_queues']
pq_count = math.ceil((port_max_queues + 1) / 2)

for queue in if_queues:
# Get queue type and statistics
Expand All @@ -146,7 +148,7 @@ def update_stats(self):
# Add supported counters to MIBs list and store counters values
for (counter, counter_type), counter_mib_id in CounterMap.items():
# Only egress queues are supported
mib_oid = (if_index, int(DirectionTypes.EGRESS), (queue % int(port_max_priority_groups)) + 1, counter_mib_id)
mib_oid = (if_index, int(DirectionTypes.EGRESS), (queue % pq_count) + 1, counter_mib_id)

counter_value = 0
if queue_type == counter_type:
Expand Down

0 comments on commit 79a5b82

Please sign in to comment.