Support range-based QUEUE config keys in qos_sai_base.py.#24656
Open
bchovva wants to merge 1 commit into
Open
Conversation
Add a helper to resolve CONFIG_DB queue keys that may be stored either as single-queue entries or as queue ranges. Signed-off-by: Bhavana Chovva <bchovva@marvell.com>
|
|
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
This PR has backport request for branch(es): 202505,202511. ---Powered by SONiC BuildBot
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Add a helper to resolve CONFIG_DB queue keys that may be stored either as single-queue entries or as queue ranges in tests/qos/qos_sai_base.py.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
The existing QosSaiBase code hard-codes the CONFIG_DB queue key format as QUEUE|| (e.g., QUEUE|Ethernet0|3). This breaks when the CONFIG_DB uses range-based queue keys (e.g., QUEUE|Ethernet0|0-2), causing QoS SAI tests to fail on platforms that store queue configurations using ranges.
How did you do it?
Added a new helper method _get_queue_config_key(dut_asic, port, queue) to the QosSaiBase class in tests/qos/qos_sai_base.py that:
Queries all QUEUE||* keys from CONFIG_DB
Supports legacy per-queue keys (e.g., QUEUE|Ethernet0|3)
Supports range-based keys (e.g., QUEUE|Ethernet0|0-2) by checking if the queue index falls within the range
Returns the matching key, or None (with an assert) if no matching key is found
The existing code that fetches the scheduler field was updated to call this helper before the Redis lookup, replacing the hard-coded key format.
How did you verify/test it?
Validated the changes in tests with t0 topology
Ran the testcase qos/test_qos_sai.py::TestQosSai::testQosSaiDwrrWeightChange
Confirmed no regressions in existing functionality
Any platform specific information?
NA
Supported testbed topology if it's a new test case?
NA
Documentation