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 multi-asic behaviour for ecnconfig #3062

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

bktsim-arista
Copy link
Contributor

What I did

Previously, ecnconfig -l was not behaving correctly on multi-asic devices, as the '-n' namespace option was not available, and correct namespaces were not traversed on multi-asic devices to retrieve correct results for ecnconfig. This change fixes multi-asic behaviour of CLI commands that rely on ecnconfig.

This is a part of the set of changes being pushed for sonic-net/sonic-buildimage#15148
This change relies on helpers added in sonic-net/sonic-buildimage#17243

How I did it

Added namespace option -n and used multi_asic library to implement multi_asic behaviour. Added relevant unit tests to ensure functionality.

How to verify it

Run unit tests, or ecnconfig commands with option -n.

@vmittal-msft
Copy link
Contributor

please re-base the PR to latest

Copy link
Contributor

@vmittal-msft vmittal-msft left a comment

Choose a reason for hiding this comment

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

please share command and it's output from multi asic platform. Also, please make sure it still works for ToR.

@@ -197,5 +197,16 @@
"holdtime": "0",
"asn": "65100",
"keepalive": "0"
Copy link
Contributor

Choose a reason for hiding this comment

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

this profile should be for lossless not lossy

Copy link
Contributor

Choose a reason for hiding this comment

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

The comment is outdated, but to address it, the test vectors are added as a dummy to validate the functionality.

yellow_drop_probability 5
red_drop_probability 5
----------------------- -------

Copy link
Contributor

Choose a reason for hiding this comment

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

there shouldn't be wred on lossy. please fix this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vmittal-msft WRED has been removed from lossy.

"wred_yellow_enable":"true",
"red_max_threshold":"32760",
"red_min_threshold":"4095",
"yellow_max_threshold":"32760",
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove wred on lossy

Copy link
Contributor

Choose a reason for hiding this comment

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

@vmittal-msft WRED has been removed from lossy.

@vmittal-msft
Copy link
Contributor

@bktsim-arista
1.Is this verified on pizzabox as well ?
2. If no namespace is given, will it show for all ?

@arlakshm
Copy link
Contributor

/Azp run Azure.sonic-utilities

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

bktsim-arista and others added 4 commits August 6, 2024 16:00
Previously, ecnconfig -l was not behaving correctly on multi-asic devices,
as the '-n' namespace option was not available, and correct namespaces were
not traversed on multi-asic devices to retrieve correct results for ecnconfig.
This change fixes multi-asic behaviour of CLI commands that rely on ecnconfig.
@kenneth-arista kenneth-arista force-pushed the multi-asic-ecnconfig branch 2 times, most recently from 693686c to f59a2c8 Compare August 6, 2024 23:10
- Removed unix socket and fixed failing unit test
- Replace argparse with click
- Add multi-asic support for get and set queue
- Add multi-asic support for set threshold and prob
- Modify test framework to support multi-asic
- Use multi_asic decorators
- Resolve precommit errors
@kenneth-arista
Copy link
Contributor

@arlakshm @vmittal-msft @wenyiz2021 this PR is ready for review. All tests have passed with the latest updates. It will be easier to review with whitespace difference disabled because the new static checks requires reformatting (e.g. spacing) of touched Python files.

@arista-hpandya
Copy link
Contributor

arista-hpandya commented Aug 7, 2024

please share command and it's output from multi asic platform. Also, please make sure it still works for ToR.

Here are the snapshots obtained after running it on a multi-asic devise:

ecnconfig -l -n asic0
ecnconfig -l -n asic0

ecnconfig -l -n asic1
ecnconfig -l -n asic1

ecnconfig -l
ecnconfig -l

Behaviour of queue on mutli-asic platform

multi_asic queue get and set

Behaviour of set on multi-asic platform when no namespace is specified

multi_set_all_masic

@arista-hpandya
Copy link
Contributor

@vmittal-msft 1.Is this verified on pizzabox as well ? 2. If no namespace is given, will it show for all ?

Yes, behaviour on single asic devices is preserved and when no namespace is given, it will show/set for all

Copy link
Contributor

@vmittal-msft vmittal-msft left a comment

Choose a reason for hiding this comment

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

I am assuming this is verified on T0/T1 device as well to make sure it is fine.

@arista-hpandya
Copy link
Contributor

I am assuming this is verified on T0/T1 device as well to make sure it is fine.

No, it has not been tested on T0/T1 devices yet. I will update the PR once I have tested it on the same.

@arista-hpandya
Copy link
Contributor

I am assuming this is verified on T0/T1 device as well to make sure it is fine.

The changes have been verified on T0 and T1 devices, the snapshots of the same are attached below. TL;DR: It should be safe to merge

T0

ecnconfig multi_set
ecnconfig queue test


T1

ecnconfig_multi_set
ecnconfig_queue_test

@vmittal-msft vmittal-msft merged commit e4df80a into sonic-net:master Aug 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants