Switch net.add_addr_allfibs default to 0.

The goal of the fib support is to provide multiple independent
 routing tables, isolated from each other.
net.add_addr_allfibs default tries to shift gears in the opposite
 direction, unconditionally inserting all addresses to all of the fibs.

There are use cases when this is necessary, however this is not a
 default expected behaviour, especially compared to other implementations.

Provide WARNING message for the setups with multiple fibs to notify
 potential users of the feature.

Differential Revision:	https://reviews.freebsd.org/D26076
This commit is contained in:
Alexander V. Chernikov 2020-11-08 18:27:49 +00:00
parent 76e6b37f6b
commit 2d39824195
3 changed files with 10 additions and 1 deletions

View File

@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
world, or to merely disable the most expensive debugging functionality world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20201108:
Default value of net.add_addr_allfibs has been changed to 0.
If you have multi-fib configuration and rely on existence of all
interface routes in every fib, you need to set the above sysctl to 1.
20201030: 20201030:
The internal pre-processor in the calendar(1) program has been The internal pre-processor in the calendar(1) program has been
extended to support more C pre-processor commands (e.g. #ifdef, #else, extended to support more C pre-processor commands (e.g. #ifdef, #else,

View File

@ -61,7 +61,7 @@
* By default, interface address routes are added to the fib of the interface. * By default, interface address routes are added to the fib of the interface.
* Once set to non-zero, adds interface address route to all fibs. * Once set to non-zero, adds interface address route to all fibs.
*/ */
VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1; VNET_DEFINE(u_int, rt_add_addr_allfibs) = 0;
SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET,
&VNET_NAME(rt_add_addr_allfibs), 0, ""); &VNET_NAME(rt_add_addr_allfibs), 0, "");

View File

@ -183,6 +183,11 @@ grow_rtables(uint32_t num_tables)
new_rt_tables = mallocarray(num_tables * (AF_MAX + 1), sizeof(void *), new_rt_tables = mallocarray(num_tables * (AF_MAX + 1), sizeof(void *),
M_RTABLE, M_WAITOK | M_ZERO); M_RTABLE, M_WAITOK | M_ZERO);
if ((num_tables > 1) && (V_rt_add_addr_allfibs == 0))
printf("WARNING: Adding ifaddrs to all fibs has been turned off "
"by default. Consider tuning %s if needed\n",
"net.add_addr_allfibs");
/* /*
* Current rt_tables layout: * Current rt_tables layout:
* fib0[af0, af1, af2, .., AF_MAX]fib1[af0, af1, af2, .., Af_MAX].. * fib0[af0, af1, af2, .., AF_MAX]fib1[af0, af1, af2, .., Af_MAX]..