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

zebra: Allow dplane to pass larger number of nexthops down to dataplane #17023

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

donaldsharp
Copy link
Member

Currently FRR is limiting the nexthop count to a uint8_t not a uint16_t. This leads to issues when the nexthop count is 256 which results in the count to overflow to 0 causing problems in the code.

@frrbot frrbot bot added the zebra label Oct 7, 2024
@donaldsharp donaldsharp force-pushed the dplane_problems branch 2 times, most recently from f2d5f42 to 9790fa1 Compare October 7, 2024 17:32
@github-actions github-actions bot added size/M and removed size/XS labels Oct 7, 2024
@donaldsharp donaldsharp force-pushed the dplane_problems branch 2 times, most recently from 089db7b to b501ac2 Compare October 7, 2024 20:57
@github-actions github-actions bot added size/L and removed size/M labels Oct 7, 2024
bgpd/bgp_attr.h Outdated
@@ -251,7 +251,7 @@ struct attr {
as_t aggregator_as;

/* MP Nexthop length */
uint8_t mp_nexthop_len;
uint16_t mp_nexthop_len;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? This can't be higher than 48 bytes overall (assuming it's encoded as global + link-local for vpnv6).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your right I just assumed it was. Sorry, removed

Currently FRR is limiting the nexthop count to a uint8_t not a
uint16_t.  This leads to issues when the nexthop count is 256
which results in the count to overflow to 0 causing problems
in the code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@riw777 riw777 merged commit b8c4586 into FRRouting:master Oct 8, 2024
11 checks passed
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Dec 19, 2024
Why I did it
Added patches from FRR to support scale of BGP neighbors to 256/514. Below are the patches

Patch	FRR Pull request
0069-lib-nexthop-code-should-use-uint16_t-for-nexthop-cou.patch	FRRouting/frr#16967
0070-Allow-16-bit-size-for-nexthops.patch	FRRouting/frr#17023
0071-zebra-Only-notify-dplane-work-pthread-when-needed.patch	FRRouting/frr#17062
0072-Fix-up-improper-handling-of-nexthops-for-nexthop-tra.patch	FRRouting/frr#17076
0073-remove-in6addr-cmp.patch	FRRouting/frr#17312
0074-bgp-best-port-reordering.patch	FRRouting/frr#15572
0075-bgp-mp-info-changes.patch	FRRouting/frr#16961
0076-Optimizations-and-problem-fixing-for-large-scale-ecmp-from-bgp.patch	FRRouting/frr#17229
dgsudharsan added a commit to dgsudharsan/sonic-buildimage that referenced this pull request Dec 23, 2024
…net#21199)

Why I did it
Added patches from FRR to support scale of BGP neighbors to 256/514. Below are the patches

Patch	FRR Pull request
0069-lib-nexthop-code-should-use-uint16_t-for-nexthop-cou.patch	FRRouting/frr#16967
0070-Allow-16-bit-size-for-nexthops.patch	FRRouting/frr#17023
0071-zebra-Only-notify-dplane-work-pthread-when-needed.patch	FRRouting/frr#17062
0072-Fix-up-improper-handling-of-nexthops-for-nexthop-tra.patch	FRRouting/frr#17076
0073-remove-in6addr-cmp.patch	FRRouting/frr#17312
0074-bgp-best-port-reordering.patch	FRRouting/frr#15572
0075-bgp-mp-info-changes.patch	FRRouting/frr#16961
0076-Optimizations-and-problem-fixing-for-large-scale-ecmp-from-bgp.patch	FRRouting/frr#17229
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Jan 2, 2025
…net#21199)

Why I did it
Added patches from FRR to support scale of BGP neighbors to 256/514. Below are the patches

