Skip to content
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

Closed

Conversation

DavidZagury
Copy link
Owner

@DavidZagury DavidZagury commented Dec 14, 2023

…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

@DavidZagury DavidZagury force-pushed the master_fix_snmp_counters_with_create_only_config branch from b15b022 to a0ce63d Compare December 14, 2023 18:23
# 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)
Copy link

@stephenxs stephenxs Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It assumed

  1. the number of counters equals the number of queues
  2. 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

  1. leveraging the mapping COUNTERS_QUEUE_TYPE_MAP
  2. 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

@DavidZagury DavidZagury force-pushed the master_fix_snmp_counters_with_create_only_config branch 6 times, most recently from a709fcc to 79a5b82 Compare December 18, 2023 08:17
Copy link

@stephenxs stephenxs left a 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
@DavidZagury DavidZagury force-pushed the master_fix_snmp_counters_with_create_only_config branch from 79a5b82 to 71f9e81 Compare December 18, 2023 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants