Skip to content

Commit

Permalink
Fix SNMP QoS MIB only shows queues 1-6 on platform with 8 ucast/4 mca…
Browse files Browse the repository at this point in the history
…st queues

(Fix for sonic-net/sonic-buildimage#20033)

Signed-off-by: Dylan Godwin <[email protected]>
  • Loading branch information
dgodwin-nokia committed Nov 13, 2024
1 parent c5301b2 commit 6a042e2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/sonic_ax_impl/mibs/vendor/cisco/ciscoSwitchQosMIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ def update_stats(self):
if pq_count < max_queues_half:
pq_count = max_queues_half

# If there is a max_priority_group param in statedb, use that if it is greater
priority_group_count = int(Namespace.dbs_get_all(self.db_conn, mibs.STATE_DB,
mibs.buffer_max_parm_table(self.oid_name_map[if_index]))['max_priority_groups'])

if(pq_count < priority_group_count):
pq_count = priority_group_count

for queue in if_queues:
# Get queue type and statistics
queue_sai_oid = self.port_queues_map[mibs.queue_key(if_index, queue)]
Expand Down
3 changes: 3 additions & 0 deletions tests/mock_tables/asic0/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
"state": "Active"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet0": {
"max_priority_groups": "8",
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet4": {
"max_priority_groups": "8",
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet24": {
"max_priority_groups": "8",
"max_queues": "16"
}
}
3 changes: 3 additions & 0 deletions tests/mock_tables/asic1/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@
"state": "Established"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet8": {
"max_priority_groups": "8",
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet12": {
"max_priority_groups": "8",
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet32": {
"max_priority_groups": "8",
"max_queues": "16"
}
}
3 changes: 3 additions & 0 deletions tests/mock_tables/asic2/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
"state": "Established"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet-BP16": {
"max_priority_groups": "8",
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet-BP20": {
"max_priority_groups": "8",
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet40": {
"max_priority_groups": "8",
"max_queues": "16"
}
}
17 changes: 12 additions & 5 deletions tests/mock_tables/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,24 +197,31 @@
"state" : "Deleted"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet0": {
"max_queues": "16"
"max_queues": "16",
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet4": {
"max_queues": "16"
"max_queues": "16",
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet8": {
"max_queues": "16"
"max_queues": "16",
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet16": {
"max_queues": "16"
"max_queues": "16",
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet24": {
"max_queues": "16"
"max_queues": "16",
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet32": {
"max_priority_groups": "8",
"max_queues": "16"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet78": {
"max_priority_groups": "8",
"max_queues": "16"
}
}

0 comments on commit 6a042e2

Please sign in to comment.