Patch	FRR Pull request
0069-lib-nexthop-code-should-use-uint16_t-for-nexthop-cou.patch	FRRouting/frr#16967
0070-Allow-16-bit-size-for-nexthops.patch	FRRouting/frr#17023
0071-zebra-Only-notify-dplane-work-pthread-when-needed.patch	FRRouting/frr#17062
0072-Fix-up-improper-handling-of-nexthops-for-nexthop-tra.patch	FRRouting/frr#17076
0073-remove-in6addr-cmp.patch	FRRouting/frr#17312
0074-bgp-best-port-reordering.patch	FRRouting/frr#15572
0075-bgp-mp-info-changes.patch	FRRouting/frr#16961
0076-Optimizations-and-problem-fixing-for-large-scale-ecmp-from-bgp.patch	FRRouting/frr#17229
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Jan 2, 2025
…net#21199)

Why I did it
Added patches from FRR to support scale of BGP neighbors to 256/514. Below are the patches

Patch	FRR Pull request
0069-lib-nexthop-code-should-use-uint16_t-for-nexthop-cou.patch	FRRouting/frr#16967
0070-Allow-16-bit-size-for-nexthops.patch	FRRouting/frr#17023
0071-zebra-Only-notify-dplane-work-pthread-when-needed.patch	FRRouting/frr#17062
0072-Fix-up-improper-handling-of-nexthops-for-nexthop-tra.patch	FRRouting/frr#17076
0073-remove-in6addr-cmp.patch	FRRouting/frr#17312
0074-bgp-best-port-reordering.patch	FRRouting/frr#15572
0075-bgp-mp-info-changes.patch	FRRouting/frr#16961
0076-Optimizations-and-problem-fixing-for-large-scale-ecmp-from-bgp.patch	FRRouting/frr#17229
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Jan 2, 2025
…net#21199)

Why I did it
Added patches from FRR to support scale of BGP neighbors to 256/514. Below are the patches

Patch	FRR Pull request
0069-lib-nexthop-code-should-use-uint16_t-for-nexthop-cou.patch	FRRouting/frr#16967
0070-Allow-16-bit-size-for-nexthops.patch	FRRouting/frr#17023
0071-zebra-Only-notify-dplane-work-pthread-when-needed.patch	FRRouting/frr#17062
0072-Fix-up-improper-handling-of-nexthops-for-nexthop-tra.patch	FRRouting/frr#17076
0073-remove-in6addr-cmp.patch	FRRouting/frr#17312
0074-bgp-best-port-reordering.patch	FRRouting/frr#15572
0075-bgp-mp-info-changes.patch	FRRouting/frr#16961
0076-Optimizations-and-problem-fixing-for-large-scale-ecmp-from-bgp.patch	FRRouting/frr#17229
mssonicbld added a commit to mssonicbld/sonic-buildimage-msft that referenced this pull request Jan 8, 2025
<!--
     Please make sure you've read and understood our contributing guidelines:
     https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

     ** Make sure all your commits include a signature generated with `git commit -s` **

     If this is a bug fix, make sure your description includes "fixes #xxxx", or
     "closes #xxxx" or "resolves #xxxx"

     Please provide the following information:
-->

#### Why I did it

Added patches from FRR to support scale of BGP neighbors to 256/514. Below are the patches

| Patch | FRR Pull request|
| ------  |--------- |
| 0069-lib-nexthop-code-should-use-uint16_t-for-nexthop-cou.patch | FRRouting/frr#16967 |
| 0070-Allow-16-bit-size-for-nexthops.patch | FRRouting/frr#17023  |
| 0071-zebra-Only-notify-dplane-work-pthread-when-needed.patch | FRRouting/frr#17062 |
| 0072-Fix-up-improper-handling-of-nexthops-for-nexthop-tra.patch | FRRouting/frr#17076 |
| 0073-remove-in6addr-cmp.patch | FRRouting/frr#17312 |
| 0074-bgp-best-port-reordering.patch | FRRouting/frr#15572 |
| 0075-bgp-mp-info-changes.patch | FRRouting/frr#16961 |
| 0076-Optimizations-and-problem-fixing-for-large-scale-ecmp-from-bgp.patch | FRRouting/frr#17229 |
##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it

#### How to verify it

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
- [ ] 202305

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in 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
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
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.

3 participants