sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[chassis][LLDP] Fix the show lldp table issue on the supervisor

Open mlok-nokia opened this issue 2 years ago • 6 comments

What I did

Chassis with multiple linecards, if the mgmt port eth0 on the supervisor is a bridge interface which are connected the linecard internal mgmt port eth0. CLI command "show lldp table" will shows only one entry although the show lldp neighbor shows multiple entries.
Fixes #https://github.com/sonic-net/sonic-buildimage/issues/16746

How I did it

The root cause is the function parse_info() in lldpshow script use a key which is not unique to parse the neighbors info on the Supervisor. Instead of use "<localPort>#<remotePort>" as key to parse and store neighbor info, we should use "<localPort>#<remoteHostName>#<remotePort>" as key which is unique to avoid the entry info be overwrited.

Which release branch to backport (provide reason below if selected)

  • [ ] 201811
  • [ ] 201911
  • [ ] 202006
  • [ ] 202012
  • [ ] 202106
  • [ ] 202111
  • [x] 202205
  • [x] 202211
  • [x] 202305

How to verify it

execute both CLI commands "show lldp table" and "show lldp neighbor" on supervisor on the chassis. the output entries should be the same. Example

admin@ixre-cpm-chassis7:~$ show lldp table
Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort    RemoteDevice      RemotePortID       Capability    RemotePortDescr
-----------  ----------------  -----------------  ------------  -----------------
eth0         ixre-egl-board25  eth0               BR            eth0
eth0         sonic             40:7c:7d:bb:25:e5  BR            eth0
eth0         ixre-egl-board26  eth0               BR            eth0
--------------------------------------------------
Total entries displayed:  3

admin@ixre-cpm-chassis7:~$ show lldp neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    eth0, via: LLDP, RID: 1, Time: 0 day, 02:34:30
  Chassis:     
    ChassisID:    mac 40:7c:7d:bb:26:13
    SysName:      ixre-egl-board25
    SysDescr:     SONiC Software Version: SONiC.HEAD.543461-msft-2205-ndk-968500c6 - HwSku: Nokia-IXR7250E-36x100G - Distribution: Debian 11.7 - Kernel: 5.10.0-18-2-amd64
    MgmtIP:       152.148.151.114
    Capability:   Bridge, on
    Capability:   Router, on
    Capability:   Wlan, off
    Capability:   Station, off
  Port:        
    PortID:       local eth0
    PortDescr:    eth0
    TTL:          120
-------------------------------------------------------------------------------
Interface:    eth0, via: LLDP, RID: 2, Time: 0 day, 02:34:21
  Chassis:     
    ChassisID:    mac 40:7c:7d:bb:25:e5
    SysName:      sonic
    SysDescr:     SONiC Software Version: SONiC.HEAD.256061-dirty-20220426.133059 - HwSku: Nokia-IXR7250E-60x100G - Distribution: Debian 11.3 - Kernel: 5.10.0-8-2-amd64
    MgmtIP:       240.127.1.1
    MgmtIP:       fd00::1
    Capability:   Bridge, on
    Capability:   Router, on
    Capability:   Wlan, off
    Capability:   Station, off
  Port:        
    PortID:       mac 40:7c:7d:bb:25:e5
    PortDescr:    eth0
    TTL:          120
-------------------------------------------------------------------------------
Interface:    eth0, via: LLDP, RID: 3, Time: 0 day, 02:34:17
  Chassis:     
    ChassisID:    mac 40:7c:7d:bb:27:6b
    SysName:      ixre-egl-board26
    SysDescr:     SONiC Software Version: SONiC.HEAD.543461-msft-2205-ndk-968500c6 - HwSku: Nokia-IXR7250E-36x100G - Distribution: Debian 11.7 - Kernel: 5.10.0-18-2-amd64
    MgmtIP:       152.148.151.116
    Capability:   Bridge, on
    Capability:   Router, on
    Capability:   Wlan, off
    Capability:   Station, off
  Port:        
    PortID:       local eth0
    PortDescr:    eth0
    TTL:          120
-------------------------------------------------------------------------------

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

mlok-nokia avatar Sep 28 '23 04:09 mlok-nokia

@judyjoseph After I fix the eth0 on the supervisor card and during unit testing, I found the issue https://github.com/sonic-net/sonic-buildimage/issues/16746. And create this PR to fix it. Please review it. Thanks

mlok-nokia avatar Sep 28 '23 04:09 mlok-nokia

@abdosi to review as well

judyjoseph avatar Oct 03 '23 18:10 judyjoseph

@abdosi Please help to review this change. Thanks

mlok-nokia avatar Oct 05 '23 14:10 mlok-nokia

@abdosi Please help to review this PR

mlok-nokia avatar Nov 17 '23 15:11 mlok-nokia

@abdosi to check

rlhui avatar Jan 10 '24 18:01 rlhui

@abdosi Please help to review this PR

mlok-nokia avatar Mar 20 '24 19:03 mlok-nokia

we don't need this PR. on supervisor we should only have one entry for eth0.

abdosi avatar May 15 '24 18:05 abdosi