diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-04-25 16:59:50 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-26 08:52:02 +0300 |
commit | d514f41e793d2cbc737ba107d7ae26f387f5eecf (patch) | |
tree | 7ce954c9ecb7a413d3fb417e5b452332759556f7 /drivers/net/netdevsim/netdevsim.h | |
parent | a60f9e48b7707b70a0701dd841e43492e1e68371 (diff) | |
download | linux-d514f41e793d2cbc737ba107d7ae26f387f5eecf.tar.xz |
netdevsim: merge sdev into dev
As previously introduce dev which is mapped 1:1 to a bus device covers
the purpose of the original shared device, merge the sdev code into dev.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim/netdevsim.h')
-rw-r--r-- | drivers/net/netdevsim/netdevsim.h | 54 |
1 files changed, 22 insertions, 32 deletions
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h index d6b3668f9afd..4ef44a9538db 100644 --- a/drivers/net/netdevsim/netdevsim.h +++ b/drivers/net/netdevsim/netdevsim.h @@ -26,37 +26,6 @@ #define NSIM_EA(extack, msg) NL_SET_ERR_MSG_MOD((extack), msg) -struct bpf_prog; -struct bpf_offload_dev; -struct dentry; -struct nsim_vf_config; -struct nsim_fib_data; - -struct netdevsim_shared_dev { - unsigned int refcnt; - u32 switch_id; - - struct dentry *ddir; - - struct bpf_offload_dev *bpf_dev; - - bool bpf_bind_accept; - u32 bpf_bind_verifier_delay; - - struct dentry *ddir_bpf_bound_progs; - u32 prog_id_gen; - - struct list_head bpf_bound_progs; - struct list_head bpf_bound_maps; -}; - -struct netdevsim; - -struct netdevsim_shared_dev *nsim_sdev_get(struct netdevsim *joinns); -void nsim_sdev_put(struct netdevsim_shared_dev *sdev); -int nsim_sdev_init(void); -void nsim_sdev_exit(void); - #define NSIM_IPSEC_MAX_SA_COUNT 33 #define NSIM_IPSEC_VALID BIT(31) @@ -87,7 +56,6 @@ struct netdevsim { struct u64_stats_sync syncp; struct nsim_bus_dev *nsim_bus_dev; - struct netdevsim_shared_dev *sdev; struct dentry *ddir; @@ -107,6 +75,8 @@ struct netdevsim { }; #ifdef CONFIG_BPF_SYSCALL +int nsim_bpf_dev_init(struct nsim_dev *nsim_dev); +void nsim_bpf_dev_exit(struct nsim_dev *nsim_dev); int nsim_bpf_init(struct netdevsim *ns); void nsim_bpf_uninit(struct netdevsim *ns); int nsim_bpf(struct net_device *dev, struct netdev_bpf *bpf); @@ -114,6 +84,15 @@ int nsim_bpf_disable_tc(struct netdevsim *ns); int nsim_bpf_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_priv); #else + +static inline int nsim_bpf_dev_init(struct nsim_dev *nsim_dev) +{ + return 0; +} + +static inline void nsim_bpf_dev_exit(struct nsim_dev *nsim_dev) +{ +} static inline int nsim_bpf_init(struct netdevsim *ns) { return 0; @@ -152,13 +131,24 @@ enum nsim_resource_id { }; struct nsim_dev { + struct nsim_bus_dev *nsim_bus_dev; struct nsim_fib_data *fib_data; + struct dentry *ddir; + struct bpf_offload_dev *bpf_dev; + bool bpf_bind_accept; + u32 bpf_bind_verifier_delay; + struct dentry *ddir_bpf_bound_progs; + u32 prog_id_gen; + struct list_head bpf_bound_progs; + struct list_head bpf_bound_maps; }; struct nsim_dev * nsim_dev_create_with_ns(struct nsim_bus_dev *nsim_bus_dev, struct netdevsim *ns); void nsim_dev_destroy(struct nsim_dev *nsim_dev); +int nsim_dev_init(void); +void nsim_dev_exit(void); struct nsim_fib_data *nsim_fib_create(void); void nsim_fib_destroy(struct nsim_fib_data *fib_data); |