freebsd-dev/lib/libc
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
..
aarch64
amd64 amd64: sync up libc memcmp with the kernel version (r357309) 2020-01-30 19:57:05 +00:00
arm arm/ffs.S: remove stale comment. 2019-12-28 02:11:41 +00:00
capability
compat-43 Adjust history, info source from v1's manuals 2019-09-04 13:44:46 +00:00
db
gdtoa Remove sparc64 specific parts of libc. 2020-02-26 18:55:09 +00:00
gen Introduce nexthop objects and new routing KPI. 2020-04-12 14:30:00 +00:00
gmon
i386 remove obsolete i386 MD memchr implementation 2019-09-25 16:49:22 +00:00
iconv libc: correct iconv buffer overflow 2019-07-02 23:56:37 +00:00
include Add linux-compatible memfd_create 2019-09-25 18:03:18 +00:00
inet
isc
locale Use proper mdoc(7) macros for literal text and do not use Tn 2020-04-01 09:01:35 +00:00
md
mips mips: fix some mcount nits 2019-09-02 01:55:55 +00:00
nameser Bounds check again after advancing cp, otherwise we have a possible 2019-09-05 19:35:30 +00:00
net Improve validation of the sockaddr length in iruserok_sa(). 2020-02-05 16:09:44 +00:00
nls Fix race condition in catopen(3). 2020-03-19 06:33:06 +00:00
posix1e
powerpc [PowerPC] Fix typo in _ctx_start on ppc32 2019-11-23 23:41:21 +00:00
powerpc64 Fix r358688 -- Remember to actually save r3 before processing. 2020-03-11 23:34:44 +00:00
powerpcspe [PowerPC] Fix SPE floating point environment manipulation 2019-12-12 17:12:18 +00:00
quad Add casts and L suffixes to libc quad support, to work around various 2020-02-17 20:14:59 +00:00
regex lib/libc/regex: fix build with REDEBUG defined 2019-09-24 12:21:01 +00:00
resolv Rather than using the legacy IP struct fields in the union for the 2019-06-04 20:53:35 +00:00
riscv Tidy the _set_tp function for RISC-V. 2020-02-06 21:46:15 +00:00
rpc Fix a use of an uninitialized pointer in xdr_rpcbs_rmtcalllist(). 2020-02-05 16:10:09 +00:00
secure ssp: knock out some trivial warnings that come up with WARNS=6 2020-01-04 20:07:11 +00:00
softfloat
stdio Add HISTORY section to getc(3) 2020-04-10 09:37:20 +00:00
stdlib exit(3): Add HISTORY section 2020-04-10 09:27:18 +00:00
stdtime
string memset.3: better fix previous typo 2020-02-08 21:17:48 +00:00
sys libc: Fix possible overflow in binuptime(). 2020-04-09 23:22:35 +00:00
tests Provide O_SEARCH 2020-02-02 16:34:57 +00:00
uuid
x86 Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
xdr typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
yp Increase the size of the send and receive buffers for YP client rpc 2019-09-16 06:42:01 +00:00
libc_nossp.ldscript
libc.ldscript
Makefile Remove sparc64 specific parts of libc. 2020-02-26 18:55:09 +00:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
Makefile.depend.options Update libssp paths in various Makefile.depend* files 2020-01-06 18:15:55 +00:00
Versions.def