Re: Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-19 Thread Vincent Li
On Fri, Jan 19, 2024 at 3:35 PM Andrii Nakryiko wrote: > > On Fri, Jan 19, 2024 at 3:13 PM Vincent Li wrote: > > > > On Fri, Jan 19, 2024 at 2:26 PM Alexei Starovoitov > > wrote: > > > > > > On Fri, Jan 19, 2024 at 7:00 AM Vincent Li > > > wrote: > > > > > > > > On Fri, Jan 19, 2024 at 4:23 

Re: Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-19 Thread Andrii Nakryiko
On Fri, Jan 19, 2024 at 3:13 PM Vincent Li wrote: > > On Fri, Jan 19, 2024 at 2:26 PM Alexei Starovoitov > wrote: > > > > On Fri, Jan 19, 2024 at 7:00 AM Vincent Li wrote: > > > > > > On Fri, Jan 19, 2024 at 4:23 AM Eduard Zingerman > > > wrote: > > > > > > > > On Fri, 2024-01-19 at 16:04

Re: Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-19 Thread Vincent Li
On Fri, Jan 19, 2024 at 2:26 PM Alexei Starovoitov wrote: > > On Fri, Jan 19, 2024 at 7:00 AM Vincent Li wrote: > > > > On Fri, Jan 19, 2024 at 4:23 AM Eduard Zingerman wrote: > > > > > > On Fri, 2024-01-19 at 16:04 +0800, Shung-Hsi Yu wrote: > > > > > > [...] > > > > > > > Final goal would be

Re: Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-19 Thread Alexei Starovoitov
On Fri, Jan 19, 2024 at 7:00 AM Vincent Li wrote: > > On Fri, Jan 19, 2024 at 4:23 AM Eduard Zingerman wrote: > > > > On Fri, 2024-01-19 at 16:04 +0800, Shung-Hsi Yu wrote: > > > > [...] > > > > > Final goal would be have BPF selftests compiled and test against our own > > > kernel, without

Re: Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-19 Thread Vincent Li
On Fri, Jan 19, 2024 at 4:23 AM Eduard Zingerman wrote: > > On Fri, 2024-01-19 at 16:04 +0800, Shung-Hsi Yu wrote: > > [...] > > > Final goal would be have BPF selftests compiled and test against our own > > kernel, without having to come up with a specific kernel flavor that is > > used to build

Re: Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-19 Thread Eduard Zingerman
On Fri, 2024-01-19 at 16:04 +0800, Shung-Hsi Yu wrote: [...] > Final goal would be have BPF selftests compiled and test against our own > kernel, without having to come up with a specific kernel flavor that is > used to build and run the selftest. For v5.14 and v5.19-based kernel it > works:

Re: Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-19 Thread Shung-Hsi Yu
On Thu, Jan 18, 2024 at 05:58:20PM +0200, Eduard Zingerman wrote: > On Thu, 2024-01-18 at 19:58 +0800, Shung-Hsi Yu wrote: > > Compilation of lsm_cgroup.c will fail if the vmlinux.h comes from a > > kernel that does _not_ have CONFIG_PACKET=y. The reason is that the > > definition of struct

Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-18 Thread Yonghong Song
On 1/18/24 8:05 AM, Eduard Zingerman wrote: On Thu, 2024-01-18 at 17:58 +0200, Eduard Zingerman wrote: [...] here is how config for x86 CI is prepared: ./scripts/kconfig/merge_config.sh \ ./tools/testing/selftests/bpf/config \ ./tools/testing/selftests/bpf/config.vm \

Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-18 Thread Eduard Zingerman
On Thu, 2024-01-18 at 17:58 +0200, Eduard Zingerman wrote: [...] > here is how config for x86 CI is prepared: > > ./scripts/kconfig/merge_config.sh \ > ./tools/testing/selftests/bpf/config \ > ./tools/testing/selftests/bpf/config.vm \ >

Re: lsm_cgroup.c selftest fails to compile when CONFIG_PACKET!=y

2024-01-18 Thread Eduard Zingerman
On Thu, 2024-01-18 at 19:58 +0800, Shung-Hsi Yu wrote: > Hi, > > Compilation of lsm_cgroup.c will fail if the vmlinux.h comes from a > kernel that does _not_ have CONFIG_PACKET=y. The reason is that the > definition of struct sockaddr_ll is not present in vmlinux.h and the > compiler will