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 Aug 29, 2024
1 parent deb7b7c commit eb9538a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
5 changes: 2 additions & 3 deletions src/sonic_ax_impl/mibs/vendor/cisco/ciscoSwitchQosMIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,8 @@ 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_queues = Namespace.dbs_get_all(self.db_conn, mibs.STATE_DB,
mibs.buffer_max_parm_table(self.oid_name_map[if_index]))['max_queues']
pq_count = math.ceil(int(port_max_queues) / 2)
pq_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'])

for queue in if_queues:
# Get queue type and statistics
Expand Down
6 changes: 3 additions & 3 deletions tests/mock_tables/asic0/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"state": "Active"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet0": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet4": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet24": {
"max_queues": "16"
"max_priority_groups": "8"
}
}
6 changes: 3 additions & 3 deletions tests/mock_tables/asic1/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
"state": "Established"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet8": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet12": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet32": {
"max_queues": "16"
"max_priority_groups": "8"
}
}
6 changes: 3 additions & 3 deletions tests/mock_tables/asic2/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"state": "Established"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet-BP16": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet-BP20": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet40": {
"max_queues": "16"
"max_priority_groups": "8"
}
}
12 changes: 6 additions & 6 deletions tests/mock_tables/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,21 @@
"state" : "Deleted"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet0": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet4": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet8": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet16": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet24": {
"max_queues": "16"
"max_priority_groups": "8"
},
"BUFFER_MAX_PARAM_TABLE|Ethernet32": {
"max_queues": "16"
"max_priority_groups": "8"
}
}

0 comments on commit eb9538a

Please sign in to comment.