diff options
author | David S. Miller <davem@davemloft.net> | 2019-04-09 20:16:59 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-09 20:16:59 +0200 |
commit | 0c9381d9bcfbd7dbc26b6e5f296e90d6396ea4db (patch) | |
tree | a3a0b9863945488720ee24c45b891fdcb6e51d92 | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff) | |
parent | netdevsim: assume CONFIG_NET_DEVLINK is always enabled (diff) | |
download | linux-0c9381d9bcfbd7dbc26b6e5f296e90d6396ea4db.tar.xz linux-0c9381d9bcfbd7dbc26b6e5f296e90d6396ea4db.zip |
Merge branch 'netdevsim-small-spring-cleanup'
Jiri Pirko says:
====================
netdevsim: small spring cleanup
Nothing serious, just cosmetics.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/netdevsim/Makefile | 6 | ||||
-rw-r--r-- | drivers/net/netdevsim/netdev.c | 8 | ||||
-rw-r--r-- | drivers/net/netdevsim/netdevsim.h | 22 |
3 files changed, 2 insertions, 34 deletions
diff --git a/drivers/net/netdevsim/Makefile b/drivers/net/netdevsim/Makefile index 0fee1d06c084..0e67457156eb 100644 --- a/drivers/net/netdevsim/Makefile +++ b/drivers/net/netdevsim/Makefile @@ -3,17 +3,13 @@ obj-$(CONFIG_NETDEVSIM) += netdevsim.o netdevsim-objs := \ - netdev.o \ + netdev.o devlink.o fib.o \ ifeq ($(CONFIG_BPF_SYSCALL),y) netdevsim-objs += \ bpf.o endif -ifneq ($(CONFIG_NET_DEVLINK),) -netdevsim-objs += devlink.o fib.o -endif - ifneq ($(CONFIG_XFRM_OFFLOAD),) netdevsim-objs += ipsec.o endif diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c index 75a50b59cb8f..0af38bc6d98c 100644 --- a/drivers/net/netdevsim/netdev.c +++ b/drivers/net/netdevsim/netdev.c @@ -139,7 +139,6 @@ static void nsim_dev_release(struct device *dev) struct netdevsim *ns = to_nsim(dev); nsim_vfs_disable(ns); - free_netdev(ns->netdev); } static struct device_type nsim_dev_type = { @@ -490,6 +489,7 @@ static void nsim_setup(struct net_device *dev) eth_hw_addr_random(dev); dev->netdev_ops = &nsim_netdev_ops; + dev->needs_free_netdev = true; dev->priv_destructor = nsim_free; dev->tx_queue_len = 0; @@ -544,18 +544,12 @@ static int nsim_newlink(struct net *src_net, struct net_device *dev, return register_netdevice(dev); } -static void nsim_dellink(struct net_device *dev, struct list_head *head) -{ - unregister_netdevice_queue(dev, head); -} - static struct rtnl_link_ops nsim_link_ops __read_mostly = { .kind = DRV_NAME, .priv_size = sizeof(struct netdevsim), .setup = nsim_setup, .validate = nsim_validate, .newlink = nsim_newlink, - .dellink = nsim_dellink, }; static int __init nsim_module_init(void) diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h index 384c254fafc5..f04050bcb177 100644 --- a/drivers/net/netdevsim/netdevsim.h +++ b/drivers/net/netdevsim/netdevsim.h @@ -97,9 +97,7 @@ struct netdevsim { bool bpf_xdpoffload_accept; bool bpf_map_accept; -#if IS_ENABLED(CONFIG_NET_DEVLINK) struct devlink *devlink; -#endif struct nsim_ipsec ipsec; }; @@ -138,7 +136,6 @@ nsim_bpf_setup_tc_block_cb(enum tc_setup_type type, void *type_data, } #endif -#if IS_ENABLED(CONFIG_NET_DEVLINK) enum nsim_resource_id { NSIM_RESOURCE_NONE, /* DEVLINK_RESOURCE_ID_PARENT_TOP */ NSIM_RESOURCE_IPV4, @@ -160,25 +157,6 @@ void nsim_fib_exit(void); u64 nsim_fib_get_val(struct net *net, enum nsim_resource_id res_id, bool max); int nsim_fib_set_max(struct net *net, enum nsim_resource_id res_id, u64 val, struct netlink_ext_ack *extack); -#else -static inline int nsim_devlink_setup(struct netdevsim *ns) -{ - return 0; -} - -static inline void nsim_devlink_teardown(struct netdevsim *ns) -{ -} - -static inline int nsim_devlink_init(void) -{ - return 0; -} - -static inline void nsim_devlink_exit(void) -{ -} -#endif #if IS_ENABLED(CONFIG_XFRM_OFFLOAD) void nsim_ipsec_init(struct netdevsim *ns); |