zebra: V6 RA not sent anymore after interface up-down-up#18451
zebra: V6 RA not sent anymore after interface up-down-up#18451ton31337 merged 2 commits intoFRRouting:masterfrom
Conversation
|
so ... please add a meaningful title and description? |
2ec3ae2 to
fb482ba
Compare
f4eedc5 to
7095a84
Compare
Added now |
7095a84 to
fe352cb
Compare
fe352cb to
0e7d05c
Compare
0e7d05c to
568f5fe
Compare
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 | ||
| */ |
There was a problem hiding this comment.
Can you fix the comment indentation?
There was a problem hiding this comment.
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 */
- 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)
There was a problem hiding this comment.
no: line 56 is not correct. it looks like it's missing a space to align the comment block
|
Can we have a bit of the context when fast/regular wheels are used? |
c13b1c3 to
3a9feb0
Compare
Added more context |
|
Thanks, makes sense now, but please put it inside the commit (not in PR). |
3a9feb0 to
11dd5a0
Compare
efd20b7 to
3ff752f
Compare
| if (adv_if != NULL) | ||
| if (adv_if != NULL) { | ||
| rtadv_send_packet(zvrf->rtadv.sock, zif->ifp, RA_ENABLE); | ||
| wheel_add_item(zrouter.ra_wheel, zif->ifp); |
There was a problem hiding this comment.
I'm still concerned about this a bit. I only see the "wheel_remove" in the path where the frr-configured "shut" is processed, but not in other interface "down" processing. are you sure this is correct?
There was a problem hiding this comment.
added wheel_remove in interface_down()
3ff752f to
914dee7
Compare
914dee7 to
6147ccc
Compare
|
Test case added. |
mjstapp
left a comment
There was a problem hiding this comment.
the interface module is using some rtadv apis. I think the clearest way to fix these problems is to make sure a) that the rtadv module is notified during the relevant interface events, and b) maybe ensure that it's unambiguous what needs to happen within the rtadv code. a flag, for instance, could indicate whether an interface is rtadv-active or not?
Changed code. |
zebra/interface.c
Outdated
| #include "log.h" | ||
| #include "zclient.h" | ||
| #include "vrf.h" | ||
| #include "wheel.h" |
There was a problem hiding this comment.
don't need this change, right?
zebra/rtadv.c
Outdated
| wheel_remove_item(zrouter.ra_wheel, ifp); | ||
|
|
||
| if (if_down_event) { | ||
| /* Nothing to do more, return */ |
There was a problem hiding this comment.
I guess I understand that you don't want to try to send a packet, but shouldn't you stop the "join_timer" ?
There was a problem hiding this comment.
Sure, I was trying to limit existing behavior part of this change. I have accommodated it now, join_timer is turned off.
mjstapp
left a comment
There was a problem hiding this comment.
I think the zebra changes are ok now
|
|
||
| # Take two snap shots for RA status, it should not change | ||
| # Give enough time, RA adv timer to expire | ||
| sleep(2) |
There was a problem hiding this comment.
This is not really deterministic (with sleeps)...
There was a problem hiding this comment.
I have removed hardcoding for sleep, parsed ndRouterAdvertisementsIntervalSecs and used that for sleep time. Please check new code. But still we need to wait/sleep for some amount of time, to get more correct result. We need to wait for at-least ndRouterAdvertisementsIntervalSecs + buffer time(1 sec) to avoid situation where any event was delayed or due to any processing delay, the RA state might get updated later, if we checked early, test may fail to catch a wrong state, it may indicate false PASS case.
|
|
||
| _, 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") |
There was a problem hiding this comment.
Why do we need this stderr print if we assert below?
| 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) |
There was a problem hiding this comment.
Set at least 15 seconds (this is a minimum)
|
|
||
| # Verify RA state didn't change when interface is down | ||
| if rtadv_output1 != rtadv_output2: | ||
| sys.stderr.write( |
|
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 <souroy@nvidia.com>
Added test cases with interface down/up/shutdown to verify RA state of an interface Signed-off-by: Soumya Roy <souroy@nvidia.com>
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 souroy@nvidia.com