Re: [PATCH bpf-next] selftests/bpf: remove SEC("version") from test progs

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

 



On Thu, Oct 7, 2021 at 2:00 PM Daniel Borkmann <daniel@xxxxxxxxxxxxx> wrote:
>
> On 10/7/21 10:23 PM, Dave Marchevsky wrote:
> > Since commit 6c4fc209fcf9d ("bpf: remove useless version check for prog
> > load") these "version" sections, which result in bpf_attr.kern_version
> > being set, have been unnecessary.
> >
> > Remove them so that it's obvious to folks using selftests as a guide that
> > "modern" BPF progs don't need this section.
> >
> > Signed-off-by: Dave Marchevsky <davemarchevsky@xxxxxx>
> > ---
> >   tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c  | 1 -
> >   tools/testing/selftests/bpf/progs/connect4_prog.c              | 1 -
> >   tools/testing/selftests/bpf/progs/connect6_prog.c              | 1 -
> >   tools/testing/selftests/bpf/progs/connect_force_port4.c        | 1 -
> >   tools/testing/selftests/bpf/progs/connect_force_port6.c        | 1 -
> >   tools/testing/selftests/bpf/progs/dev_cgroup.c                 | 1 -
> >   tools/testing/selftests/bpf/progs/get_cgroup_id_kern.c         | 1 -
> >   tools/testing/selftests/bpf/progs/map_ptr_kern.c               | 1 -
> >   tools/testing/selftests/bpf/progs/netcnt_prog.c                | 1 -
> >   tools/testing/selftests/bpf/progs/sendmsg4_prog.c              | 1 -
> >   tools/testing/selftests/bpf/progs/sendmsg6_prog.c              | 1 -
> >   tools/testing/selftests/bpf/progs/sockmap_parse_prog.c         | 1 -
> >   tools/testing/selftests/bpf/progs/sockmap_tcp_msg_prog.c       | 1 -
> >   tools/testing/selftests/bpf/progs/sockmap_verdict_prog.c       | 1 -
> >   tools/testing/selftests/bpf/progs/sockopt_inherit.c            | 1 -
> >   tools/testing/selftests/bpf/progs/tcp_rtt.c                    | 1 -
> >   tools/testing/selftests/bpf/progs/test_btf_haskv.c             | 1 -
> >   tools/testing/selftests/bpf/progs/test_btf_newkv.c             | 1 -
> >   tools/testing/selftests/bpf/progs/test_btf_nokv.c              | 1 -
> >   tools/testing/selftests/bpf/progs/test_l4lb.c                  | 1 -
> >   tools/testing/selftests/bpf/progs/test_map_in_map.c            | 1 -
> >   tools/testing/selftests/bpf/progs/test_pinning.c               | 1 -
> >   tools/testing/selftests/bpf/progs/test_pinning_invalid.c       | 1 -
> >   tools/testing/selftests/bpf/progs/test_pkt_access.c            | 1 -
> >   tools/testing/selftests/bpf/progs/test_queue_stack_map.h       | 1 -
> >   tools/testing/selftests/bpf/progs/test_select_reuseport_kern.c | 1 -
> >   tools/testing/selftests/bpf/progs/test_sk_lookup.c             | 1 -
> >   tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c    | 1 -
> >   tools/testing/selftests/bpf/progs/test_skb_ctx.c               | 1 -
> >   tools/testing/selftests/bpf/progs/test_sockmap_kern.h          | 1 -
> >   tools/testing/selftests/bpf/progs/test_sockmap_listen.c        | 1 -
> >   tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c   | 1 -
> >   tools/testing/selftests/bpf/progs/test_static_linked1.c        | 1 -
> >   tools/testing/selftests/bpf/progs/test_static_linked2.c        | 1 -
> >   tools/testing/selftests/bpf/progs/test_tcp_estats.c            | 1 -
> >   tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c           | 1 -
> >   tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c        | 1 -
> >   tools/testing/selftests/bpf/progs/test_tracepoint.c            | 1 -
> >   tools/testing/selftests/bpf/progs/test_tunnel_kern.c           | 1 -
> >   tools/testing/selftests/bpf/progs/test_xdp.c                   | 1 -
> >   tools/testing/selftests/bpf/progs/test_xdp_loop.c              | 1 -
> >   tools/testing/selftests/bpf/progs/test_xdp_redirect.c          | 1 -
> >   42 files changed, 42 deletions(-)
> >
> > diff --git a/tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c b/tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c
> > index 3f757e30d7a0..88638315c582 100644
> > --- a/tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c
> > +++ b/tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c
> > @@ -14,7 +14,6 @@
> >   #include <sys/types.h>
> >   #include <sys/socket.h>
> >
> > -int _version SEC("version") = 1;
> >   char _license[] SEC("license") = "GPL";
> >
> >   __u16 g_serv_port = 0;
> > diff --git a/tools/testing/selftests/bpf/progs/connect4_prog.c b/tools/testing/selftests/bpf/progs/connect4_prog.c
> > index a943d394fd3a..cf432a527d49 100644
> > --- a/tools/testing/selftests/bpf/progs/connect4_prog.c
> > +++ b/tools/testing/selftests/bpf/progs/connect4_prog.c
> > @@ -31,7 +31,6 @@
> >   #define IFNAMSIZ 16
> >   #endif
> >
> > -int _version SEC("version") = 1;
> >
>
> Overall looks good, small nit: please don't leave a double newline after the
> removal (here and in other places).
>

Also please don't remove version from test_static_linked tests. They
are there explicitly to test that static linker handles it properly.

> >   __attribute__ ((noinline))
> >   int do_bind(struct bpf_sock_addr *ctx)



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux