]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add verifier callback to get stack usage info for offloaded progs
authorQuentin Monnet <quentin.monnet@netronome.com>
Sun, 7 Oct 2018 11:56:47 +0000 (12:56 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 8 Oct 2018 08:24:12 +0000 (10:24 +0200)
commitb06fc606cb698461263eec568c079cde3c91ff98
tree3ee6760f0783a440e32ce4e59093756a0df3b8f5
parent32e466fe9fed6d4b6e8d89d25c12d564766cf244
bpf: add verifier callback to get stack usage info for offloaded progs

In preparation for BPF-to-BPF calls in offloaded programs, add a new
function attribute to the struct bpf_prog_offload_ops so that drivers
supporting eBPF offload can hook at the end of program verification, and
potentially extract information collected by the verifier.

Implement a minimal callback (returning 0) in the drivers providing the
structs, namely netdevsim and nfp.

This will be useful in the nfp driver, in later commits, to extract the
number of subprograms as well as the stack depth for those subprograms.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/verifier.c
drivers/net/netdevsim/bpf.c
include/linux/bpf.h
include/linux/bpf_verifier.h
kernel/bpf/offload.c
kernel/bpf/verifier.c