summaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-07-31 20:28:27 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-08-02 05:38:28 +0200
commit2e49527e52486dac910460b1b3f6fce6e21c6b48 (patch)
tree49e845274097de42bf2d254945120233936f196a /tools/include
parentbpf: Add support for forced LINK_DETACH command (diff)
downloadlinux-2e49527e52486dac910460b1b3f6fce6e21c6b48.tar.xz
linux-2e49527e52486dac910460b1b3f6fce6e21c6b48.zip
libbpf: Add bpf_link detach APIs
Add low-level bpf_link_detach() API. Also add higher-level bpf_link__detach() one. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20200731182830.286260-3-andriin@fb.com
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 eb5e0c38eb2c..b134e679e9db 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -117,6 +117,7 @@ enum bpf_cmd {
BPF_LINK_GET_NEXT_ID,
BPF_ENABLE_STATS,
BPF_ITER_CREATE,
+ BPF_LINK_DETACH,
};
enum bpf_map_type {
@@ -634,6 +635,10 @@ union bpf_attr {
__u32 old_prog_fd;
} link_update;
+ struct {
+ __u32 link_fd;
+ } link_detach;
+
struct { /* struct used by BPF_ENABLE_STATS command */
__u32 type;
} enable_stats;