** Description changed:

+ SRU Justification
+ 
+ [Impact]
+ BPF selftests fail to build on Noble and Oracular. This happens because of
+ commit 02b4e126e6 ("bpf: selftests: test_tunnel: Use vmlinux.h declarations"),
+ which relies on the definitions of `bpf_fou_encap` and
+ `bpf_fou_encap_type` used in test_tunnel_kern.c being on vmlinux.h.
+ Since we have CONFIG_NET_FOU=m instead of =y, these declarations
+ cannot be solved and the tests cannot be built.
+ 
+ [Fix]
+ Clean cherry-pick of d17f9b370df6 ("selftests/bpf: Fix compilation failure 
when
+ CONFIG_NET_FOU!=y")
+ 
+ [Test]
+ 1) Install build dependencies:
+ apt install build-essential libelf-dev llvm clang lld libssl-dev 
docutils-common -y
+ 2) Build the tests using the kernel source tree with the patch applied:
+ make -C tools/testing/selftests/ TARGETS=bpf SKIP_TARGETS= all 
KDIR=/usr/src/linux-headers-$(uname -r)/
+ 
+ [Where problems could occur]
+ Change is limited to BPF selftests, no problems should occur in the kernel
+ image or modules.
+ 
+ 
+ 
--------------------------------------------------------------------------------
+ Original bug report:
+ 
  Test build failed since 6.8.0-19.19 (probably way more earlier, this is
  earliest one that I can see):
  
-     CLNG-BPF [test_maps] test_tcpnotify_kern.bpf.o
-     CLNG-BPF [test_maps] test_time_tai.bpf.o
-     CLNG-BPF [test_maps] test_trace_ext.bpf.o
-     CLNG-BPF [test_maps] test_trace_ext_tracing.bpf.o
-     CLNG-BPF [test_maps] test_tracepoint.bpf.o
-     CLNG-BPF [test_maps] test_trampoline_count.bpf.o
-     CLNG-BPF [test_maps] test_tunnel_kern.bpf.o
-   make[1]: Leaving directory 
'/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf'
-   make: Leaving directory 
'/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests'
-   stderr:
-   Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from 
latest version at 'include/uapi/linux/bpf.h'
-   Warning: Kernel ABI header at 'tools/include/uapi/linux/if_xdp.h' differs 
from latest version at 'include/uapi/linux/if_xdp.h'
-   progs/test_tunnel_kern.c:30:13: error: declaration of 'struct 
bpf_fou_encap' will not be visible outside of this function 
[-Werror,-Wvisibility]
-      30 |                           struct bpf_fou_encap *encap, int type) 
__ksym;
-         |                                  ^
-   progs/test_tunnel_kern.c:32:13: error: declaration of 'struct 
bpf_fou_encap' will not be visible outside of this function 
[-Werror,-Wvisibility]
-      32 |                           struct bpf_fou_encap *encap) __ksym;
-         |                                  ^
-   progs/test_tunnel_kern.c:741:23: error: variable has incomplete type 
'struct bpf_fou_encap'
-     741 |         struct bpf_fou_encap encap = {};
-         |                              ^
-   progs/test_tunnel_kern.c:741:9: note: forward declaration of 'struct 
bpf_fou_encap'
-     741 |         struct bpf_fou_encap encap = {};
-         |                ^
-   progs/test_tunnel_kern.c:765:43: error: use of undeclared identifier 
'FOU_BPF_ENCAP_GUE'
-     765 |         ret = bpf_skb_set_fou_encap(skb, &encap, FOU_BPF_ENCAP_GUE);
-         |                                                  ^
-   progs/test_tunnel_kern.c:778:23: error: variable has incomplete type 
'struct bpf_fou_encap'
-     778 |         struct bpf_fou_encap encap = {};
-         |                              ^
-   progs/test_tunnel_kern.c:778:9: note: forward declaration of 'struct 
bpf_fou_encap'
-     778 |         struct bpf_fou_encap encap = {};
-         |                ^
-   progs/test_tunnel_kern.c:802:43: error: use of undeclared identifier 
'FOU_BPF_ENCAP_FOU'
-     802 |         ret = bpf_skb_set_fou_encap(skb, &encap, FOU_BPF_ENCAP_FOU);
-         |                                                  ^
-   progs/test_tunnel_kern.c:816:23: error: variable has incomplete type 
'struct bpf_fou_encap'
-     816 |         struct bpf_fou_encap encap = {};
-         |                              ^
-   progs/test_tunnel_kern.c:816:9: note: forward declaration of 'struct 
bpf_fou_encap'
-     816 |         struct bpf_fou_encap encap = {};
-         |                ^
-   7 errors generated.
-   make[1]: *** [Makefile:620: 
/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/test_tunnel_kern.bpf.o]
 Error 1
