freebsd-dev/sys
Alexander V. Chernikov fedeb08b6a Introduce scalable route multipath.
This change is based on the nexthop objects landed in D24232.

The change introduces the concept of nexthop groups.
Each group contains the collection of nexthops with their
 relative weights and a dataplane-optimized structure to enable
 efficient nexthop selection.

Simular to the nexthops, nexthop groups are immutable. Dataplane part
 gets compiled during group creation and is basically an array of
 nexthop pointers, compiled w.r.t their weights.

With this change, `rt_nhop` field of `struct rtentry` contains either
 nexthop or nexthop group. They are distinguished by the presense of
 NHF_MULTIPATH flag.
All dataplane lookup functions returns pointer to the nexthop object,
leaving nexhop groups details inside routing subsystem.

User-visible changes:

The change is intended to be backward-compatible: all non-mpath operations
 should work as before with ROUTE_MPATH and net.route.multipath=1.

All routes now comes with weight, default weight is 1, maximum is 2^24-1.

Current maximum multipath group width is statically set to 64.
 This will become sysctl-tunable in the followup changes.

Using functionality:
* Recompile kernel with ROUTE_MPATH
* set net.route.multipath to 1

route add -6 2001:db8::/32 2001:db8::2 -weight 10
route add -6 2001:db8::/32 2001:db8::3 -weight 20

netstat -6On

Nexthop groups data

Internet6:
GrpIdx  NhIdx     Weight   Slots                                 Gateway     Netif  Refcnt
1         ------- ------- ------- --------------------------------------- ---------       1
              13      10       1                             2001:db8::2     vlan2
              14      20       2                             2001:db8::3     vlan2

Next steps:
* Land outbound hashing for locally-originated routes ( D26523 ).
* Fix net/bird multipath (net/frr seems to work fine)
* Add ROUTE_MPATH to GENERIC
* Set net.route.multipath=1 by default

Tested by:	olivier
Reviewed by:	glebius
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D26449
2020-10-03 10:47:17 +00:00
..
amd64 Fix LINT: Add backlight to NOTES 2020-10-02 20:52:09 +00:00
arm Fix LINT: Add backlight to NOTES 2020-10-02 20:52:09 +00:00
arm64 Fix LINT: Add backlight to NOTES 2020-10-02 20:52:09 +00:00
bsm
cam Revert most of r360179. 2020-09-25 21:19:56 +00:00
cddl loader: zfs should support bootonce an nextboot 2020-09-21 09:01:10 +00:00
compat linuxkpi: Add dmi_* function 2020-10-02 18:28:00 +00:00
conf Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
contrib OpenZFS: don't call fpu_kern_thread on i386 2020-10-02 01:25:08 +00:00
crypto libmd: fix assembly optimized skein implementation 2020-10-01 21:05:50 +00:00
ddb ddb: clean up empty lines in .c and .h files 2020-09-01 22:14:30 +00:00
dev pwm_backlight: Fix 32 bits build 2020-10-03 08:31:28 +00:00
dts Remove licenses 2020-06-04 17:20:58 +00:00
fs Modify the NFSv4.2 VOP_COPY_FILE_RANGE() client call to return after one 2020-10-01 00:47:35 +00:00
gdb gdb(4): Don't escape GDB special characters at application layer 2020-09-30 14:55:54 +00:00
geom geom_part: make it possible recovering broken GPT after some LBAs cut off 2020-09-17 04:39:39 +00:00
gnu Import DTS files for arm, arm64, riscv from Linux 5.8 2020-08-04 19:44:43 +00:00
i386 Fix LINT: Add backlight to NOTES 2020-10-02 20:52:09 +00:00
isa
kern Fix the INVARIANTS build for 32-bit platforms 2020-10-02 18:54:37 +00:00
kgssapi State kgssapi dependency on xdr. 2020-09-17 22:29:38 +00:00
libkern arm64: check for CRC32 support via HWCAP 2020-09-08 15:39:19 +00:00
mips Get rid of sa->narg. It serves no purpose; use sa->callp->sy_narg instead. 2020-09-27 18:47:06 +00:00
modules pwm_backlight: Restrict module to armv7 and aarch64 2020-10-02 19:56:54 +00:00
net Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
net80211 Provide MS() and SM() macros for 80211 and wireless drivers. 2020-09-24 10:57:39 +00:00
netgraph ng_l2tp: Fix callout synchronization in the rexmit timeout handler 2020-09-25 18:55:50 +00:00
netinet Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
netinet6 Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
netipsec net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netpfil net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed infiniband: Appease Coverty 2020-08-31 16:17:28 +00:00
opencrypto Include sys/types.h here 2020-09-15 15:21:29 +00:00
powerpc Fix LINT: Add backlight to NOTES 2020-10-02 20:52:09 +00:00
riscv riscv: handle access faults in user mode 2020-10-02 07:30:11 +00:00
rpc Fix a potential memory leak in the NFS over TLS handling code. 2020-09-05 00:50:52 +00:00
security mac_framework.h: fix build with DEBUG_VFS_LOCKS and !MAC 2020-09-03 20:30:52 +00:00
sys Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
teken Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
tests Add small tool to invoke kernel test framework tests. 2020-09-02 09:20:40 +00:00
tools Make makesyscalls.lua initialize 'struct sysent' entries using c99 2020-09-25 09:34:00 +00:00
ufs Convert page cache read to VOP. 2020-09-15 22:06:36 +00:00
vm vm_pageout: Avoid rounding down the inactive scan target 2020-10-02 19:16:06 +00:00
x86 Rename kernel option ACPI_DMAR to IOMMU. 2020-09-29 20:29:07 +00:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: clean up empty lines in .c and .h files 2020-09-01 21:21:55 +00:00
Makefile