diff options
author | David Ahern <dsahern@kernel.org> | 2020-05-29 16:07:13 -0600 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-06-01 14:48:32 -0700 |
commit | fbee97feed9b3e4acdf9590e1f6b4a2eefecfffe (patch) | |
tree | 0a0db20d9c9840d8b1988c1960a0c25a21713d59 /net/sunrpc/auth_gss/svcauth_gss.c | |
parent | 7f1c04269fe7b3293dea38ea65da4fd6614d6f80 (diff) | |
download | linux-fbee97feed9b3e4acdf9590e1f6b4a2eefecfffe.tar.bz2 |
bpf: Add support to attach bpf program to a devmap entry
Add BPF_XDP_DEVMAP attach type for use with programs associated with a
DEVMAP entry.
Allow DEVMAPs to associate a program with a device entry by adding
a bpf_prog.fd to 'struct bpf_devmap_val'. Values read show the program
id, so the fd and id are a union. bpf programs can get access to the
struct via vmlinux.h.
The program associated with the fd must have type XDP with expected
attach type BPF_XDP_DEVMAP. When a program is associated with a device
index, the program is run on an XDP_REDIRECT and before the buffer is
added to the per-cpu queue. At this point rxq data is still valid; the
next patch adds tx device information allowing the prorgam to see both
ingress and egress device indices.
XDP generic is skb based and XDP programs do not work with skb's. Block
the use case by walking maps used by a program that is to be attached
via xdpgeneric and fail if any of them are DEVMAP / DEVMAP_HASH with
Block attach of BPF_XDP_DEVMAP programs to devices.
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20200529220716.75383-3-dsahern@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/sunrpc/auth_gss/svcauth_gss.c')
0 files changed, 0 insertions, 0 deletions