8000 nexthop: fix disappearing addresses and routes after expiration by rjarry · Pull Request #193 · DPDK/grout · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nexthop: fix disappearing addresses and routes after expiration #193

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
Apr 8, 2025

Conversation

rjarry
Copy link
Collaborator
@rjarry rjarry commented Apr 4, 2025

After a fixed period of time (20 minutes), grout will mark non-static nexthops that were resolved earlier (with ARP or NDP) as STALE and will try to probe them to refresh their mac addresses.

After 6 probes have been sent (3 unicast using the previously known mac address of the nexthop, and 3 broadcast/multicast) without any reply from the nexthop, it is marked as FAILED.

After 1 minute in the FAILED state, it is "freed" using the callback specified in the nexthop_ops per family (at the moment, only IPv4 and IPv6).

The current callbacks are rib4_cleanup and rib6_cleanup which are very aggressive. They effectively delete everything related to the nexthop. Including any local address, routes, etc.

Replace these callbacks with simpler ones which only delete /32 and /128 routes and decrement the reference counter on the nexthop. If the nexthop still has routes referencing it (for example, it is used as a gateway for a route), scrub its flags and mac address fields so that
it can reused later.

Fixes: fe3e408 ("route: rework route cleanup routine")

rjarry added 2 commits April 4, 2025 17:34
The boolean logic for determining if a probe should be sent or not is
incorrect. We absolutely don't care if the nexthop is a gateway or not.
Moreover, request_age > probes does not make any sense. I may not have
been in full control of my brain at the time I wrote this.

Only try to send probe if a nexthop is either PENDING or STALE. If we
already sent the maximum number of probes, mark the nexthop as FAILED so
that it is candidate for deletion after one minute.

Fixes: 778bd65 ("ip: implement arp aging and refresh")
Signed-off-by: Robin Jarry <robin@jarry.cc>
After a fixed period of time (20 minutes), grout will mark non-static
nexthops that were resolved earlier (with ARP or NDP) as STALE and will
try to probe them to refresh their mac addresses.

After 6 probes have been sent (3 unicast using the previously known mac
address of the nexthop, and 3 broadcast/multicast) without any reply
from the nexthop, it is marked as FAILED.

After 1 minute in the FAILED state, it is "freed" using the callback
specified in the nexthop_ops per family (at the moment, only IPv4 and
IPv6).

The current callbacks are rib4_cleanup and rib6_cleanup which are very
aggressive. They effectively delete everything related to the nexthop.
Including any local address, routes, etc.

Replace these callbacks with simpler ones which only delete /32 and /128
routes and decrement the reference counter on the nexthop. If the
nexthop still has routes referencing it (for example, it is used as
a gateway for a route), scrub its flags and mac address fields so that
it can reused later.

Fixes: fe3e408 ("route: rework route cleanup routine")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Copy link
Contributor
@maxime-leroy maxime-leroy left a comment

Choose a reason for hiding this comment

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

Look good for me.

@christophefontaine christophefontaine merged commit 377e2d4 into DPDK:main Apr 8, 2025
8 checks passed
@rjarry rjarry deleted the drunken-nexthop-implementation branch May 27, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0