-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SNMP dropping some of the queue counter when create_only_config_d… #1
Fix SNMP dropping some of the queue counter when create_only_config_d… #1
Conversation
b15b022
to
a0ce63d
Compare
# Otherwise the first half of queue id is for ucast, and second half is for mcast | ||
# In that case to simulate vendor OID, we wrap queues by half distance | ||
div = 1 if create_only_config_db_buffers == 'true' else 2 | ||
pq_count = math.ceil((max(if_queues) + 1) / div) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It assumed
- the number of counters equals the number of queues
- the number of UC queues equals the number of MC queues
After the change, assumption 2 is still true but assumption 1 can be false.
I do not suggest calculating pq_count
by dividing max(if_queues)
by 2 by default or 1 when create_only_config_db_buffers
is configured. It can still break the logic in case a user configures a buffer on an MC queue.
I suggest the following ways to maintain backward compatibility after create_only_config_db_buffers
- leveraging the mapping
COUNTERS_QUEUE_TYPE_MAP
- fetching the number of queues from
STATE_DB.BUFFER_MAX_PARAM_TABLE|<port>.max_queues
However, I have to say, this is still not 100% correct especially if a vendor doesn't have MC queues
a709fcc
to
79a5b82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…b_buffers is set to true This happened because the MIB assumed that half the queues configured are for mcast. To remove this assumpetion we will check the max number of queues from STATE_DB.BUFFER_MAX_PARAM_TABLE|<port>.max_queues
79a5b82
to
71f9e81
Compare
…b_buffers is set to true
This happened because the MIB assumed that half the queues configured are for mcast. When create_only_config_db_buffers is set to true this is not the case
- What I did
The ciscoSwitchQosMIB MIB assumed that all the counter are configured and that half of the configured queues are for mcast.
This is no longer true, the feature "polling only configured ports buffer queue" make it possible for port to not have MC counters.
This wrong assumption caused issue
To fix this, I instead used the BUFFER_MAX_PARAM_TABLE to find the max possible queues
- How I did it
- How to verify it
Inside the SNMP docker run snmp walk:
$ snmpwalk -v2c -c msft 10.64.247.240 1.3.6.1.4.1.9.9.580.1.5.5.1.4.1
Check that the results is not missing counters from any queue
- Description for the changelog