sonic-utilities
sonic-utilities copied to clipboard
Fix multi-asic behaviour for mmuconfig
What I did
Previously, mmuconfig did not function correctly on multi-asic devices as it did not traverse through the correct namespaces, as required for multi-asic devices. This change adds multi-asic support to mmuconfig with the use of multi-asic helper libraries, ensuring that mmuconfig searches throuugh the correct namespaces when used on multi-asic devices, and adds the '-n' optional argument for users to specify namespaces on multi-asic devices.
This is a part of the set of changes being pushed for https://github.com/sonic-net/sonic-buildimage/issues/15148
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 mmuconfig with -n
option.
@bktsim-arista please re-base to latest
@bktsim-arista please share command and it's output from multi-asic platform. Also, did we verify to make sure, it still works for ToR.
@vmittal-msft Here's the output on a multiasic platform:
No buffer pool information available
No buffer profile information available
root@cmp235-3:~# mmuconfig -l -n asic0
No buffer pool information available
No buffer profile information available
root@cmp235-3:~# mmuconfig -p alpha_profile -a 2 -n asic0
root@cmp235-3:~# mmuconfig -l
No buffer pool information available
No buffer profile information available
root@cmp235-3:~# mmuconfig -l -n asic0
No buffer pool information available
Profile: alpha_profile
---------- -
dynamic_th 2
---------- -
root@cmp235-3:~#
Also, we tested this on a ToR, and behavior was consistent on a single ASIC system.
@vmittal-msft Here's the output on a multiasic platform:
No buffer pool information available No buffer profile information available root@cmp235-3:~# mmuconfig -l -n asic0 No buffer pool information available No buffer profile information available root@cmp235-3:~# mmuconfig -p alpha_profile -a 2 -n asic0 root@cmp235-3:~# mmuconfig -l No buffer pool information available No buffer profile information available root@cmp235-3:~# mmuconfig -l -n asic0 No buffer pool information available Profile: alpha_profile ---------- - dynamic_th 2 ---------- - root@cmp235-3:~#
Also, we tested this on a ToR, and behavior was consistent on a single ASIC system.
Thanks. @rdjeric-arista @bktsim-arista Can you please share the o/p with some config present ? If no namespace is given, will it show all namespaces ?
@vmittal-msft @wenyiz2021 @arlakshm this PR is ready for review
@bktsim-arista Please rebase
@bktsim-arista Please rebase
@bktsim-arista is not at Arista anymore. You can redirect these requests to me or @kenneth-arista. Thank you!
@vmittal-msft Can we merge this change?