-   make: *** [Makefile:180: all] Error 2
+     CLNG-BPF [test_maps] test_tcpnotify_kern.bpf.o
+     CLNG-BPF [test_maps] test_time_tai.bpf.o
+     CLNG-BPF [test_maps] test_trace_ext.bpf.o
+     CLNG-BPF [test_maps] test_trace_ext_tracing.bpf.o
+     CLNG-BPF [test_maps] test_tracepoint.bpf.o
+     CLNG-BPF [test_maps] test_trampoline_count.bpf.o
+     CLNG-BPF [test_maps] test_tunnel_kern.bpf.o
+   make[1]: Leaving directory 
'/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf'
+   make: Leaving directory 
'/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests'
+   stderr:
+   Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from 
latest version at 'include/uapi/linux/bpf.h'
+   Warning: Kernel ABI header at 'tools/include/uapi/linux/if_xdp.h' differs 
from latest version at 'include/uapi/linux/if_xdp.h'
+   progs/test_tunnel_kern.c:30:13: error: declaration of 'struct 
bpf_fou_encap' will not be visible outside of this function 
[-Werror,-Wvisibility]
+      30 |                           struct bpf_fou_encap *encap, int type) 
__ksym;
+         |                                  ^
+   progs/test_tunnel_kern.c:32:13: error: declaration of 'struct 
bpf_fou_encap' will not be visible outside of this function 
[-Werror,-Wvisibility]
+      32 |                           struct bpf_fou_encap *encap) __ksym;
+         |                                  ^
+   progs/test_tunnel_kern.c:741:23: error: variable has incomplete type 
'struct bpf_fou_encap'
+     741 |         struct bpf_fou_encap encap = {};
+         |                              ^
+   progs/test_tunnel_kern.c:741:9: note: forward declaration of 'struct 
bpf_fou_encap'
+     741 |         struct bpf_fou_encap encap = {};
+         |                ^
+   progs/test_tunnel_kern.c:765:43: error: use of undeclared identifier 
'FOU_BPF_ENCAP_GUE'
+     765 |         ret = bpf_skb_set_fou_encap(skb, &encap, FOU_BPF_ENCAP_GUE);
+         |                                                  ^
+   progs/test_tunnel_kern.c:778:23: error: variable has incomplete type 
'struct bpf_fou_encap'
+     778 |         struct bpf_fou_encap encap = {};
+         |                              ^
+   progs/test_tunnel_kern.c:778:9: note: forward declaration of 'struct 
bpf_fou_encap'
+     778 |         struct bpf_fou_encap encap = {};
+         |                ^
+   progs/test_tunnel_kern.c:802:43: error: use of undeclared identifier 
'FOU_BPF_ENCAP_FOU'
+     802 |         ret = bpf_skb_set_fou_encap(skb, &encap, FOU_BPF_ENCAP_FOU);
+         |                                                  ^
+   progs/test_tunnel_kern.c:816:23: error: variable has incomplete type 
'struct bpf_fou_encap'
+     816 |         struct bpf_fou_encap encap = {};
+         |                              ^
+   progs/test_tunnel_kern.c:816:9: note: forward declaration of 'struct 
bpf_fou_encap'
+     816 |         struct bpf_fou_encap encap = {};
+         |                ^
+   7 errors generated.
+   make[1]: *** [Makefile:620: 
/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/test_tunnel_kern.bpf.o]
 Error 1
+   make: *** [Makefile:180: all] Error 2

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2069407

Title:
  ubuntu_bpf failed to build on Noble / Oracular

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/2069407/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to