summaryrefslogtreecommitdiffstats
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
authorJakub Kicinski2018-07-17 19:53:26 +0200
committerDaniel Borkmann2018-07-18 15:10:34 +0200
commitfd4f227dea0f24d89f52f7c4eb3207f84ddcbcbd (patch)
tree0d9069be10b5d73982775098eb798f8379633e22 /include/linux/bpf.h
parentbpf: offload: keep the offload state per-ASIC (diff)
downloadkernel-qcow2-linux-fd4f227dea0f24d89f52f7c4eb3207f84ddcbcbd.tar.gz
kernel-qcow2-linux-fd4f227dea0f24d89f52f7c4eb3207f84ddcbcbd.tar.xz
kernel-qcow2-linux-fd4f227dea0f24d89f52f7c4eb3207f84ddcbcbd.zip
bpf: offload: allow program and map sharing per-ASIC
Allow programs and maps to be re-used across different netdevs, as long as they belong to the same struct bpf_offload_dev. Update the bpf_offload_prog_map_match() helper for the verifier and export a new helper for the drivers to use when checking programs at attachment time. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r--include/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 913465e45062..5b5ad95cf339 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -657,6 +657,7 @@ int bpf_offload_dev_netdev_register(struct bpf_offload_dev *offdev,
struct net_device *netdev);
void bpf_offload_dev_netdev_unregister(struct bpf_offload_dev *offdev,
struct net_device *netdev);
+bool bpf_offload_dev_match(struct bpf_prog *prog, struct net_device *netdev);
#if defined(CONFIG_NET) && defined(CONFIG_BPF_SYSCALL)
int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr);