aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-04-28 17:16:06 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-04-28 17:27:08 -0700
commita3b80e1078943dc12553166fb08e258463dec013 (patch)
treee022212949f8028eacf0c5d3ad77218d7f1a7b1a /include/uapi/linux/bpf.h
parentbpf: Refactor bpf_link update handling (diff)
downloadwireguard-linux-a3b80e1078943dc12553166fb08e258463dec013.tar.xz
wireguard-linux-a3b80e1078943dc12553166fb08e258463dec013.zip
bpf: Allocate ID for bpf_link
Generate ID for each bpf_link using IDR, similarly to bpf_map and bpf_prog. bpf_link creation, initialization, attachment, and exposing to user-space through FD and ID is a complicated multi-step process, abstract it away through bpf_link_primer and bpf_link_prime(), bpf_link_settle(), and bpf_link_cleanup() internal API. They guarantee that until bpf_link is properly attached, user-space won't be able to access partially-initialized bpf_link either from FD or ID. All this allows to simplify bpf_link attachment and error handling code. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200429001614.1544-3-andriin@fb.com
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 4a6c47f3febe..6121aa487465 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -523,6 +523,7 @@ union bpf_attr {
__u32 prog_id;
__u32 map_id;
__u32 btf_id;
+ __u32 link_id;
};
__u32 next_id;
__u32 open_flags;