Skip to content

zebra: V6 RA not sent anymore after interface up-down-up #18451

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

Merged
merged 2 commits into from
May 21, 2025

Conversation

soumyar-roy
Copy link
Contributor

@soumyar-roy soumyar-roy commented Mar 21, 2025

zebra: V6 RA not sent anymore after interface up-down-up

Issue:
Once interface is shutdown, the interface is removed from
wheel timer. Now when the interface is up again, current code
won't add the interface to wheel timer again, so it won't send RA
anymore for that interface

Fix:
Moved wheel_add for interface inside rtadv_start_interface_events
This is more common function which gets triggered for both
RA enable and interface up event

Also on any kind of interface activation event, we try to send
RA as soon as possible. This is to satisfy requirement where
quick RA is needed, especially for some convergence, dependent on
RA.

Testing:
Did ineterface up to down to up
Added debug log for RA, checked it is getting advertised preodically
after when up at up state

show bgp summary for 512 bgp peers for bgp bgp unnumbered works fine.

Signed-off-by: Soumya Roy [email protected]

@soumyar-roy soumyar-roy marked this pull request as draft March 21, 2025 20:30
@mjstapp
Copy link
Contributor

mjstapp commented Mar 21, 2025

so ... please add a meaningful title and description?

@soumyar-roy soumyar-roy changed the title Soumya/fastra zebra: send v6 fast RA at faster interval Mar 21, 2025
@soumyar-roy soumyar-roy force-pushed the soumya/fastra branch 2 times, most recently from f4eedc5 to 7095a84 Compare March 21, 2025 21:51
@soumyar-roy
Copy link
Contributor Author

so ... please add a meaningful title and description?

Added now

lib/wheel.c Outdated
list_isempty(wheel->wheel_slot_lists[curr_slot])) {
/* Came to back to same slot and that is empty
* so the wheel is empty, puase it
*/
Copy link
Member

Choose a reason for hiding this comment

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

Can you fix the comment indentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1)This comment is indented w.r.t if (!wheel->run_forever) {. before running git clang-format >>
((((curr_slot + slots_to_skip) % wheel->slots) == curr_slot) &&

  •           list_isempty(wheel->wheel_slot_lists[curr_slot])) {<<<This line is tab indented
    
  •           /* Came to back to same slot and that is empty
    
  •            * so the wheel is empty, stop it
    
  •           */
    
  •           if (!wheel->run_forever) {
    
  •                   wheel_stop(wheel);
    
  •                   if (debug_timer_wheel)
    
  •                           zlog_debug("Stopped an empty  wheel %p", wheel);
    
  •                   return;
    
  •           }
    
  •   }
    

2)After git clang-format >>
if ((((curr_slot + slots_to_skip) % wheel->slots) == curr_slot) &&

  •           list_isempty(wheel->wheel_slot_lists[curr_slot])) {
    
  •       list_isempty(wheel->wheel_slot_lists[curr_slot])) {<<<<<This line gets space indented
              /* Came to back to same slot and that is empty
               * so the wheel is empty, stop it
              */
    
  1. If I dont do step 2) I get style suggestion error curl https://gist.githubusercontent.com/polychaeta/13d7c1b3f9c07b87352be22b5f29ad01/raw/55bb8b7724008c107d333a05c8db9a785a2db0f7/style.diff | git apply -. So restoring back to 1)

Copy link
Contributor

Choose a reason for hiding this comment

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

no: line 56 is not correct. it looks like it's missing a space to align the comment block

@ton31337
Copy link
Member

Can we have a bit of the context when fast/regular wheels are used?

@soumyar-roy soumyar-roy force-pushed the soumya/fastra branch 2 times, most recently from c13b1c3 to 3a9feb0 Compare March 23, 2025 18:08
@soumyar-roy
Copy link
Contributor Author

Can we have a bit of the context when fast/regular wheels are used?

Added more context

@soumyar-roy soumyar-roy marked this pull request as ready for review March 24, 2025 00:53
@ton31337
Copy link
Member

Thanks, makes sense now, but please put it inside the commit (not in PR).

@soumyar-roy soumyar-roy force-pushed the soumya/fastra branch 3 times, most recently from d352211 to 5347e31 Compare May 15, 2025 16:10

_, result = topotest.run_and_expect(_check_interface_down, True, count=10, wait=1)
if result is not True:
sys.stderr.write("Interface did not go down after shutdown command\n")
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this stderr print if we assert below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

output = tgen.gears["r1"].vtysh_cmd("show interface r1-eth200 json")
return True if '"administrativeStatus":"down"' in output else False

