Re: netfilter Kconfig question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 27, 2018 at 4:36 PM Ulf Magnusson <ulfalizer@xxxxxxxxx> wrote:
>
> On Tue, Nov 27, 2018 at 2:33 AM Masahiro Yamada
> <yamada.masahiro@xxxxxxxxxxxxx> wrote:
> >
> > On Tue, Nov 27, 2018 at 4:49 AM Ulf Magnusson <ulfalizer@xxxxxxxxx> wrote:
> > >
> > > On Mon, Nov 26, 2018 at 8:31 AM Masahiro Yamada
> > > <yamada.masahiro@xxxxxxxxxxxxx> wrote:
> > > >
> > > > Hi Randy,
> > > >
> > > >
> > > > On Tue, Nov 20, 2018 at 5:51 AM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
> > > > >
> > > > > Hi Yamada-san,
> > > > >
> > > > > There was recently a netfilter build error in linux-next for which
> > > > > a patch was posted by Taehee Yoo.  The patch works (fixes the build
> > > > > error) but I don't see how or why.
> > > > >
> > > > > My build error report is here:
> > > > > https://lore.kernel.org/lkml/fa7a7824-44df-c058-dba2-ec29c5028361@xxxxxxxxxxxxx/T/#u
> > > > >
> > > > >
> > > > > Would you take a look at it and try to explain why the patch works?
> > > > >
> > > > > The patch's email thread begins here:
> > > > > https://www.spinics.net/lists/netfilter-devel/msg56985.html
> > > >
> > > >
> > > > I think this is a bug of Kconfig.
> > > >
> > > > I sent a patch.
> > > > https://patchwork.kernel.org/patch/10697637/
> > > >
> > > >
> > > > --
> > > > Best Regards
> > > > Masahiro Yamada
> > >
> > > I always understood this behavior as intentional.
> > >
> > > Say that a high-level arch symbol has 'select FOO_HELPERS if FOO' for
> > > example, where both FOO and FOO_HELPERS can be compiled as modules.
> > >
> > > The intention there is probably to make sure that FOO_HELPERS is
> > > available whenever FOO is (FOO_HELPERS must be >= FOO). If FOO is y,
> > > then FOO_HELPERS must be y. If FOO is m, then it's fine for
> > > FOO_HELPERS to be m (but not n), because it can be loaded as needed
> > > whenever FOO is.
> >
> > If we find such an example, it should be rewritten to:
> >
> >
> > config FOO
> >         tristate "foo"
> >         select FOO_HELPERS
>
> Yup, almost always cleaner ways to do it.
>
> >
> >
> >
> >
> > > Forcing FOO_HELPERS to y would remove the possibility to compile it as
> > > a module.
> >
> > This depends on the selector if you write like this:
> >
> >
> > config OTHER_OPTION
> >        tristate "?"
> >        select FOO_HELPERS if FOO
> >
> >
> > although "FOO_HELPERS >= FOO" is not met.
>
> Yeah, that's why I mentioned "high-level arch symbol", because it gets
> more confusing for other symbols. Think boards and the like too.
>
> If you think of 'config A ... select C if B' as "A needs C if B", then
> the current behavior still does the right thing in all cases:
>
>   A B     | C
>   --------+-----
>   n n/m/y | n(+)  (A not enabled, irrelevant)
>   m n     | n(+)  (B not enabled, irrelevant)
>   m m     | m(+)  (Fine, C can be loaded if A and B are)
>   m y     | m(+)  (Ditto)
>   y n     | n(+)  (B not enabled, irrelevant)
>   y m     | m(+)  (Fine, C can be loaded if B is)
>   y y     | y     (Fine, C is available whenever B is)
>
> The big if there is whether you think of select that way. Just trying
> to show why I think it was designed that way.


No.



  y m     | m(+)  (Fine, C can be loaded if B is)


is not fine.



If 'A' is builtin, 'C' must be builtin as well.



How can 'A' resolve references to 'C'
for the combination A=y and C=m ?




-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux