netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* skb_at_tc_ingress helper breaks compilation of oot modules
@ 2016-04-20 10:21 Ingo Saitz
  2016-04-20 10:38 ` Daniel Borkmann
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Saitz @ 2016-04-20 10:21 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

In Linux 4.5, when CONFIG_NET_CLS_ACT is defined, compilation of out of
tree modules breaks with undeclared functions/constants. The culprit is:

commit fdc5432a7b44ab7de17141beec19d946b9344e91
Author: Daniel Borkmann <daniel@iogearbox.net>
Date:   Thu Jan 7 15:50:22 2016 +0100

    net, sched: add skb_at_tc_ingress helper

which uses G_TC_AT and AT_INGRESS but only includes linux/pkt_cls.h,
which does not include these #defines for oot builds. Unfortunately I'm
not sure what the correct fix is, maybe the uapi folks could help, but i
attached a simple testcase and build log (Makefile is straight from
kernelnewbies).

    Ingo
-- 
 ╭─╮  Kennedy's Lemma:
╭│───╮  If you can parse Perl, you can solve the Halting Problem.
│╰─│─╯
╰──╯  http://www.perlmonks.org/?node_id=663393

[-- Attachment #2: fail.c --]
[-- Type: text/x-csrc, Size: 22 bytes --]

#include <net/ipv6.h>

[-- Attachment #3: Makefile --]
[-- Type: text/plain, Size: 154 bytes --]

obj-m := fail.o

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

[-- Attachment #4: make.log --]
[-- Type: text/plain, Size: 1551 bytes --]

make -C /lib/modules/4.5.0-pinguin20160314/build M=/home/ingo/src/linux/pkt_cls-bug modules
make[1]: Entering directory '/usr/src/linux-headers-4.5.0-pinguin20160314'
  CC [M]  /home/ingo/src/linux/pkt_cls-bug/fail.o
In file included from include/linux/filter.h:16:0,
                 from include/net/sock.h:64,
                 from include/linux/tcp.h:22,
                 from include/linux/ipv6.h:72,
                 from include/net/ipv6.h:16,
                 from /home/ingo/src/linux/pkt_cls-bug/fail.c:1:
include/net/sch_generic.h: In function ‘skb_at_tc_ingress’:
include/net/sch_generic.h:413:9: error: implicit declaration of function ‘G_TC_AT’ [-Werror=implicit-function-declaration]
  return G_TC_AT(skb->tc_verd) & AT_INGRESS;
         ^
include/net/sch_generic.h:413:33: error: ‘AT_INGRESS’ undeclared (first use in this function)
  return G_TC_AT(skb->tc_verd) & AT_INGRESS;
                                 ^
include/net/sch_generic.h:413:33: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
scripts/Makefile.build:264: recipe for target '/home/ingo/src/linux/pkt_cls-bug/fail.o' failed
make[2]: *** [/home/ingo/src/linux/pkt_cls-bug/fail.o] Error 1
Makefile:1391: recipe for target '_module_/home/ingo/src/linux/pkt_cls-bug' failed
make[1]: *** [_module_/home/ingo/src/linux/pkt_cls-bug] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.5.0-pinguin20160314'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: skb_at_tc_ingress helper breaks compilation of oot modules
  2016-04-20 10:21 skb_at_tc_ingress helper breaks compilation of oot modules Ingo Saitz
@ 2016-04-20 10:38 ` Daniel Borkmann
  2016-04-20 10:53   ` Ingo Saitz
  2016-04-20 17:33   ` Alexei Starovoitov
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Borkmann @ 2016-04-20 10:38 UTC (permalink / raw)
  To: Ingo Saitz; +Cc: netdev

