summaryrefslogtreecommitdiff
path: root/net/xdp
diff options
context:
space:
mode:
authorAndrey Ignatov <rdna@fb.com>2020-06-20 00:11:44 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2020-06-22 23:22:58 +0300
commit2872e9ac33a4440173418147351ed4f93177e763 (patch)
treed6e1d303efc0b0ce2e4cdefeca4403ddecc08a1d /net/xdp
parent41c48f3a98231738c5ce79f6f2aa6e40ba924d18 (diff)
downloadlinux-2872e9ac33a4440173418147351ed4f93177e763.tar.xz
bpf: Set map_btf_{name, id} for all map types
Set map_btf_name and map_btf_id for all map types so that map fields can be accessed by bpf programs. Signed-off-by: Andrey Ignatov <rdna@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/a825f808f22af52b018dbe82f1c7d29dab5fc978.1592600985.git.rdna@fb.com
Diffstat (limited to 'net/xdp')
-rw-r--r--net/xdp/xskmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/xdp/xskmap.c b/net/xdp/xskmap.c
index 1dc7208c71ba..8367adbbe9df 100644
--- a/net/xdp/xskmap.c
+++ b/net/xdp/xskmap.c
@@ -254,6 +254,7 @@ void xsk_map_try_sock_delete(struct xsk_map *map, struct xdp_sock *xs,
spin_unlock_bh(&map->lock);
}
+static int xsk_map_btf_id;
const struct bpf_map_ops xsk_map_ops = {
.map_alloc = xsk_map_alloc,
.map_free = xsk_map_free,
@@ -264,4 +265,6 @@ const struct bpf_map_ops xsk_map_ops = {
.map_update_elem = xsk_map_update_elem,
.map_delete_elem = xsk_map_delete_elem,
.map_check_btf = map_check_no_btf,
+ .map_btf_name = "xsk_map",
+ .map_btf_id = &xsk_map_btf_id,
};