On Tue, Aug 25, 2020 at 5:42 PM Maciej Żenczykowski <m...@google.com> wrote:
>
> On Tue, Aug 25, 2020 at 4:00 PM Mahesh Bandewar (महेश बंडेवार)
> <mahe...@google.com> wrote:
> >
> > On Tue, Aug 25, 2020 at 3:47 PM Randy Dunlap <rdun...@infradead.org> wrote:
> > >
> > > On 8/25/20 3:42 PM, Mahesh Bandewar wrote:
> > > > The sysctl that was added  earlier by commit 79134e6ce2c ("net: do
> > > > not create fallback tunnels for non-default namespaces") to create
> > > > fall-back only in root-ns. This patch enhances that behavior to provide
> > > > option not to create fallback tunnels in root-ns as well. Since modules
> > > > that create fallback tunnels could be built-in and setting the sysctl
> > > > value after booting is pointless, so added a kernel cmdline options to
> > > > change this default. The default setting is preseved for backward
> > > > compatibility. The kernel command line option of fb_tunnels=initns will
> > > > set the sysctl value to 1 and will create fallback tunnels only in 
> > > > initns
> > > > while kernel cmdline fb_tunnels=none will set the sysctl value to 2 and
> > > > fallback tunnels are skipped in every netns.
> > > >
> > > > Signed-off-by: Mahesh Bandewar <mahe...@google.com>
> > > > Cc: Eric Dumazet <eduma...@google.com>
> > > > Cc: Maciej Zenczykowski <m...@google.com>
> > > > Cc: Jian Yang <jiany...@google.com>
> > > > ---
> > > > v1->v2
> > > >   Removed the Kconfig option which would force rebuild and replaced with
> > > >   kcmd-line option
> > > >
> > > >  .../admin-guide/kernel-parameters.txt         |  5 +++++
> > > >  Documentation/admin-guide/sysctl/net.rst      | 20 +++++++++++++------
> > > >  include/linux/netdevice.h                     |  7 ++++++-
> > > >  net/core/sysctl_net_core.c                    | 17 ++++++++++++++--
> > > >  4 files changed, 40 insertions(+), 9 deletions(-)
> > > >
> > > > diff --git a/Documentation/admin-guide/kernel-parameters.txt 
> > > > b/Documentation/admin-guide/kernel-parameters.txt
> > > > index a1068742a6df..09a51598c792 100644
> > > > --- a/Documentation/admin-guide/kernel-parameters.txt
> > > > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > > > @@ -801,6 +801,11 @@
> > > >
> > > >       debug_objects   [KNL] Enable object debugging
> > > >
> > > > +     fb_tunnels=     [NET]
> > > > +                     Format: { initns | none }
> > > > +                     See Documentation/admin-guide/sysctl/net.rst for
> > > > +                     fb_tunnels_only_for_init_ns
> > > > +
> > >
> > > Not at this location in this file.
> > > Entries in this file are meant to be in alphabetical order (mostly).
> > >
> > > So leave debug_objects and no_debug_objects together, and insert 
> > > fb_tunnels
> > > between fail_make_request= and floppy=.
> > >
> > I see. I'll fix it in the next revision.
> > thanks for the suggestion.
> > --mahesh..
> >
> > > Thanks.
> > >
> > > >       no_debug_objects
> > > >                       [KNL] Disable object debugging
> > > >
> > >
> > > --
> > > ~Randy
>
> Setting it to 1 via kcmdline doesn't seem all that useful, since
> instead of that you can just use initrc/sysctl.conf/etc.
>
> Would it be simpler if it was just 'no_fb_tunnels' or
> 'no_fallback_tunnels' and the function just set the sysctl to 2
> unconditionally?
> (ie. no =.... parsing at all) that would also be less code...
>
To make it simple; all methods should be able to set all values. Otherwise I
agree that it makes less sense to set value = 1 via kcmd. Also one can assign
value = 2 to sysctl once kernel is booted, it may not produce desired results
always but would work if you load modules after changing the sysctl value. I
guess the idea here is to give user full control on what their
situation is and choose
the correct method for the desired end result.

> btw. I also don't understand the '!IS_ENABLED(CONFIG_SYSCTL) ||'
> piece.  Why not just delete that?
> This seems to force fallback tunnels if you disable CONFIG_SYSCTL...
> but (a) then the kcmdline option doesn't work,
> and (b) that should already just happen by virtue of the sysctl defaulting to 
> 0.
agreed. will remove it (!IS_ENABLED(CONFIG_SYSCTL) check) in the next revision.

Reply via email to