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

[chassis] fix show bgp summary when no neighbors are present on one ASIC #3158

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

arlakshm
Copy link
Contributor

@arlakshm arlakshm commented Feb 7, 2024

What I did

This PR #3099 fixes the case where on chassis Linecard there are no BGP neighbors. However, if the Linecard has neighbors on one ASIC but not on other, the command show bgp summary displayed no neighbors. This PR fixes this.

How I did it

Add check in bgp_util to create empty peer list only once
Add UT to cover this case

How to verify it

UT and on chassis LC

Wrong output

dmin@sonic$  show ip bgp summ

IPv4 Unicast Summary:
asic0: BGP router identifier 192.0.0.1, local AS number 65100 vrf-id 0
BGP table version 67684
asic1: BGP router identifier 192.0.0.2, local AS number 65100 vrf-id 0
BGP table version 67555
RIB entries 16, using 16 bytes of memory
Peers 16, using 16 KiB of memory
Peer groups 16, using 16 bytes of memory


Neighbhor    V    AS    MsgRcvd    MsgSent    TblVer    InQ    OutQ    Up/Down    State/PfxRcd    NeighborName
-----------  ---  ----  ---------  ---------  --------  -----  ------  ---------  --------------  --------------

Total number of neighbors 0
admin@sonic$  show ip bgp summ -n asic0

IPv4 Unicast Summary:
asic0: BGP router identifier 192.0.0.1, local AS number 65100 vrf-id 0
BGP table version 67684
RIB entries 101813, using 18733592 bytes of memory
Peers 16, using 11852928 KiB of memory
Peer groups 6, using 384 bytes of memory


Neighbhor      V     AS    MsgRcvd    MsgSent    TblVer    InQ    OutQ  Up/Down    State/PfxRcd    NeighborName
-----------  ---  -----  ---------  ---------  --------  -----  ------  ---------  --------------  --------------
10.0.0.1       4  65200        298         32         0      0       0  00:26:15   1               ARISTA01T3
10.0.0.5       4  65200        301         33         0      0       0  00:26:15   1               ARISTA03T3
10.0.0.9       4  65200        301         33         0      0       0  00:26:15   1               ARISTA05T3
10.0.0.13      4  65200        301         34         0      0       0  00:26:15   33793           ARISTA07T3
10.0.0.17      4  65200        298         32         0      0       0  00:26:15   1               ARISTA09T3
10.0.0.21      4  65200          0          0         0      0       0  never      Active          ARISTA11T3
10.0.0.25      4  65200        301         34         0      0       0  00:26:15   33793           ARISTA18T3
10.0.0.29      4  65200        301         34         0      0       0  00:26:15   1               ARISTA15T3
10.0.0.33      4  65200        298         32         0      0       0  00:26:17   1               ARISTA13T3
10.0.0.35      4  65200        298         32         0      0       0  00:26:17   1               ARISTA17T3

Total number of neighbors 10

After fix

admin@sonic$  show ip bgp summ                                                                                   

IPv4 Unicast Summary:
asic0: BGP router identifier 192.0.0.1, local AS number 65100 vrf-id 0
BGP table version 67684
asic1: BGP router identifier 192.0.0.2, local AS number 65100 vrf-id 0
BGP table version 67555
RIB entries 16, using 16 bytes of memory
Peers 16, using 16 KiB of memory
Peer groups 16, using 16 bytes of memory


Neighbhor      V     AS    MsgRcvd    MsgSent    TblVer    InQ    OutQ  Up/Down    State/PfxRcd    NeighborName
-----------  ---  -----  ---------  ---------  --------  -----  ------  ---------  --------------  --------------
10.0.0.1       4  65200        302         36         0      0       0  00:30:26   1               ARISTA01T3
10.0.0.5       4  65200        305         37         0      0       0  00:30:26   1               ARISTA03T3
10.0.0.9       4  65200        305         37         0      0       0  00:30:26   1               ARISTA05T3
10.0.0.13      4  65200        305         38         0      0       0  00:30:26   33793           ARISTA07T3
10.0.0.17      4  65200        302         36         0      0       0  00:30:26   1               ARISTA09T3
10.0.0.21      4  65200          0          0         0      0       0  never      Active          ARISTA11T3
10.0.0.25      4  65200        305         38         0      0       0  00:30:26   33793           ARISTA18T3
10.0.0.29      4  65200        305         38         0      0       0  00:30:26   1               ARISTA15T3
10.0.0.33      4  65200        302         36         0      0       0  00:30:28   1               ARISTA13T3
10.0.0.35      4  65200        302         36         0      0       0  00:30:28   1               ARISTA17T3

Total number of neighbors 10
admin@sonic$  show ip bgp summ -n asic0

