Re: linux-next: Tree for Jul 27 (kernel/bpf/syscall.o)
From: Andrii Nakryiko <hidden>
Date: 2020-07-28 19:07:11
Also in:
bpf, linux-next, lkml
On Mon, Jul 27, 2020 at 11:01 PM Randy Dunlap [off-list ref] wrote:
On 7/27/20 10:48 PM, Andrii Nakryiko wrote:quoted
On Mon, Jul 27, 2020 at 11:58 AM Randy Dunlap [off-list ref] wrote:quoted
On 7/27/20 6:23 AM, Stephen Rothwell wrote:quoted
Hi all, Changes since 20200724:on i386: when CONFIG_XPS is not set/enabled: ld: kernel/bpf/syscall.o: in function `__do_sys_bpf': syscall.c:(.text+0x4482): undefined reference to `bpf_xdp_link_attach'I can't repro this on x86-64 with CONFIG_XPS unset. Do you mind sharing the exact config you've used?No problem. I see this on i386 or x86_64. I am attaching the x86_64 randconfig file instead of the i386 one.quoted
I see that kernel/bpf/syscall.c doesn't include linux/netdevice.h directly, so something must be preventing netdevice.h to eventually get to bpf/syscall.c, but instead of guessing on the fix, I'd like to repro it first. Thanks!The build failure was causing me to see lots of builds failing, so I made a simple patch so that I could get past this issue. My patch follows. Feel free to fix it any way you like.
I was confused for a while by CONFIG_XPS, as nothing really depends on it. So it turned out the real dependency is CONFIG_NET, which is also unset in your random config. I just sent a fix, thanks for reporting and sharing the config!
quoted hunk ↗ jump to hunk
Thanks. --- --- kernel/bpf/syscall.c | 4 ++++ 1 file changed, 4 insertions(+)--- mmotm-2020-0727-1818.orig/kernel/bpf/syscall.c +++ mmotm-2020-0727-1818/kernel/bpf/syscall.c@@ -3924,7 +3924,11 @@ static int link_create(union bpf_attr *a ret = netns_bpf_link_create(attr, prog); break; case BPF_PROG_TYPE_XDP: +#ifdef CONFIG_XPS ret = bpf_xdp_link_attach(attr, prog); +#else + ret = -EINVAL; +#endif break; default: ret = -EINVAL;