kfree(nfp_prog);
}
-static int
-nfp_bpf_verifier_prep(struct net_device *netdev, struct bpf_prog *prog)
+static int nfp_bpf_verifier_prep(struct bpf_prog *prog)
{
- struct nfp_net *nn = netdev_priv(netdev);
+ struct nfp_net *nn = netdev_priv(prog->aux->offload->netdev);
struct nfp_app *app = nn->app;
struct nfp_prog *nfp_prog;
int ret;
return ret;
}
-static int nfp_bpf_translate(struct net_device *netdev, struct bpf_prog *prog)
+static int nfp_bpf_translate(struct bpf_prog *prog)
{
+ struct nfp_net *nn = netdev_priv(prog->aux->offload->netdev);
struct nfp_prog *nfp_prog = prog->aux->offload->dev_priv;
- struct nfp_net *nn = netdev_priv(netdev);
unsigned int max_instr;
int err;
return 0;
}
-static int
-nsim_bpf_verifier_prep(struct net_device *dev, struct bpf_prog *prog)
+static int nsim_bpf_verifier_prep(struct bpf_prog *prog)
{
- struct netdevsim *ns = netdev_priv(dev);
+ struct netdevsim *ns = netdev_priv(prog->aux->offload->netdev);
if (!ns->bpf_bind_accept)
return -EOPNOTSUPP;
return nsim_bpf_create_prog(ns, prog);
}
-static int nsim_bpf_translate(struct net_device *dev, struct bpf_prog *prog)
+static int nsim_bpf_translate(struct bpf_prog *prog)
{
struct nsim_bpf_bound_prog *state = prog->aux->offload->dev_priv;
int (*insn_hook)(struct bpf_verifier_env *env,
int insn_idx, int prev_insn_idx);
int (*finalize)(struct bpf_verifier_env *env);
- int (*prepare)(struct net_device *netdev, struct bpf_prog *prog);
- int (*translate)(struct net_device *netdev, struct bpf_prog *prog);
+ int (*prepare)(struct bpf_prog *prog);
+ int (*translate)(struct bpf_prog *prog);
void (*destroy)(struct bpf_prog *prog);
};
down_read(&bpf_devs_lock);
offload = prog->aux->offload;
if (offload)
- ret = offload->offdev->ops->prepare(offload->netdev, prog);
+ ret = offload->offdev->ops->prepare(prog);
offload->dev_state = !ret;
up_read(&bpf_devs_lock);
down_read(&bpf_devs_lock);
offload = prog->aux->offload;
if (offload)
- ret = offload->offdev->ops->translate(offload->netdev, prog);
+ ret = offload->offdev->ops->translate(prog);
up_read(&bpf_devs_lock);
return ret;