]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
libbpf: Remove use of bpf_map_is_offload_neutral
authorDavid Ahern <dsahern@kernel.org>
Sat, 23 Apr 2022 15:23:00 +0000 (09:23 -0600)
committerDavid Ahern <dsahern@kernel.org>
Mon, 2 May 2022 21:46:11 +0000 (14:46 -0700)
bpf_map_is_offload_neutral is deprecated as of v0.8+;
import definition to maintain backwards compatibility.

Signed-off-by: David Ahern <dsahern@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
lib/bpf_libbpf.c

index 7dd1faf536f4db7c5b52656ef3ee7a273671399b..7b16ee71589d79b5c4aa5277fccbacc1292216b2 100644 (file)
@@ -249,6 +249,11 @@ static int handle_legacy_maps(struct bpf_object *obj)
        return ret;
 }
 
+static bool bpf_map_is_offload_neutral(const struct bpf_map *map)
+{
+       return bpf_map__type(map) == BPF_MAP_TYPE_PERF_EVENT_ARRAY;
+}
+
 static int load_bpf_object(struct bpf_cfg_in *cfg)
 {
        struct bpf_program *p, *prog = NULL;
@@ -294,7 +299,7 @@ static int load_bpf_object(struct bpf_cfg_in *cfg)
        }
 
        bpf_object__for_each_map(map, obj) {
-               if (!bpf_map__is_offload_neutral(map))
+               if (!bpf_map_is_offload_neutral(map))
                        bpf_map__set_ifindex(map, cfg->ifindex);
        }