aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@kernel.org>2022-04-23 09:23:00 -0600
committerStephen Hemminger <stephen@networkplumber.org>2022-05-04 20:20:21 -0700
commit17bf51b74ddd4696ad3393ff700eb5dca3a617f0 (patch)
tree404a0de71a02977287b8bb8f4090d530d7f98a53
parentfa305925123a0a245413aae80be4c4be4fb4e36e (diff)
downloadiproute2-17bf51b74ddd4696ad3393ff700eb5dca3a617f0.tar.gz
libbpf: Remove use of bpf_map_is_offload_neutral
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> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--lib/bpf_libbpf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bpf_libbpf.c b/lib/bpf_libbpf.c
index 7dd1faf53..7b16ee715 100644
--- a/lib/bpf_libbpf.c
+++ b/lib/bpf_libbpf.c
@@ -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);
}