diff options
author | Jakub Sitnicki <jakub@cloudflare.com> | 2020-07-17 13:35:22 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-18 06:18:16 +0300 |
commit | ce3aa9cc5109363099b7c4ac82e2c9768afcaf31 (patch) | |
tree | eeb94dffcd871572d88389730be81a9448663fd6 /include/linux | |
parent | bfdfa51702dec67e9fcd52568b4cf3c7f799db8b (diff) | |
download | linux-ce3aa9cc5109363099b7c4ac82e2c9768afcaf31.tar.xz |
bpf, netns: Handle multiple link attachments
Extend the BPF netns link callbacks to rebuild (grow/shrink) or update the
prog_array at given position when link gets attached/updated/released.
This let's us lift the limit of having just one link attached for the new
attach type introduced by subsequent patch.
No functional changes intended.
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200717103536.397595-2-jakub@cloudflare.com
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/bpf.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 54ad426dbea1..c8c9eabcd106 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -928,6 +928,9 @@ int bpf_prog_array_copy_to_user(struct bpf_prog_array *progs, void bpf_prog_array_delete_safe(struct bpf_prog_array *progs, struct bpf_prog *old_prog); +int bpf_prog_array_delete_safe_at(struct bpf_prog_array *array, int index); +int bpf_prog_array_update_at(struct bpf_prog_array *array, int index, + struct bpf_prog *prog); int bpf_prog_array_copy_info(struct bpf_prog_array *array, u32 *prog_ids, u32 request_cnt, u32 *prog_cnt); |