diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-04-25 15:59:49 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-26 07:52:02 +0200 |
commit | a60f9e48b7707b70a0701dd841e43492e1e68371 (patch) | |
tree | 7118ee84a693fcd6aeb52a0a7cc8f04afc955d23 /drivers/net/netdevsim/netdevsim.h | |
parent | netdevsim: add bus attributes to add new and delete devices (diff) | |
download | linux-a60f9e48b7707b70a0701dd841e43492e1e68371.tar.xz linux-a60f9e48b7707b70a0701dd841e43492e1e68371.zip |
netdevsim: rename dev_init/exit() functions and make them independent on ns
These functions are going to be called from bus probe/release(),
therefore make them independent on ns struct and rename accordingly.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/netdevsim/netdevsim.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h index 8d61fcb55f39..d6b3668f9afd 100644 --- a/drivers/net/netdevsim/netdevsim.h +++ b/drivers/net/netdevsim/netdevsim.h @@ -80,6 +80,7 @@ struct nsim_ipsec { struct netdevsim { struct net_device *netdev; + struct nsim_dev *nsim_dev; u64 tx_packets; u64 tx_bytes; @@ -102,7 +103,6 @@ struct netdevsim { bool bpf_xdpoffload_accept; bool bpf_map_accept; - struct devlink *devlink; struct nsim_ipsec ipsec; }; @@ -151,8 +151,14 @@ enum nsim_resource_id { NSIM_RESOURCE_IPV6_FIB_RULES, }; -int nsim_dev_init(struct netdevsim *ns); -void nsim_dev_exit(struct netdevsim *ns); +struct nsim_dev { + struct nsim_fib_data *fib_data; +}; + +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); struct nsim_fib_data *nsim_fib_create(void); void nsim_fib_destroy(struct nsim_fib_data *fib_data); |