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 backend port channels and routes being displayed #14479

Merged
merged 2 commits into from
Apr 15, 2023

Conversation

saiarcot895
Copy link
Contributor

@saiarcot895 saiarcot895 commented Mar 31, 2023

Fixes #14459.

Why I did it

In show interface portchannel and show ip route, backend port channels and routes were being displayed. This is due to changes in #13660. Fix these issues by switching to reading from PORTCHANNEL_MEMBERS table instead.

How I did it

How to verify it

Replaced the multi_asic.py script at /usr/local/lib/python3.9/dist-packages/sonic_py_common/multi_asic.py with the fixed version. Verified that show int portchannel and show ip route no longer showed routes that used the backend port channels.

Current:

admin@xxxxx:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

C>*1.0.0.0/16 is directly connected, eth1, 1d17h25m
B>*10.106.28.16/31 [200/0] via 10.235.100.134, PortChannel4089, 1d16h16m
  *                        via 10.235.100.4, PortChannel4077, 1d16h16m
  *                        via 10.235.99.134, PortChannel4071, 1d16h16m
  *                        via 10.235.99.4, PortChannel4059, 1d16h16m
  *                        via 10.235.98.134, PortChannel4053, 1d16h16m
  *                        via 10.235.98.4, PortChannel4041, 1d16h16m
  *                        via 10.235.97.134, PortChannel4035, 1d16h16m
  *                        via 10.235.97.4, PortChannel4023, 1d16h16m
  *                        via 10.235.96.134, PortChannel4017, 1d16h16m
  *                        via 10.235.96.4, PortChannel4005, 1d16h16m
...

Fixed:

admin@xxxxxx:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

C>*1.0.0.0/16 is directly connected, eth1, 1d17h24m
B> 10.106.28.16/31 [200/0] via 25.103.166.105, (recursive) 1d16h15m
                           via 25.103.166.105, (recursive) 1d16h15m
B> 10.106.28.22/31 [200/0] via 25.103.166.105, (recursive) 1d16h15m
                           via 25.103.166.105, (recursive) 1d16h15m
B> 10.106.28.26/31 [200/0] via 25.103.166.105, (recursive) 1d16h15m
                           via 25.103.166.105, (recursive) 1d16h15m
B> 10.106.28.28/31 [200/0] via 25.103.166.105, (recursive) 1d16h15m
                           via 25.103.166.105, (recursive) 1d16h15m
C>*25.103.166.97/32 is directly connected, Loopback0, 1d17h24m
B> 25.103.166.98/32 [200/0] via 25.103.166.106, (recursive) 1d16h15m
                            via 25.103.166.105, (recursive) 1d16h15m
                            via 25.103.166.105, (recursive) 1d16h15m
                            via 25.103.166.106, (recursive) 1d16h15m
C>*25.103.166.103/32 is directly connected, Loopback4096, 1d17h24m
C>*25.103.166.104/32 is directly connected, Loopback4096, 1d17h24m

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

In `show interface portchannel` and `show ip route`, backend port
channels and routes were being displayed. This is due to changes in sonic-net#13660.
Fix these issues by switching to reading from PORTCHANNEL_MEMBERS table
instead.

Fixes sonic-net#14459.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
@saiarcot895 saiarcot895 requested a review from abdosi March 31, 2023 18:18
Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
@saiarcot895 saiarcot895 requested a review from rlhui April 5, 2023 21:53
@anamehra
Copy link
Contributor

LGTM. Show CLI works fine with this change.

@abdosi abdosi added Request for 202205 Branch Request for 202111 Branch For PRs being requested for 202111 branch labels Apr 13, 2023
@anamehra
Copy link
Contributor

This PR also fixes lag_facts for test_lag_2.py test as that uses is_port_channel_internal API fixed here. But I see that the dut_port_map includes internal pcs as well. Earlier only external PCs were included in dut_port_map. That caused the increase in total test cases for test_lag_2 but the internal ones get skipped as lag_facts filter those out with this fix. Is that expected behavior?

@abdosi
Copy link
Contributor

abdosi commented Apr 13, 2023

does it fix show interface status. @anamehra / @saiarcot895 can you please confirm

@anamehra
Copy link
Contributor

does it fix show interface status. @anamehra / @saiarcot895 can you please confirm

show interface status and show interface portchannel, shows only external portchannels with this fix.
'-d all' shows all as expected.

@abdosi
Copy link
Contributor

abdosi commented Apr 13, 2023

@rlhui can you please help merge this.

@anamehra
Copy link
Contributor

This PR also fixes lag_facts for test_lag_2.py test as that uses is_port_channel_internal API fixed here. But I see that the dut_port_map includes internal pcs as well. Earlier only external PCs were included in dut_port_map. That caused the increase in total test cases for test_lag_2 but the internal ones get skipped as lag_facts filter those out with this fix. Is that expected behavior?

Please ignore this comment. Looks like test metadata was required to be updated on sonic-mgmt ws after patching the fix on the router. After updating the metadata, we do not see internal portchannels in dut_port_map.

@rlhui rlhui merged commit 070a64a into sonic-net:master Apr 15, 2023
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Apr 19, 2023
* Fix backend port channels and routes being displayed
In `show interface portchannel` and `show ip route`, backend port
channels and routes were being displayed. This is due to changes in sonic-net#13660.
Fix these issues by switching to reading from PORTCHANNEL_MEMBERS table
instead.
Fixes sonic-net#14459.
* Replace table name with constant

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #14734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

chassis: 'show interface portchannel' shows internal portchannels included
6 participants