From ece90fe7b89e16b5099149e5ee99e943ef83f50c Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Fri, 1 Sep 2023 23:55:15 +0200 Subject: sys/linux: support multi-progs for BPF_PROG_ATTACH Commit [1] upstream, and subsequent patches, extended the BPF_PROG_ATTACH command to support a new multi-prog object in the BPF subsystem. In particular, programs can now be attached relative to another object (relative_obj), a BPF program or link, referenced via either an fd or a BPF ID (id_or_fd). In addition, a new concept of BPF revision number was introduced and a revision number can be passed, to be checked at attach time. Finally, the attachment target can now also be an ifindex. 1 - 053c8e1f235dc ("bpf: Add generic attach/detach/query API for multi-progs") Signed-off-by: Paul Chaignon --- sys/linux/bpf.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sys/linux/bpf.txt') diff --git a/sys/linux/bpf.txt b/sys/linux/bpf.txt index 4eb63170e..cafdb65fc 100644 --- a/sys/linux/bpf.txt +++ b/sys/linux/bpf.txt @@ -565,14 +565,24 @@ bpf_obj_get_o_path { bpf_attach_targets [ cgroup fd_cgroup[opt] map fd_bpf_map[opt] + ifindex ifindex +] + +id_or_fd [ + link_fd fd_bpf_link + prog_fd fd_bpf_prog + link_id bpf_link_id + prog_id bpf_prog_id ] bpf_attach_arg { - target_fd bpf_attach_targets + target bpf_attach_targets attach_bpf_fd fd_bpf_prog type flags[bpf_attach_type, int32] flags flags[bpf_attach_flags, int32] replace_bpf_fd fd_bpf_prog + relative_obj id_or_fd + exp_revision int64 } bpf_detach_arg { -- cgit mrf-deployment