sonic-net / sonic-snmpagent

A net-snmpd agentx subagent for SONiC
Other
15 stars 113 forks source link

Fix SNMP QoS MIB only shows queues 1-6 on platform with 8 ucast/4 mcast queues #329

Open dgodwin-nokia opened 2 months ago

dgodwin-nokia commented 2 months ago

(Fix for https://github.com/sonic-net/sonic-buildimage/issues/20033)

- What I did

On some platforms (specifically Broadcom TH4/TH5), there are not an equal number of unicast and multicast queues. Previous code would assume that there was an even number, causing missing snmp counters.

Instead of wrapping multicast values based on maximum number of queues, after this change the wrap is based on number of priority groups.

- How I did it

Modified code to use STATE_DB "max_priority_groups" instead of "max_queues".

- How to verify it Verified on J2C/TH4/TH5 based platforms.

snmpwalk shows 8 queues, first 4 show multicast counters:

snmpwalk -v2c -c public 100.117.58.28 1.3.6.1.4.1.9.9.580.1.5.5.1.4.1
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.1.1 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.1.2 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.1.3 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.1.4 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.1.5 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.1.6 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.1.7 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.1.8 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.2.1 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.2.2 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.2.3 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.2.4 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.2.5 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.2.6 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.2.7 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.2.8 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.3.1 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.3.2 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.3.3 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.3.4 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.3.5 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.3.6 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.3.7 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.3.8 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.4.1 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.4.2 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.4.3 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.4.4 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.4.5 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.4.6 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.4.7 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.4.8 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.5.1 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.5.2 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.5.5 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.5.6 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.6.1 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.6.2 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.6.5 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.6.6 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.7.1 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.7.2 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.7.5 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.7.6 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.8.1 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.8.2 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.8.5 = Counter64: 0
iso.3.6.1.4.1.9.9.580.1.5.5.1.4.1.2.8.6 = Counter64: 0

- Description for the changelog

Modify SNMP QoS MIB to wrap multicast counters based on maximum number of priority groups.