mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-07 17:19:07 +08:00
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>
This commit is contained in:
committed by
Andrii Nakryiko
parent
b521a722b9
commit
62217fb32a
@@ -1135,6 +1135,7 @@ enum bpf_link_type {
|
|||||||
BPF_LINK_TYPE_TCX = 11,
|
BPF_LINK_TYPE_TCX = 11,
|
||||||
BPF_LINK_TYPE_UPROBE_MULTI = 12,
|
BPF_LINK_TYPE_UPROBE_MULTI = 12,
|
||||||
BPF_LINK_TYPE_NETKIT = 13,
|
BPF_LINK_TYPE_NETKIT = 13,
|
||||||
|
BPF_LINK_TYPE_SOCKMAP = 14,
|
||||||
__MAX_BPF_LINK_TYPE,
|
__MAX_BPF_LINK_TYPE,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -6724,6 +6725,10 @@ struct bpf_link_info {
|
|||||||
__u32 ifindex;
|
__u32 ifindex;
|
||||||
__u32 attach_type;
|
__u32 attach_type;
|
||||||
} netkit;
|
} netkit;
|
||||||
|
struct {
|
||||||
|
__u32 map_id;
|
||||||
|
__u32 attach_type;
|
||||||
|
} sockmap;
|
||||||
};
|
};
|
||||||
} __attribute__((aligned(8)));
|
} __attribute__((aligned(8)));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user