On 04/20/2016 12:21 PM, Ingo Saitz wrote:
> In Linux 4.5, when CONFIG_NET_CLS_ACT is defined, compilation of out of
> tree modules breaks with undeclared functions/constants. The culprit is:
>
> commit fdc5432a7b44ab7de17141beec19d946b9344e91
> Author: Daniel Borkmann <daniel@iogearbox.net>
> Date:   Thu Jan 7 15:50:22 2016 +0100
>
>      net, sched: add skb_at_tc_ingress helper
>
> which uses G_TC_AT and AT_INGRESS but only includes linux/pkt_cls.h,
> which does not include these #defines for oot builds. Unfortunately I'm
> not sure what the correct fix is, maybe the uapi folks could help, but i
> attached a simple testcase and build log (Makefile is straight from
> kernelnewbies).

Hmm, your fail.c test case only contains '#include <net/ipv6.h>'?

Note, upstream kernel never cared about out-of-tree modules, only
in-tree code. ;) Did you run into an issue with any in-tree code?

Thanks,
Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: skb_at_tc_ingress helper breaks compilation of oot modules
  2016-04-20 10:38 ` Daniel Borkmann
@ 2016-04-20 10:53   ` Ingo Saitz
  2016-04-20 17:33   ` Alexei Starovoitov
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Saitz @ 2016-04-20 10:53 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: Ingo Saitz, netdev

On Wed, Apr 20, 2016 at 12:38:11PM +0200, Daniel Borkmann wrote:
> Hmm, your fail.c test case only contains '#include <net/ipv6.h>'?

No, only when building oot modules (virtualbox, and I found batman-adv
having the same issue), so I reduced it to the most simple test case. This
actually builds a fail.ko on 4.4.7 with CONFIG_NET_CLS_ACT=y without
errors.

> Note, upstream kernel never cared about out-of-tree modules, only
> in-tree code. ;) Did you run into an issue with any in-tree code?

A current fix for oot modules would be to add:

#include <uapi/linux/pkt_cls.h>

in front of that include for kernel >= 4.5…

    Ingo
-- 
Kennedy's Lemma:
    If you can parse Perl, you can solve the Halting Problem.

http://www.perlmonks.org/?node_id=663393

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: skb_at_tc_ingress helper breaks compilation of oot modules
  2016-04-20 10:38 ` Daniel Borkmann
  2016-04-20 10:53   ` Ingo Saitz
@ 2016-04-20 17:33   ` Alexei Starovoitov
  1 sibling, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2016-04-20 17:33 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: Ingo Saitz, netdev

On Wed, Apr 20, 2016 at 12:38:11PM +0200, Daniel Borkmann wrote:
> On 04/20/2016 12:21 PM, Ingo Saitz wrote:
> >In Linux 4.5, when CONFIG_NET_CLS_ACT is defined, compilation of out of
> >tree modules breaks with undeclared functions/constants. The culprit is:
> >
> >commit fdc5432a7b44ab7de17141beec19d946b9344e91
> >Author: Daniel Borkmann <daniel@iogearbox.net>
> >Date:   Thu Jan 7 15:50:22 2016 +0100
> >
> >     net, sched: add skb_at_tc_ingress helper
> >
> >which uses G_TC_AT and AT_INGRESS but only includes linux/pkt_cls.h,
> >which does not include these #defines for oot builds. Unfortunately I'm
> >not sure what the correct fix is, maybe the uapi folks could help, but i
> >attached a simple testcase and build log (Makefile is straight from
> >kernelnewbies).
> 
> Hmm, your fail.c test case only contains '#include <net/ipv6.h>'?
> 
> Note, upstream kernel never cared about out-of-tree modules, only
> in-tree code. ;) Did you run into an issue with any in-tree code?

I'm glad it broke out of tree module. We should do it more often.
llvm constantly reshuffles internal api to incentivize upstreaming
and working with the community.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-20 17:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-20 10:21 skb_at_tc_ingress helper breaks compilation of oot modules Ingo Saitz
2016-04-20 10:38 ` Daniel Borkmann
2016-04-20 10:53   ` Ingo Saitz
2016-04-20 17:33   ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).