freebsd-skq/sys
Alexander V. Chernikov a666325282 Introduce nexthop objects and new routing KPI.
This is the foundational change for the routing subsytem rearchitecture.
 More details and goals are available in https://reviews.freebsd.org/D24141 .

This patch introduces concept of nexthop objects and new nexthop-based
 routing KPI.

Nexthops are objects, containing all necessary information for performing
 the packet output decision. Output interface, mtu, flags, gw address goes
 there. For most of the cases, these objects will serve the same role as
 the struct rtentry is currently serving.
Typically there will be low tens of such objects for the router even with
 multiple BGP full-views, as these objects will be shared between routing
 entries. This allows to store more information in the nexthop.

New KPI:

struct nhop_object *fib4_lookup(uint32_t fibnum, struct in_addr dst,
  uint32_t scopeid, uint32_t flags, uint32_t flowid);
struct nhop_object *fib6_lookup(uint32_t fibnum, const struct in6_addr *dst6,
  uint32_t scopeid, uint32_t flags, uint32_t flowid);

These 2 function are intended to replace all all flavours of
 <in_|in6_>rtalloc[1]<_ign><_fib>, mpath functions  and the previous
 fib[46]-generation functions.

Upon successful lookup, they return nexthop object which is guaranteed to
 exist within current NET_EPOCH. If longer lifetime is desired, one can
 specify NHR_REF as a flag and get a referenced version of the nexthop.
 Reference semantic closely resembles rtentry one, allowing sed-style conversion.

Additionally, another 2 functions are introduced to support uRPF functionality
 inside variety of our firewalls. Their primary goal is to hide the multipath
 implementation details inside the routing subsystem, greatly simplifying
 firewalls implementation:

int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid,
  uint32_t flags, const struct ifnet *src_if);
int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid,
  uint32_t flags, const struct ifnet *src_if);

All functions have a separate scopeid argument, paving way to eliminating IPv6 scope
 embedding and allowing to support IPv4 link-locals in the future.

Structure changes:
 * rtentry gets new 'rt_nhop' pointer, slightly growing the overall size.
 * rib_head gets new 'rnh_preadd' callback pointer, slightly growing overall sz.

Old KPI:
During the transition state old and new KPI will coexists. As there are another 4-5
 decent-sized conversion patches, it will probably take a couple of weeks.
To support both KPIs, fields not required by the new KPI (most of rtentry) has to be
 kept, resulting in the temporary size increase.
Once conversion is finished, rtentry will notably shrink.

More details:
* architectural overview: https://reviews.freebsd.org/D24141
* list of the next changes: https://reviews.freebsd.org/D24232

Reviewed by:	ae,glebius(initial version)
Differential Revision:	https://reviews.freebsd.org/D24232
2020-04-12 14:30:00 +00:00
..
amd64 Retire procfs-based process debugging. 2020-04-01 19:22:09 +00:00
arm arm: am335x: Honor pmic option ti,pmic-shutdown-controller 2020-04-11 15:52:07 +00:00
arm64 Add MDIO PHY driver for NS2 ARM64 platform. 2020-04-06 05:48:58 +00:00
bsm vfs: add realpathat syscall 2020-02-20 16:58:19 +00:00
cam Now that we don't have special-case geom hacking defined in md_var.h, stop 2020-04-07 22:23:22 +00:00
cddl MFOpenZFS: ZVOLs should not be allowed to have children 2020-03-25 15:56:18 +00:00
compat Clone the RCU interface into a sleepable and a non-sleepable part 2020-04-08 17:09:45 +00:00
conf Introduce nexthop objects and new routing KPI. 2020-04-12 14:30:00 +00:00
contrib Merge ACPICA 20200326. 2020-03-27 00:29:33 +00:00
crypto Refactor driver and consumer interfaces for OCF (in-kernel crypto). 2020-03-27 18:25:23 +00:00
ddb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
dev Avoid using a variable solely for sizes that are never meant to be 2020-04-11 07:24:57 +00:00
dts arm: zynq: An SPI driver for Zynq platforms 2020-02-28 10:57:23 +00:00
fs Replace mbuf macros with the code they would generate in the NFS code. 2020-04-11 23:37:58 +00:00
gdb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
geom Now that we don't have special-case geom hacking defined in md_var.h, stop 2020-04-07 22:23:22 +00:00
gnu dts: Update our copy for arm, arm64 and riscv dts to Linux 5.5 2020-02-28 15:42:51 +00:00
i386 Retire procfs-based process debugging. 2020-04-01 19:22:09 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern sendfile_iodone: correct calculation of the page index for relookup. 2020-04-12 05:10:48 +00:00
kgssapi Remove support for Kernel GSS algorithms deprecated in r348875. 2020-04-10 23:08:41 +00:00
libkern Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
mips Retire procfs-based process debugging. 2020-04-01 19:22:09 +00:00
modules Remove support for Kernel GSS algorithms deprecated in r348875. 2020-04-10 23:08:41 +00:00
net Introduce nexthop objects and new routing KPI. 2020-04-12 14:30:00 +00:00
net80211 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (7 of many) 2020-02-21 16:32:17 +00:00
netgraph Fix mbuf handling in le advertize packet processing. 2020-04-02 09:15:31 +00:00
netinet Introduce nexthop objects and new routing KPI. 2020-04-12 14:30:00 +00:00
netinet6 Introduce nexthop objects and new routing KPI. 2020-04-12 14:30:00 +00:00
netipsec Refactor driver and consumer interfaces for OCF (in-kernel crypto). 2020-03-27 18:25:23 +00:00
netpfil Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
netsmb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs Remove the old NFS lock device driver that uses Giant. 2020-04-09 14:44:46 +00:00
nfsclient
nfsserver
nlm Remove the old NFS lock device driver that uses Giant. 2020-04-09 14:44:46 +00:00
ofed Fix for double unlock in ipoib. 2020-03-16 12:33:57 +00:00
opencrypto Avoid checking pointers that are never NULL. 2020-04-02 17:22:16 +00:00
powerpc powerpc/booke: Use power-of-two mappings in 64-bit pmap_mapdev 2020-04-11 00:17:55 +00:00
riscv riscv: Add semicolon missing from r359672 2020-04-06 23:54:50 +00:00
rpc Change the xid for client side krpc over UDP to a global value. 2020-04-05 21:08:17 +00:00
security mac_policy: Remove mac_policy_sx 2020-04-04 04:03:10 +00:00
sys Introduce nexthop objects and new routing KPI. 2020-04-12 14:30:00 +00:00
teken
tests Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
tools vfs: stop null checking routines in vop wrappers 2020-01-26 00:41:38 +00:00
ufs ufs: apply suspension for non-forced rw unmounts. 2020-04-10 01:24:16 +00:00
vm Remove dead code leftover from r331018. 2020-03-31 01:12:53 +00:00
x86 x86 tsc: fall back to CPUID if calibration results looks unbelievable. 2020-04-01 16:21:11 +00:00
xdr typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
xen Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (16 of many) 2020-02-25 19:04:39 +00:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00