summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2018-11-09 14:03:31 +0100
committerAlexei Starovoitov <ast@kernel.org>2018-11-11 00:39:54 +0100
commita40a26322a83d4a26a99ad2616cbd77394c19587 (patch)
tree75c3d7938697f5e1aa16efbdf5ed209ada23d8ce /drivers
parentbpf: pass destroy() as a callback and remove its ndo_bpf subcommand (diff)
downloadlinux-a40a26322a83d4a26a99ad2616cbd77394c19587.tar.xz
linux-a40a26322a83d4a26a99ad2616cbd77394c19587.zip
bpf: pass prog instead of env to bpf_prog_offload_verifier_prep()
Function bpf_prog_offload_verifier_prep(), called from the kernel BPF verifier to run a driver-specific callback for preparing for the verification step for offloaded programs, takes a pointer to a struct bpf_verifier_env object. However, no driver callback needs the whole structure at this time: the two drivers supporting this, nfp and netdevsim, only need a pointer to the struct bpf_prog instance held by env. Update the callback accordingly, on kernel side and in these two drivers. Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/netronome/nfp/bpf/offload.c3
-rw-r--r--drivers/net/netdevsim/bpf.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/offload.c b/drivers/net/ethernet/netronome/nfp/bpf/offload.c
index 91085cc3c843..e6b26d2f651d 100644
--- a/drivers/net/ethernet/netronome/nfp/bpf/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/bpf/offload.c
@@ -183,10 +183,9 @@ static void nfp_prog_free(struct nfp_prog *nfp_prog)
}
static int
-nfp_bpf_verifier_prep(struct net_device *netdev, struct bpf_verifier_env *env)
+nfp_bpf_verifier_prep(struct net_device *netdev, struct bpf_prog *prog)
{
struct nfp_net *nn = netdev_priv(netdev);
- struct bpf_prog *prog = env->prog;
struct nfp_app *app = nn->app;
struct nfp_prog *nfp_prog;
int ret;
diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c
index 33e3d54c3a0a..560bdaf1c98b 100644
--- a/drivers/net/netdevsim/bpf.c
+++ b/drivers/net/netdevsim/bpf.c
@@ -259,14 +259,14 @@ static int nsim_bpf_create_prog(struct netdevsim *ns, struct bpf_prog *prog)
}
static int
-nsim_bpf_verifier_prep(struct net_device *dev, struct bpf_verifier_env *env)
+nsim_bpf_verifier_prep(struct net_device *dev, struct bpf_prog *prog)
{
struct netdevsim *ns = netdev_priv(dev);
if (!ns->bpf_bind_accept)
return -EOPNOTSUPP;
- return nsim_bpf_create_prog(ns, env->prog);
+ return nsim_bpf_create_prog(ns, prog);
}
static int nsim_bpf_translate(struct net_device *dev, struct bpf_prog *prog)