public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel•org>
To: netdev@vger•kernel.org
Cc: stephen@networkplumber•org, toke@redhat•com, haliu@redhat•com,
	David Ahern <dsahern@kernel•org>
Subject: [PATCH iproute2-next 3/3] libbpf: Remove use of bpf_map_is_offload_neutral
Date: Sat, 23 Apr 2022 09:23:00 -0600	[thread overview]
Message-ID: <20220423152300.16201-4-dsahern@kernel.org> (raw)
In-Reply-To: <20220423152300.16201-1-dsahern@kernel.org>

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>
---
 lib/bpf_libbpf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/bpf_libbpf.c b/lib/bpf_libbpf.c
index 7dd1faf536f4..7b16ee71589d 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);
 	}
 
-- 
2.24.3 (Apple Git-128)


  parent reply	other threads:[~2022-04-23 15:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 15:22 [PATCH iproute2-next 0/3] Address more libbpf deprecations David Ahern
2022-04-23 15:22 ` [PATCH iproute2-next 1/3] libbpf: Use bpf_object__load instead of bpf_object__load_xattr David Ahern
2022-04-24  1:56   ` Hangbin Liu
2022-04-24 16:10     ` David Ahern
2022-04-26  2:29       ` Hangbin Liu
2022-04-23 15:22 ` [PATCH iproute2-next 2/3] libbpf: Remove use of bpf_program__set_priv and bpf_program__priv David Ahern
2022-04-23 15:23 ` David Ahern [this message]
2022-04-23 21:35 ` [PATCH iproute2-next 0/3] Address more libbpf deprecations Toke Høiland-Jørgensen
2022-05-02 21:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220423152300.16201-4-dsahern@kernel.org \
    --to=dsahern@kernel$(echo .)org \
    --cc=haliu@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=toke@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox