Changes to make lldp show command for multi-npu platforms.#914
Changes to make lldp show command for multi-npu platforms.#914abdosi merged 5 commits intosonic-net:masterfrom
Conversation
We will display only front-panel port information.
|
retest this please |
|
@jleveque can you please review this. |
@abdosi: I believe you mean you changed all references to "NPU", not "ASIC". |
scripts/lldpshow
Outdated
There was a problem hiding this comment.
Why is NPU namespace also an empty string? I thought that was reserved for the host namespace.
There was a problem hiding this comment.
@jleveque This is just initial/default value to start with. The Interface list will get appended in the loop for asic namespace. We start with '' and then append to it.
There was a problem hiding this comment.
I'm confused as to why the host namespace is the "default" in the NPU namespace. Maybe the naming is unclear?
There was a problem hiding this comment.
@jleveque for LLDP we have instance in both host (for eth0) and per asic (for physical ports) namespace.
For host namespace using macro LLDP_INSTANCE_IN_HOST_NAMESPACE and LLDP_INTERFACE_LIST_IN_HOST_NAMESPACE.
For per asic namespace using macro LLDP_DEFAULT_INTERFACE_LIST_IN_ASIC_NAMESPACE which is just init value and the interface list gets populated in the loop.
There was a problem hiding this comment.
@jleveque did I clarify your above concern ? let me know
There was a problem hiding this comment.
I guess I'm still confused. So the empty string here does not denote the namespace, but rather denotes an interface name? Why do we need to populate an empty interface name here?
There was a problem hiding this comment.
@jleveque Yes, We have empty string for both namespace and interface-list for host.
Empty interface-list is to keep logic generic since for host lldp docker as we do not filter of any interface and the command will be just 'lldpctl' + < Empty string >.
In case user has passed specific interface (-p option) command will be 'lldpctl' + < Interface-Num>.
For asic namespace we filter out Backplane interface (Ethernet-BP) and command will be 'lldpctl' + < Front Interface list >
or in case user has passed interface (-p option) command will be 'lldpctl' + < Interface-Num>.
There was a problem hiding this comment.
I see. Thanks for the explanation. I guess it might just be the similarity of the constant names that is throwing me off here. I'd also like to get Pavel's input here, who is more of a SME on LLDP.
There was a problem hiding this comment.
@jleveque can you please approve this. pavel has approved it.
@jleveque I think git had some issue with file update . It is "ASIC" since in minigraph we have ASIC already and we can not change that. Going foward as part of Issue #922 we will make NPU as ASIC |
|
This pull request introduces 1 alert when merging 2dd8bb7 into 221b593 - view on LGTM.com new alerts:
|
scripts/lldpshow
Outdated
| lldp_port = args.port | ||
|
|
||
| if lldp_port and not lldp_detail_info: | ||
| parser.error('-d is required when -p is set.') |
There was a problem hiding this comment.
why do we need this? Can we set -d automatically when -p?
There was a problem hiding this comment.
@pavel-shirshov yes that is fine too. Updated accordingly.
There was a problem hiding this comment.
@pavel-shirshov can you please review/approve the PR. Above comment has been addressed.
* Changes to make lldp show command for multi-npu platforms. We will display only front-panel port information. * Address Review Comments. * Added Comment * Fix LGTM error * Address Review Comments
…#914) * Changes to make lldp show command for multi-npu platforms. We will display only front-panel port information. * Address Review Comments. * Added Comment * Fix LGTM error * Address Review Comments
Make sure db_migrator is run after all config are loaded during (sonic-net#926) Vnet alias mapping (sonic-net#924) Changes to make lldp show command for multi-npu platforms. (sonic-net#914) [Mellanox] Fix thermal control issue: use natural sort for fan status and thermal status (sonic-net#836) [Mellanox] add document for thermal control related cli (sonic-net#832)
- What I did
Enhanced below command to work for multi-npu platforms:-
show lldp table
show lldp neighbours [INTERFACE]
In the O/P we will filter out the LLDP information of Back plane Port/asic
Both this command are now wrapper of script/lldpshow which is now enhanced as below
usage: lldpshow [-h] [-v] [-d] [-p PORT]
Display the LLDP neighbors
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-d, --detail LLDP neighbors detail information
-p PORT, --port PORT LLDP neighbors detail information for given port
- How I did it
Updating script/lldpshow and using it
- How to verify it
Verified on both Single and Multi-NPU platforms
- Previous command output (if the output of a command-line utility has changed)
No change in O/P