_, result = topotest.run_and_expect(_check_interface_down, True, count=10, wait=1)
Copy link
Member

Choose a reason for hiding this comment

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

Set at least 15 seconds (this is a minimum)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


# Verify RA state didn't change when interface is down
if rtadv_output1 != rtadv_output2:
sys.stderr.write(
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we assert here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed code.

@soumyar-roy soumyar-roy force-pushed the soumya/fastra branch 3 times, most recently from 877175a to c82cc62 Compare May 20, 2025 04:23
@github-actions github-actions bot added size/XXL and removed size/L labels May 20, 2025
@soumyar-roy soumyar-roy force-pushed the soumya/fastra branch 2 times, most recently from 79ef09a to f842a11 Compare May 20, 2025 04:29
@github-actions github-actions bot added size/L and removed size/XXL labels May 20, 2025
@soumyar-roy soumyar-roy reopened this May 20, 2025
@soumyar-roy soumyar-roy reopened this May 20, 2025
@soumyar-roy soumyar-roy reopened this May 20, 2025
@ton31337
Copy link
Member

Why do you close and reopen all the time?

Issue:
Once interface is shutdown, the interface is removed from
wheel timer. Now when the interface is up again, current code
won't add the interface to wheel timer again, so it won't send RA
anymore for that interface

Fix:
Moved wheel_add for interface inside rtadv_start_interface_events
This is more common function which gets triggered for both
RA enable and interface up event

Also on any kind of interface activation event, we try to send
RA as soon as possible. This is to satisfy requirement where
quick RA is needed, especially for some convergence, dependent on
RA.

Testing:
Did ineterface up to down to up
Added debug log for RA, checked it is getting advertised preodically
after when up at up state

show bgp summary for 512 bgp peers for bgp bgp unnumbered works fine.

Signed-off-by: Soumya Roy <[email protected]>
Added test cases with interface down/up/shutdown
to verify RA state of an interface

Signed-off-by: Soumya Roy <[email protected]>
@ton31337 ton31337 merged commit 10666fb into FRRouting:master May 21, 2025
13 checks passed
mssonicbld added a commit to mssonicbld/sonic-buildimage that referenced this pull request May 30, 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

**Add support for 512 BGP sessions**

#### How I did it

| Patch | Upstream Commit |
|-------|----------------|
| 0035-lib-Add-support-for-stream-buffer-to-expand.patch | [65b3ee4e](FRRouting/frr@c0c46ba) |
| 0036-zebra-zebra-crash-for-zapi-stream.patch | [c122afdb](FRRouting/frr@6fe9092) |
| 0037-bgpd-Replace-per-peer-connection-error-with-per-bgp.patch | [10c127bc](FRRouting/frr@6a5962e) |
| 0038-bgpd-remove-apis-from-bgp_route.h.patch | [1d5a8a20](FRRouting/frr@020245b) |
| 0039-bgpd-batch-peer-connection-error-clearing.patch | [4baa9f2d](FRRouting/frr@58f924d) |
| 0040-zebra-move-peer-conn-error-list-to-connection-struct.patch | [411abd6b](FRRouting/frr@6206e7e) |
| 0041-bgpd-Allow-batch-clear-to-do-partial-work-and-contin.patch | [b68be906](FRRouting/frr@c527882) |
| 0042-zebra-send-v6-fast-RA-at-faster-interval.patch | [sonic-net#18451](FRRouting/frr#18451) |
| 0043-bgpd-Paths-received-from-shutdown-peer-not-deleted.patch | [2cbfc7ec](FRRouting/frr@d2bec7a) |
| 0044-bgpd-Modify-bgp-to-handle-packet-events-in-a-FIFO.patch | [12bf042](FRRouting/frr@12bf042c68) |
| 0045-zebra-Limit-reading-packets-when-MetaQ-is-full.patch | [937a9fb](FRRouting/frr@937a9fb)  |
| 0046-bgpd-Delay-processing-MetaQ-in-some-events.patch | [83a92c9](FRRouting/frr@83a92c9)  |
| 0047-bgpd-Fix-holdtime-not-working-properly-when-busy.patch | [9a26a56](FRRouting/frr@9a26a56)  |
| 0048-bgpd-ensure-that-bgp_generate_updgrp_packets-shares-.patch | [681caee](FRRouting/frr@681caee)  |
| 0049-zebra-show-command-to-display-metaq-info.patch | [751ae76](FRRouting/frr@751ae76)  |
| 0050-bgpd-add-total-path-count-for-bgp-net-in-json-output.patch | [be3c6d3](FRRouting/frr@be3c6d3) |
| 0051-lib-Add-nexthop_same_no_ifindex-comparison-function.patch | [66f552c](FRRouting/frr@66f552c)  |
| 0052-zebra-show-nexthop-count-in-nexthop-group-command.patch | [da5703e](FRRouting/frr@da5703e)  |
| 0053-zebra-Allow-nhg-s-to-be-reused-when-multiple-interfa.patch | [46044a4](FRRouting/frr@46044a4)  |
| 0054-zebra-Prevent-active-setting-if-interface-is-not-ope.patch | [e5f4675](FRRouting/frr@e5f4675)  |
| 0055-zebra-Add-nexthop-group-id-to-route-dump.patch | [b732ad2](FRRouting/frr@b732ad2)  |
| 0056-zebra-Display-interface-name-not-ifindex-in-nh-dump.patch | [c891cd2](FRRouting/frr@c891cd2)  |

#### How to verify it

Verified the changes on topology with scaled BGP tests and standard test suite

<!--
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)
mssonicbld added a commit to sonic-net/sonic-buildimage that referenced this pull request May 30, 2025
<!--
 Please make sure you've read and understood our contributing guidelines:
 https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

 failure_prs.log 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

**Add support for 512 BGP sessions**

#### How I did it

| Patch | Upstream Commit |
|-------|----------------|
| 0035-lib-Add-support-for-stream-buffer-to-expand.patch | [65b3ee4e](FRRouting/frr@c0c46ba) |
| 0036-zebra-zebra-crash-for-zapi-stream.patch | [c122afdb](FRRouting/frr@6fe9092) |
| 0037-bgpd-Replace-per-peer-connection-error-with-per-bgp.patch | [10c127bc](FRRouting/frr@6a5962e) |
| 0038-bgpd-remove-apis-from-bgp_route.h.patch | [1d5a8a20](FRRouting/frr@020245b) |
| 0039-bgpd-batch-peer-connection-error-clearing.patch | [4baa9f2d](FRRouting/frr@58f924d) |
| 0040-zebra-move-peer-conn-error-list-to-connection-struct.patch | [411abd6b](FRRouting/frr@6206e7e) |
| 0041-bgpd-Allow-batch-clear-to-do-partial-work-and-contin.patch | [b68be906](FRRouting/frr@c527882) |
| 0042-zebra-send-v6-fast-RA-at-faster-interval.patch | [#18451](FRRouting/frr#18451) |
| 0043-bgpd-Paths-received-from-shutdown-peer-not-deleted.patch | [2cbfc7ec](FRRouting/frr@d2bec7a) |
| 0044-bgpd-Modify-bgp-to-handle-packet-events-in-a-FIFO.patch | [12bf042](FRRouting/frr@12bf042c68) |
| 0045-zebra-Limit-reading-packets-when-MetaQ-is-full.patch | [937a9fb](FRRouting/frr@937a9fb) |
| 0046-bgpd-Delay-processing-MetaQ-in-some-events.patch | [83a92c9](FRRouting/frr@83a92c9) |
| 0047-bgpd-Fix-holdtime-not-working-properly-when-busy.patch | [9a26a56](FRRouting/frr@9a26a56) |
| 0048-bgpd-ensure-that-bgp_generate_updgrp_packets-shares-.patch | [681caee](FRRouting/frr@681caee) |
| 0049-zebra-show-command-to-display-metaq-info.patch | [751ae76](FRRouting/frr@751ae76) |
| 0050-bgpd-add-total-path-count-for-bgp-net-in-json-output.patch | [be3c6d3](FRRouting/frr@be3c6d3) |
| 0051-lib-Add-nexthop_same_no_ifindex-comparison-function.patch | [66f552c](FRRouting/frr@66f552c) |
| 0052-zebra-show-nexthop-count-in-nexthop-group-command.patch | [da5703e](FRRouting/frr@da5703e) |
| 0053-zebra-Allow-nhg-s-to-be-reused-when-multiple-interfa.patch | [46044a4](FRRouting/frr@46044a4) |
| 0054-zebra-Prevent-active-setting-if-interface-is-not-ope.patch | [e5f4675](FRRouting/frr@e5f4675) |
| 0055-zebra-Add-nexthop-group-id-to-route-dump.patch | [b732ad2](FRRouting/frr@b732ad2) |
| 0056-zebra-Display-interface-name-not-ifindex-in-nh-dump.patch | [c891cd2](FRRouting/frr@c891cd2) |

#### How to verify it

Verified the changes on topology with scaled BGP tests and standard test suite

<!--
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
Labels
libfrr master rebase PR needs rebase size/L tests Topotests, make check, etc zebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants