summaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorYonghong Song <yonghong.song@linux.dev>2024-04-09 21:35:27 -0700
committerAlexei Starovoitov <ast@kernel.org>2024-04-10 19:52:25 -0700
commit699c23f02c65cbfc3e638f14ce0d70c23a2e1f02 (patch)
tree070b277b3ca08c33c240a73d794ce2226dd6a719 /tools/include
parentd0a2ba197bcbeaa795c5c961d927bcaf55964669 (diff)
downloadlinux-699c23f02c65cbfc3e638f14ce0d70c23a2e1f02.tar.gz
linux-699c23f02c65cbfc3e638f14ce0d70c23a2e1f02.tar.bz2
linux-699c23f02c65cbfc3e638f14ce0d70c23a2e1f02.zip
bpf: Add bpf_link support for sk_msg and sk_skb progs
Add bpf_link support for sk_msg and sk_skb programs. We have an internal request to support bpf_link for sk_msg programs so user space can have a uniform handling with bpf_link based libbpf APIs. Using bpf_link based libbpf API also has a benefit which makes system robust by decoupling prog life cycle and attachment life cycle. Reviewed-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/r/20240410043527.3737160-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/uapi/linux/bpf.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 6fe9f11c8abe..cee0a7915c08 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -1135,6 +1135,7 @@ enum bpf_link_type {
BPF_LINK_TYPE_TCX = 11,
BPF_LINK_TYPE_UPROBE_MULTI = 12,
BPF_LINK_TYPE_NETKIT = 13,
+ BPF_LINK_TYPE_SOCKMAP = 14,
__MAX_BPF_LINK_TYPE,
};
@@ -6724,6 +6725,10 @@ struct bpf_link_info {
__u32 ifindex;
__u32 attach_type;
} netkit;
+ struct {
+ __u32 map_id;
+ __u32 attach_type;
+ } sockmap;
};
} __attribute__((aligned(8)));