selftests/bpf: Remove usage of deprecated feature probing APIs
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 2 Feb 2022 22:59:14 +0000 (14:59 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 3 Feb 2022 15:32:25 +0000 (16:32 +0100)
Switch to libbpf_probe_*() APIs instead of the deprecated ones.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20220202225916.3313522-5-andrii@kernel.org
tools/testing/selftests/bpf/test_maps.c
tools/testing/selftests/bpf/test_verifier.c

index 50f7e74..cbebfaa 100644 (file)
@@ -738,7 +738,7 @@ static void test_sockmap(unsigned int tasks, void *data)
                            sizeof(key), sizeof(value),
                            6, NULL);
        if (fd < 0) {
-               if (!bpf_probe_map_type(BPF_MAP_TYPE_SOCKMAP, 0)) {
+               if (!libbpf_probe_bpf_map_type(BPF_MAP_TYPE_SOCKMAP, NULL)) {
                        printf("%s SKIP (unsupported map type BPF_MAP_TYPE_SOCKMAP)\n",
                               __func__);
                        skips++;
index 163b303..92e3465 100644 (file)
@@ -456,7 +456,7 @@ static int probe_filter_length(const struct bpf_insn *fp)
 
 static bool skip_unsupported_map(enum bpf_map_type map_type)
 {
-       if (!bpf_probe_map_type(map_type, 0)) {
+       if (!libbpf_probe_bpf_map_type(map_type, NULL)) {
                printf("SKIP (unsupported map type %d)\n", map_type);
                skips++;
                return true;
@@ -1180,7 +1180,7 @@ static void do_test_single(struct bpf_test *test, bool unpriv,
         * bpf_probe_prog_type won't give correct answer
         */
        if (fd_prog < 0 && prog_type != BPF_PROG_TYPE_TRACING &&
-           !bpf_probe_prog_type(prog_type, 0)) {
+           !libbpf_probe_bpf_prog_type(prog_type, NULL)) {
                printf("SKIP (unsupported program type %d)\n", prog_type);
                skips++;
                goto close_fds;