Le 27/04/2020 à 22:56, Roopa Prabhu a écrit : > From: Roopa Prabhu <[email protected]> > > Current route nexthop API maintains user space compatibility > with old route API by default. Dumps and netlink notifications > support both new and old API format. In systems which have > moved to the new API, this compatibility mode cancels some > of the performance benefits provided by the new nexthop API. > > This patch adds new sysctl nexthop_compat_mode which is on > by default but provides the ability to turn off compatibility > mode allowing systems to run entirely with the new routing > API. Old route API behaviour and support is not modified by this > sysctl. > > Uses a single sysctl to cover both ipv4 and ipv6 following > other sysctls. Covers dumps and delete notifications as > suggested by David Ahern. > > Signed-off-by: Roopa Prabhu <[email protected]> > --- > Documentation/networking/ip-sysctl.txt | 12 ++++++++++++ > include/net/netns/ipv4.h | 2 ++ > net/ipv4/af_inet.c | 1 + > net/ipv4/fib_semantics.c | 3 +++ > net/ipv4/nexthop.c | 5 +++-- > net/ipv4/sysctl_net_ipv4.c | 9 +++++++++ > net/ipv6/route.c | 3 ++- > 7 files changed, 32 insertions(+), 3 deletions(-) > > diff --git a/Documentation/networking/ip-sysctl.txt > b/Documentation/networking/ip-sysctl.txt > index 6fcfd31..a8f2da4 100644 > --- a/Documentation/networking/ip-sysctl.txt > +++ b/Documentation/networking/ip-sysctl.txt > @@ -1553,6 +1553,18 @@ skip_notify_on_dev_down - BOOLEAN > on userspace caches to track link events and evict routes. > Default: false (generate message) > > +nexthop_compat_mode - BOOLEAN > + New nexthop API provides a means for managing nexthops independent of > + prefixes. Backwards compatibilty with old route format is enabled by > + default which means route dumps and notifications contain the new > + nexthop attribute but also the full, expanded nexthop definition. > + Further, updates or deletes of a nexthop configuration generate route > + notifications for each fib entry using the nexthop. Once a system > + understands the new API, this sysctl can be disabled to achieve full > + performance benefits of the new API by disabling the nexthop expansion > + and extraneous notifications. > + Default: true (backward compat mode) Maybe it could be good to allow only the transition true -> false to avoid nightmare debug. When the user chooses to leave the compat mode, it should never come back to it, it's not a game ;-)
Regards, Nicolas