IPv4 Unicast Summary:
asic0: BGP router identifier 192.0.0.1, local AS number 65100 vrf-id 0
BGP table version 67684
RIB entries 101813, using 18733592 bytes of memory
Peers 15, using 11112120 KiB of memory
Peer groups 6, using 384 bytes of memory


Neighbhor      V     AS    MsgRcvd    MsgSent    TblVer    InQ    OutQ  Up/Down    State/PfxRcd    NeighborName
-----------  ---  -----  ---------  ---------  --------  -----  ------  ---------  --------------  --------------
10.0.0.1       4  65200        302         36         0      0       0  00:30:34   1               ARISTA01T3
10.0.0.5       4  65200        305         37         0      0       0  00:30:34   1               ARISTA03T3
10.0.0.9       4  65200        305         37         0      0       0  00:30:34   1               ARISTA05T3
10.0.0.13      4  65200        305         38         0      0       0  00:30:34   33793           ARISTA07T3
10.0.0.17      4  65200        302         36         0      0       0  00:30:34   1               ARISTA09T3
10.0.0.21      4  65200          0          0         0      0       0  never      Active          ARISTA11T3
10.0.0.25      4  65200        305         38         0      0       0  00:30:34   33793           ARISTA18T3
10.0.0.29      4  65200        305         38         0      0       0  00:30:34   1               ARISTA15T3
10.0.0.33      4  65200        302         36         0      0       0  00:30:36   1               ARISTA13T3
10.0.0.35      4  65200        302         36         0      0       0  00:30:36   1               ARISTA17T3

Total number of neighbors 10
admin@sonic$  show ip bgp summ -n asic1

IPv4 Unicast Summary:
asic1: BGP router identifier 192.0.0.2, local AS number 65100 vrf-id 0
BGP table version 67555
RIB entries 0, using 0 bytes of memory
Peers 0, using 0 KiB of memory
Peer groups 0, using 0 bytes of memory


Neighbhor    V    AS    MsgRcvd    MsgSent    TblVer    InQ    OutQ    Up/Down    State/PfxRcd    NeighborName
-----------  ---  ----  ---------  ---------  --------  -----  ------  ---------  --------------  --------------

Total number of neighbors 0

@arlakshm arlakshm requested a review from judyjoseph February 7, 2024 18:22
@arlakshm arlakshm merged commit 81c5349 into sonic-net:master Feb 8, 2024
5 checks passed
@arlakshm
Copy link
Contributor Author

arlakshm commented Feb 8, 2024

@gechiang for vis

@gechiang
Copy link
Contributor

gechiang commented Feb 8, 2024

MSFT ADO: 26741360
@yxieca , @StormLiangMS , please approve for 202305 and 202311 branch backport this fix.
Thanks!

@gechiang gechiang added the included in chassis for 202205 branch indicate that this PR got merged into the "chassis for 202205 branch" label Feb 8, 2024
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Feb 12, 2024
…SIC (sonic-net#3158)

This PR sonic-net#3099 fixes the case where on chassis Linecard there are no BGP neighbors. However, if the Linecard has neighbors on one ASIC but not on other, the command show bgp summary displayed no neighbors. This PR fixes this.

How I did it
Add check in bgp_util to create empty peer list only once
Add UT to cover this case
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #3162

mssonicbld pushed a commit that referenced this pull request Feb 12, 2024
…SIC (#3158)

This PR #3099 fixes the case where on chassis Linecard there are no BGP neighbors. However, if the Linecard has neighbors on one ASIC but not on other, the command show bgp summary displayed no neighbors. This PR fixes this.

How I did it
Add check in bgp_util to create empty peer list only once
Add UT to cover this case
@StormLiangMS
Copy link
Contributor

@arlakshm @gechiang could you run test with 202305 image on single asic to avoid any regression?

@abdosi
Copy link
Contributor

abdosi commented Apr 25, 2024

@arlakshm @gechiang could you run test with 202305 image on single asic to avoid any regression?

@StormLiangMS verified on 202305 branch. Please help with cherry-pick.

mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Apr 26, 2024
…SIC (sonic-net#3158)

This PR sonic-net#3099 fixes the case where on chassis Linecard there are no BGP neighbors. However, if the Linecard has neighbors on one ASIC but not on other, the command show bgp summary displayed no neighbors. This PR fixes this.

How I did it
Add check in bgp_util to create empty peer list only once
Add UT to cover this case
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #3291

mssonicbld pushed a commit that referenced this pull request Apr 26, 2024
…SIC (#3158)

This PR #3099 fixes the case where on chassis Linecard there are no BGP neighbors. However, if the Linecard has neighbors on one ASIC but not on other, the command show bgp summary displayed no neighbors. This PR fixes this.

How I did it
Add check in bgp_util to create empty peer list only once
Add UT to cover this case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants