Commit Graph

4 Commits

Author SHA1 Message Date
Artem Savkov fbd9cfcd5b selftests/bpf: Store BPF object files with .bpf.o extension
Bugzilla: https://bugzilla.redhat.com/2166911

commit afef88e65554c3e8691513b8350d6445e292560e
Author: Daniel Müller <deso@posteo.net>
Date:   Thu Sep 1 22:22:53 2022 +0000

    selftests/bpf: Store BPF object files with .bpf.o extension
    
    BPF object files are, in a way, the final artifact produced as part of
    the ahead-of-time compilation process. That makes them somewhat special
    compared to "regular" object files, which are a intermediate build
    artifacts that can typically be removed safely. As such, it can make
    sense to name them differently to make it easier to spot this difference
    at a glance.
    
    Among others, libbpf-bootstrap [0] has established the extension .bpf.o
    for BPF object files. It seems reasonable to follow this example and
    establish the same denomination for selftest build artifacts. To that
    end, this change adjusts the corresponding part of the build system and
    the test programs loading BPF object files to work with .bpf.o files.
    
      [0] https://github.com/libbpf/libbpf-bootstrap
    
    Suggested-by: Andrii Nakryiko <andrii@kernel.org>
    Signed-off-by: Daniel Müller <deso@posteo.net>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20220901222253.1199242-1-deso@posteo.net

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2023-03-06 14:54:06 +01:00
Jerome Marchand 4c07489c47 selftests/bpf: Migrate from bpf_prog_test_run_xattr
Bugzilla: https://bugzilla.redhat.com/2120966

commit 3931618378451f7ae884b14e4120e07560875cab
Author: Delyan Kratunov <delyank@fb.com>
Date:   Wed Feb 2 15:54:21 2022 -0800

    selftests/bpf: Migrate from bpf_prog_test_run_xattr

    bpf_prog_test_run_xattr is being deprecated in favor of the OPTS-based
    bpf_prog_test_run_opts.
    We end up unable to use CHECK_ATTR so replace usages with ASSERT_* calls.
    Also, prog_run_xattr is now prog_run_opts.

    Signed-off-by: Delyan Kratunov <delyank@fb.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20220202235423.1097270-3-delyank@fb.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2022-10-25 14:57:55 +02:00
Artem Savkov 15a59583f8 selftests/bpf: Use explicit bpf_prog_test_load() calls everywhere
Bugzilla: https://bugzilla.redhat.com/2069046

Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

commit cbdb1461dcf45765a036e9f6975ffe19e69bdc33
Author: Andrii Nakryiko <andrii@kernel.org>
Date:   Wed Nov 3 15:08:44 2021 -0700

    selftests/bpf: Use explicit bpf_prog_test_load() calls everywhere

    -Dbpf_prog_load_deprecated=bpf_prog_test_load trick is both ugly and
    breaks when deprecation goes into effect due to macro magic. Convert all
    the uses to explicit bpf_prog_test_load() calls which avoid deprecation
    errors and makes everything less magical.

    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Acked-by: Dave Marchevsky <davemarchevsky@fb.com>
    Link: https://lore.kernel.org/bpf/20211103220845.2676888-12-andrii@kernel.org

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2022-08-24 12:53:33 +02:00
John Fastabend ee103e9f15 bpf, selftests: Test probe_* helpers from SCHED_CLS
Lets test using probe* in SCHED_CLS network programs as well just
to be sure these keep working. Its cheap to add the extra test
and provides a second context to test outside of sk_msg after
we generalized probe* helpers to all networking types.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/159033911685.12355.15951980509828906214.stgit@john-Precision-5820-Tower
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2020-06-01 14:38:21 -07:00