bpf.c (82ffd0454bd9bd57780966d47bfd56d579dd4fb3) | bpf.c (dd27c2e3d0a05c01ff14bb672d1a3f0fdd8f98fc) |
---|---|
1/* 2 * Copyright (C) 2017 Netronome Systems, Inc. 3 * 4 * This software is licensed under the GNU General License Version 2, 5 * June 1991 as shown in the file COPYING in the top-level directory of this 6 * source tree. 7 * 8 * THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" --- 234 unchanged lines hidden (view full) --- 243 244 prog->aux->offload->dev_priv = state; 245 246 return 0; 247} 248 249static int nsim_bpf_verifier_prep(struct bpf_prog *prog) 250{ | 1/* 2 * Copyright (C) 2017 Netronome Systems, Inc. 3 * 4 * This software is licensed under the GNU General License Version 2, 5 * June 1991 as shown in the file COPYING in the top-level directory of this 6 * source tree. 7 * 8 * THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" --- 234 unchanged lines hidden (view full) --- 243 244 prog->aux->offload->dev_priv = state; 245 246 return 0; 247} 248 249static int nsim_bpf_verifier_prep(struct bpf_prog *prog) 250{ |
251 struct netdevsim *ns = netdev_priv(prog->aux->offload->netdev); | 251 struct netdevsim *ns = bpf_offload_dev_priv(prog->aux->offload->offdev); |
252 253 if (!ns->bpf_bind_accept) 254 return -EOPNOTSUPP; 255 256 return nsim_bpf_create_prog(ns, prog); 257} 258 259static int nsim_bpf_translate(struct bpf_prog *prog) --- 324 unchanged lines hidden (view full) --- 584 INIT_LIST_HEAD(&ns->sdev->bpf_bound_progs); 585 INIT_LIST_HEAD(&ns->sdev->bpf_bound_maps); 586 587 ns->sdev->ddir_bpf_bound_progs = 588 debugfs_create_dir("bpf_bound_progs", ns->sdev->ddir); 589 if (IS_ERR_OR_NULL(ns->sdev->ddir_bpf_bound_progs)) 590 return -ENOMEM; 591 | 252 253 if (!ns->bpf_bind_accept) 254 return -EOPNOTSUPP; 255 256 return nsim_bpf_create_prog(ns, prog); 257} 258 259static int nsim_bpf_translate(struct bpf_prog *prog) --- 324 unchanged lines hidden (view full) --- 584 INIT_LIST_HEAD(&ns->sdev->bpf_bound_progs); 585 INIT_LIST_HEAD(&ns->sdev->bpf_bound_maps); 586 587 ns->sdev->ddir_bpf_bound_progs = 588 debugfs_create_dir("bpf_bound_progs", ns->sdev->ddir); 589 if (IS_ERR_OR_NULL(ns->sdev->ddir_bpf_bound_progs)) 590 return -ENOMEM; 591 |
592 ns->sdev->bpf_dev = bpf_offload_dev_create(&nsim_bpf_dev_ops); | 592 ns->sdev->bpf_dev = bpf_offload_dev_create(&nsim_bpf_dev_ops, 593 ns); |
593 err = PTR_ERR_OR_ZERO(ns->sdev->bpf_dev); 594 if (err) 595 return err; 596 } 597 598 err = bpf_offload_dev_netdev_register(ns->sdev->bpf_dev, ns->netdev); 599 if (err) 600 goto err_destroy_bdev; --- 47 unchanged lines hidden --- | 594 err = PTR_ERR_OR_ZERO(ns->sdev->bpf_dev); 595 if (err) 596 return err; 597 } 598 599 err = bpf_offload_dev_netdev_register(ns->sdev->bpf_dev, ns->netdev); 600 if (err) 601 goto err_destroy_bdev; --- 47 unchanged lines hidden --- |