Page MenuHomeFreeBSD

routing: Replace unreachable nhops in nhgrp
Needs ReviewPublic

Authored by pouria on Mon, Jun 1, 7:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 8, 4:17 PM
Unknown Object (File)
Sun, Jun 7, 8:08 PM
Unknown Object (File)
Sun, Jun 7, 7:54 PM
Unknown Object (File)
Sat, Jun 6, 4:53 AM
Unknown Object (File)
Fri, Jun 5, 8:35 PM
Unknown Object (File)
Fri, Jun 5, 3:54 AM
Unknown Object (File)
Thu, Jun 4, 4:08 PM
Unknown Object (File)
Thu, Jun 4, 5:22 AM
Subscribers

Details

Reviewers
melifaro
glebius
markj
zlei
emaste
Group Reviewers
network
Summary

If a nhop gets an interface event, revalidate the nhops and
immediately try to recompile existing nexthop groups by
replacing unreachable nexthops with reachable ones.
If none are available, recompile them back to
their normal position in nexthop group slots.

Relnotes: yes

FINALLY TRUE ECMP WITHOUT EXTRA ALLOCATION!
in comparison to other OSes, we don't simply remove unreachable routes.
Now instead we replace them with reachable one.

We also don't want to walk through RIB to filter out ECMP ones.
We directly recompile nhgrps.

Test Plan
[root@ftsr1] [~] # netstat -On4W
Nexthop groups data

Internet:
GrpIdx  NhIdx     Weight   Slots           Gateway     Netif  Refcnt
8         ------- ------- ------- ----------------- ---------       2
4       1       1      172.23.1.254    vtnet0
7       1       1       192.168.9.1    vtnet1
[root@ftsr1] [~] # ifconfig vtnet1 down
[root@ftsr1] [~] # netstat -On4W
Nexthop groups data

Internet:
GrpIdx  NhIdx     Weight   Slots           Gateway     Netif  Refcnt
8         ------- ------- ------- ----------------- ---------       2
4       1       2      172.23.1.254    vtnet0
7       1       0       192.168.9.1    vtnet1
[root@ftsr1] [~] # ifconfig vtnet1 up
[root@ftsr1] [~] # netstat -On4W
Nexthop groups data

Internet:
GrpIdx  NhIdx     Weight   Slots           Gateway     Netif  Refcnt
8         ------- ------- ------- ----------------- ---------       2
4       1       1      172.23.1.254    vtnet0
7       1       1       192.168.9.1    vtnet1

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 73617
Build 70500: arc lint + arc unit