Commit Graph

5 Commits

Author SHA1 Message Date
Yauheni Kaliuta f3948f6ae4 selftests/bpf: Convert some selftests to high-level BPF map APIs
Bugzilla: https://bugzilla.redhat.com/2120968

commit b2531d4bdce19f28364b45aac9132e153b1f23a4
Author: Andrii Nakryiko <andrii@kernel.org>
Date:   Thu May 12 15:07:13 2022 -0700

    selftests/bpf: Convert some selftests to high-level BPF map APIs
    
    Convert a bunch of selftests to using newly added high-level BPF map
    APIs.
    
    This change exposed that map_kptr selftests allocated too big buffer,
    which is fixed in this patch as well.
    
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20220512220713.2617964-2-andrii@kernel.org

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
2022-11-30 12:47:04 +02:00
Jerome Marchand c96f9d6785 selftests/bpf: Migrate from bpf_prog_test_run
Bugzilla: https://bugzilla.redhat.com/2120966

commit 04fcb5f9a104f24278ad849c642cbdf0c8f48453
Author: Delyan Kratunov <delyank@fb.com>
Date:   Wed Feb 2 15:54:20 2022 -0800

    selftests/bpf: Migrate from bpf_prog_test_run

    bpf_prog_test_run is being deprecated in favor of the OPTS-based
    bpf_prog_test_run_opts.
    We end up unable to use CHECK in most cases, so replace usages with
    ASSERT_* calls.

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

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2022-10-25 14:57:55 +02:00
Yauheni Kaliuta 5db2ed5228 selfetest/bpf: Make some tests serial
Bugzilla: http://bugzilla.redhat.com/2069045

commit d3f7b1664d3ebd69751327f45f5cd4adfb29f620
Author: Yucong Sun <sunyucong@gmail.com>
Date:   Wed Oct 6 11:56:19 2021 -0700

    selfetest/bpf: Make some tests serial
    
    Change tests that often fails in parallel execution mode to serial.
    
    Signed-off-by: Yucong Sun <sunyucong@gmail.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20211006185619.364369-15-fallentree@fb.com

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
2022-06-03 17:23:41 +03:00
Jerome Marchand 2d90e37d99 selftests/bpf: Reduce flakyness in timer_mim
Bugzilla: http://bugzilla.redhat.com/2041365

commit a6258837c8a81dcd9b0f1b061bd35302ad4d5914
Author: Yucong Sun <fallentree@fb.com>
Date:   Mon Aug 23 14:36:29 2021 -0700

    selftests/bpf: Reduce flakyness in timer_mim

    This patch extends wait time in timer_mim. As observed in slow CI environment,
    it is possible to have interrupt/preemption long enough to cause the test to
    fail, almost 1 failure in 5 runs.

    Signed-off-by: Yucong Sun <fallentree@fb.com>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Link: https://lore.kernel.org/bpf/20210823213629.3519641-1-fallentree@fb.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2022-04-29 18:14:44 +02:00
Jerome Marchand dbb6002fb9 selftests/bpf: Add a test with bpf_timer in inner map.
Bugzilla: http://bugzilla.redhat.com/2041365

commit 61f71e746c72f07097b759809c36e814387bc24f
Author: Alexei Starovoitov <ast@kernel.org>
Date:   Wed Jul 14 17:54:17 2021 -0700

    selftests/bpf: Add a test with bpf_timer in inner map.

    Check that map-in-map supports bpf timers.

    Check that indirect "recursion" of timer callbacks works:
    timer_cb1() { bpf_timer_set_callback(timer_cb2); }
    timer_cb2() { bpf_timer_set_callback(timer_cb1); }

    Check that
      bpf_map_release
        htab_free_prealloced_timers
          bpf_timer_cancel_and_free
            hrtimer_cancel
    works while timer cb is running.
    "while true; do ./test_progs -t timer_mim; done"
    is a great stress test. It caught missing timer cancel in htab->extra_elems.

    timer_mim_reject.c is a negative test that checks
    that timer<->map mismatch is prevented.

    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Andrii Nakryiko <andrii@kernel.org>
    Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
    Link: https://lore.kernel.org/bpf/20210715005417.78572-12-alexei.starovoitov@gmail.com

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
2022-04-29 18:14:32 +02:00