Repository navigation
[Nexthop][fboss2-dev] Add active-queue-management (AQM) support to queuing-policy queue-id CLI - #866
Closed
benoit-nexthop wants to merge 1 commit into
Closed
benoit-nexthop wants to merge 1 commit into
benoit-nexthop wants to merge 1 commit into
Conversation
This was referenced Jan 29, 2026
Closed
benoit-nexthop
force-pushed
the
fboss2-cli-prototype_part22
branch
from
February 2, 2026 16:39
46d1f4a to
7be0a14
Compare
meta-codesync Bot
pushed a commit
that referenced
this pull request
Mar 18, 2026
…863) Summary: **Pre-submission checklist** - [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install` - [x] `pre-commit run` Implements new fboss2-dev CLI commands for configuring port queue configs (PortQueue) under queuing policies. This allows setting queue scheduling, weights, buffer sizes, and other queue-related parameters. Command syntax uses key-value pairs to set multiple attributes at once: ``` config qos queuing-policy <name> queue-id <id> <attr> <value> [<attr> <value> ...] ``` Valid attributes: - scheduling: `WRR`, `SP`, `DRR` (or full names: `WEIGHTED_ROUND_ROBIN`, `STRICT_PRIORITY`, `DEFICIT_ROUND_ROBIN`) - weight: queue weight (integer) - shared-bytes: shared buffer bytes (integer) - reserved-bytes: reserved buffer bytes (integer) - scaling-factor: MMU scaling factor (e.g., `TWO`, `FOUR`, `ONE_HALF`) - stream-type: stream type (`UNICAST`, `MULTICAST`, `ALL`, `FABRIC_TX`) - buffer-pool-name: name of buffer pool to use All enum values (scheduling, stream-type, scaling-factor) are case-insensitive, so both `wrr` and `WRR` are accepted. Also refactors the `cleanup_config()` helper function into `cli_test_lib.py` to reduce code duplication between `test_config_pfc.py` and `test_config_portqueuecfg.py`. Note: this change is part of a series, the previous one is #862, the next one is #866. Pull Request resolved: #863 Test Plan: End to end tests: ``` ====================================================================== CLI E2E Test: Port Queue Configuration ====================================================================== [Step 0] Cleaning up any existing test config... Copying system config to session config... Removing port queue configs... Updating metadata for AGENT_RESTART... Committing cleanup... Using CLI from FBOSS_CLI_PATH: /home/admin/benoit/fboss2-dev [CLI] Running: config session commit [CLI] Completed in 4.36s: config session commit Cleanup complete [Step 1] Configuring buffer pool 'cli_e2e_test_buffer_pool'... [CLI] Running: config qos buffer-pool cli_e2e_test_buffer_pool shared-bytes 78773528 [CLI] Completed in 0.07s: config qos buffer-pool cli_e2e_test_buffer_pool shared-bytes 78773528 [CLI] Running: config qos buffer-pool cli_e2e_test_buffer_pool headroom-bytes 4405376 [CLI] Completed in 0.06s: config qos buffer-pool cli_e2e_test_buffer_pool headroom-bytes 4405376 Buffer pool configured [Step 2] Configuring queuing policy 'cli_e2e_test_queue_policy'... Configuring queue-id 2... [CLI] Running: config qos queuing-policy cli_e2e_test_queue_policy queue-id 2 scheduling SP weight 10 shared-bytes 83618832 [CLI] Completed in 0.06s: config qos queuing-policy cli_e2e_test_queue_policy queue-id 2 scheduling SP weight 10 shared-bytes 83618832 Configuring queue-id 6... [CLI] Running: config qos queuing-policy cli_e2e_test_queue_policy queue-id 6 scheduling SP shared-bytes 83618832 scaling-factor TWO [CLI] Completed in 0.07s: config qos queuing-policy cli_e2e_test_queue_policy queue-id 6 scheduling SP shared-bytes 83618832 scaling-factor TWO Configuring queue-id 7... [CLI] Running: config qos queuing-policy cli_e2e_test_queue_policy queue-id 7 scheduling WRR weight 20 reserved-bytes 5000 buffer-pool-name cli_e2e_test_buffer_pool [CLI] Completed in 0.06s: config qos queuing-policy cli_e2e_test_queue_policy queue-id 7 scheduling WRR weight 20 reserved-bytes 5000 buffer-pool-name cli_e2e_test_buffer_pool Configuring queue-id 3... [CLI] Running: config qos queuing-policy cli_e2e_test_queue_policy queue-id 3 scheduling WRR weight 15 stream-type MULTICAST [CLI] Completed in 0.07s: config qos queuing-policy cli_e2e_test_queue_policy queue-id 3 scheduling WRR weight 15 stream-type MULTICAST All queues configured [Step 3] Committing configuration... [CLI] Running: config session commit [CLI] Completed in 16.23s: config session commit Configuration committed successfully [Step 4] Verifying configuration... Buffer pool 'cli_e2e_test_buffer_pool' verified Queuing policy 'cli_e2e_test_queue_policy' verified ====================================================================== TEST PASSED ====================================================================== [Step 5] Cleaning up test config... Copying system config to session config... Removing port queue configs... Updating metadata for AGENT_RESTART... Committing cleanup... [CLI] Running: config session commit [CLI] Completed in 5.46s: config session commit Cleanup complete ``` ## Sample usage ``` [admin@fboss101 ~]$ ~/benoit/fboss2-dev config qos queuing-policy test-queue queue-id 0 scheduling WRR weight 10 reserved-bytes 1000 Successfully configured queuing-policy 'test-queue' queue-id 0 [admin@fboss101 ~]$ ~/benoit/fboss2-dev config qos queuing-policy test-queue queue-id 1 scheduling SP shared-bytes 83618832 scaling-factor TWO Successfully configured queuing-policy 'test-queue' queue-id 1 [admin@fboss101 ~]$ ~/benoit/fboss2-dev config qos queuing-policy test-queue queue-id 2 buffer-pool-name ingress_pool Successfully configured queuing-policy 'test-queue' queue-id 2 [admin@fboss101 ~]$ ~/benoit/fboss2-dev config session diff --- current live config +++ session config @@ -2197,7 +2197,30 @@ "maxNeighborProbes": 300, "mirrorOnDropReports": [], "mirrors": [], - "portQueueConfigs": {}, + "portQueueConfigs": { + "test-queue": [ + { + "id": 0, + "reservedBytes": 1000, + "scheduling": 0, + "streamType": 0, + "weight": 10 + }, + { + "id": 1, + "scalingFactor": 9, + "scheduling": 1, + "sharedBytes": 83618832, + "streamType": 0 + }, + { + "bufferPoolName": "ingress_pool", + "id": 2, + "scheduling": 0, + "streamType": 0 + } + ] + }, "ports": [ { "conditionalEntropyRehash": false, ``` Sample usage (showing case-insensitive enum values) ``` [admin@fboss101 ~]$ ~/benoit/fboss2-dev config qos queuing-policy test-policy queue-id 0 scheduling wrr weight 10 stream-type multicast Successfully configured queuing-policy 'test-policy' queue-id 0 [admin@fboss101 ~]$ ~/benoit/fboss2-dev config session diff --- current live config +++ session config @@ -2197,7 +2197,16 @@ "maxNeighborProbes": 300, "mirrorOnDropReports": [], "mirrors": [], - "portQueueConfigs": {}, + "portQueueConfigs": { + "test-policy": [ + { + "id": 0, + "scheduling": 0, + "streamType": 1, + "weight": 10 + } + ] + }, "ports": [ { "conditionalEntropyRehash": false, ``` Reviewed By: AarjunC Differential Revision: D96986352 Pulled By: joseph5wu fbshipit-source-id: 36f1ba29c52c8f91ef9cfde7681efb42c4dda036
benoit-nexthop
force-pushed
the
fboss2-cli-prototype_part22
branch
from
March 18, 2026 02:34
7be0a14 to
fed8def
Compare
# Summary
This adds support for configuring Active Queue Management (AQM) attributes
on port queues via the CLI. The AQM configuration includes:
- congestion-behavior: `ECN` or `EARLY_DROP`
- detection linear: with minimum-length, maximum-length, and probability
The active-queue-management keyword must come last in the command as it
consumes all remaining arguments for its nested sub-attributes.
# Test Plan
End-to-end test output (new test case with queue-id 4 with AQM):
```
[...]
Configuring queue-id 4...
[CLI] Running: config qos queuing-policy cli_e2e_test_queue_policy queue-id 4 scheduling SP shared-bytes 83618832 active-queue-management congestion-behavior ECN detection linear minimum-length 120000 maximum-length 120000 probability 100
======================================================================
TEST PASSED
======================================================================
```
## Sample usage
```
$ fboss2 config qos queuing-policy test_policy queue-id 5 scheduling sp \
active-queue-management congestion-behavior ecn \
detection linear minimum-length 120000 maximum-length 120000 probability 100
Successfully configured queuing-policy 'test_policy' queue-id 5
$ fboss2 config session diff
+ "portQueueConfigs": {
+ "test_policy": [
+ {
+ "aqms": [
+ {
+ "behavior": 1,
+ "detection": {
+ "linear": {
+ "maximumLength": 120000,
+ "minimumLength": 120000,
+ "probability": 100
+ }
+ }
+ }
+ ],
+ "id": 5,
+ "scheduling": 1,
+ "streamType": 0
+ }
+ ]
+ },
```
benoit-nexthop
force-pushed
the
fboss2-cli-prototype_part22
branch
from
March 18, 2026 02:36
fed8def to
e91f3fd
Compare
Contributor
|
@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D97062791. |
Contributor
|
@joseph5wu merged this pull request in 96c99bd. |
meta-codesync Bot
pushed a commit
that referenced
this pull request
Mar 19, 2026
Summary: **Pre-submission checklist** - [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install` - [x] `pre-commit run` This adds a new CLI command to assign a queuing policy (port queue configuration) to a physical interface: ``` fboss2 config interface <name> queuing-policy <policy-name> ``` The command validates that the specified policy exists in `portQueueConfigs` before setting the `portQueueConfigName` attribute on the port. Note: this change is part of a series, the previous one is #866, the next one is #881. Pull Request resolved: #867 Test Plan: End-to-end test output (expanded to include interface assignment): ``` [Step 2] Configuring queuing policy 'cli_e2e_test_queue_policy'... Configuring queue-id 2... [CLI] Running: config qos queuing-policy cli_e2e_test_queue_policy queue-id 2 scheduling SP weight 10 shared-bytes 83618832 [...] All queues configured Assigning queuing policy to interface 'eth1/1/1'... [CLI] Running: config interface eth1/1/1 queuing-policy cli_e2e_test_queue_policy [CLI] Completed in 0.07s: config interface eth1/1/1 queuing-policy cli_e2e_test_queue_policy Queuing policy assigned [Step 3] Committing configuration... [CLI] Running: config session commit [CLI] Completed in 16.09s: config session commit Configuration committed successfully [Step 4] Verifying configuration... Buffer pool 'cli_e2e_test_buffer_pool' verified Queuing policy 'cli_e2e_test_queue_policy' verified Interface 'eth1/1/1' queuing policy verified ====================================================================== TEST PASSED ====================================================================== ``` ## Sample usage ``` $ fboss2 config qos queuing-policy sample_policy queue-id 0 scheduling sp Successfully configured queuing-policy 'sample_policy' queue-id 0 $ fboss2 config interface eth1/1/1 queuing-policy sample_policy Successfully set queuing-policy 'sample_policy' for interface(s) eth1/1/1 $ fboss2 config session diff --- current live config +++ session config @@ -2197,7 +2197,15 @@ "maxNeighborProbes": 300, "mirrorOnDropReports": [], "mirrors": [], - "portQueueConfigs": {}, + "portQueueConfigs": { + "sample_policy": [ + { + "id": 0, + "scheduling": 1, + "streamType": 0 + } + ] + }, "ports": [ { "conditionalEntropyRehash": false, @@ -2219,6 +2227,7 @@ "rx": false, "tx": false }, + "portQueueConfigName": "sample_policy", "portType": 0, "profileID": 39, "queues_DEPRECATED": [], ``` Reviewed By: srikrishnagopu Differential Revision: D97239642 Pulled By: joseph5wu fbshipit-source-id: fd98a6b8b170c3fcb37a1b4d69d108dc03214f32
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.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
This adds support for configuring Active Queue Management (AQM) attributes
on port queues via the CLI. The AQM configuration includes:
ECNorEARLY_DROPThe active-queue-management keyword must come last in the command as it
consumes all remaining arguments for its nested sub-attributes.
Note: this change is part of a series, the previous one is #863, the next one is #867.
Test Plan
End-to-end test output (new test case with queue-id 4 with AQM):
Sample usage