Commit 070f2d7e authored by Kirill Tkhai's avatar Kirill Tkhai Committed by David S. Miller

net: Drop NETDEV_UNREGISTER_FINAL

Last user is gone after bdf5bd7f "rds: tcp: remove
register_netdevice_notifier infrastructure.", so we can
remove this netdevice command. This allows to delete
rtnl_lock() in netdev_run_todo(), which is hot path for
net namespace unregistration.

dev_change_net_namespace() and netdev_wait_allrefs()
have rcu_barrier() before NETDEV_UNREGISTER_FINAL call,
and the source commits say they were introduced to
delemit the call with NETDEV_UNREGISTER, but this patch
leaves them on the places, since they require additional
analysis, whether we need in them for something else.
Signed-off-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3e0c2dbf
...@@ -90,8 +90,8 @@ static struct net_device *qedr_get_netdev(struct ib_device *dev, u8 port_num) ...@@ -90,8 +90,8 @@ static struct net_device *qedr_get_netdev(struct ib_device *dev, u8 port_num)
dev_hold(qdev->ndev); dev_hold(qdev->ndev);
/* The HW vendor's device driver must guarantee /* The HW vendor's device driver must guarantee
* that this function returns NULL before the net device reaches * that this function returns NULL before the net device has finished
* NETDEV_UNREGISTER_FINAL state. * NETDEV_UNREGISTER state.
*/ */
return qdev->ndev; return qdev->ndev;
} }
......
...@@ -2336,7 +2336,6 @@ enum netdev_cmd { ...@@ -2336,7 +2336,6 @@ enum netdev_cmd {
NETDEV_PRE_TYPE_CHANGE, NETDEV_PRE_TYPE_CHANGE,
NETDEV_POST_TYPE_CHANGE, NETDEV_POST_TYPE_CHANGE,
NETDEV_POST_INIT, NETDEV_POST_INIT,
NETDEV_UNREGISTER_FINAL,
NETDEV_RELEASE, NETDEV_RELEASE,
NETDEV_NOTIFY_PEERS, NETDEV_NOTIFY_PEERS,
NETDEV_JOIN, NETDEV_JOIN,
......
...@@ -2122,8 +2122,8 @@ struct ib_device { ...@@ -2122,8 +2122,8 @@ struct ib_device {
* net device of device @device at port @port_num or NULL if such * net device of device @device at port @port_num or NULL if such
* a net device doesn't exist. The vendor driver should call dev_hold * a net device doesn't exist. The vendor driver should call dev_hold
* on this net device. The HW vendor's device driver must guarantee * on this net device. The HW vendor's device driver must guarantee
* that this function returns NULL before the net device reaches * that this function returns NULL before the net device has finished
* NETDEV_UNREGISTER_FINAL state. * NETDEV_UNREGISTER state.
*/ */
struct net_device *(*get_netdev)(struct ib_device *device, struct net_device *(*get_netdev)(struct ib_device *device,
u8 port_num); u8 port_num);
......
...@@ -1584,7 +1584,6 @@ const char *netdev_cmd_to_name(enum netdev_cmd cmd) ...@@ -1584,7 +1584,6 @@ const char *netdev_cmd_to_name(enum netdev_cmd cmd)
N(RESEND_IGMP) N(PRECHANGEMTU) N(CHANGEINFODATA) N(BONDING_INFO) N(RESEND_IGMP) N(PRECHANGEMTU) N(CHANGEINFODATA) N(BONDING_INFO)
N(PRECHANGEUPPER) N(CHANGELOWERSTATE) N(UDP_TUNNEL_PUSH_INFO) N(PRECHANGEUPPER) N(CHANGELOWERSTATE) N(UDP_TUNNEL_PUSH_INFO)
N(UDP_TUNNEL_DROP_INFO) N(CHANGE_TX_QUEUE_LEN) N(UDP_TUNNEL_DROP_INFO) N(CHANGE_TX_QUEUE_LEN)
N(UNREGISTER_FINAL)
}; };
#undef N #undef N
return "UNKNOWN_NETDEV_EVENT"; return "UNKNOWN_NETDEV_EVENT";
...@@ -8097,7 +8096,6 @@ static void netdev_wait_allrefs(struct net_device *dev) ...@@ -8097,7 +8096,6 @@ static void netdev_wait_allrefs(struct net_device *dev)
rcu_barrier(); rcu_barrier();
rtnl_lock(); rtnl_lock();
call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev);
if (test_bit(__LINK_STATE_LINKWATCH_PENDING, if (test_bit(__LINK_STATE_LINKWATCH_PENDING,
&dev->state)) { &dev->state)) {
/* We must not have linkwatch events /* We must not have linkwatch events
...@@ -8169,10 +8167,6 @@ void netdev_run_todo(void) ...@@ -8169,10 +8167,6 @@ void netdev_run_todo(void)
= list_first_entry(&list, struct net_device, todo_list); = list_first_entry(&list, struct net_device, todo_list);
list_del(&dev->todo_list); list_del(&dev->todo_list);
rtnl_lock();
call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev);
__rtnl_unlock();
if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) { if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) {
pr_err("network todo '%s' but state %d\n", pr_err("network todo '%s' but state %d\n",
dev->name, dev->reg_state); dev->name, dev->reg_state);
...@@ -8614,7 +8608,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char ...@@ -8614,7 +8608,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
*/ */
call_netdevice_notifiers(NETDEV_UNREGISTER, dev); call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
rcu_barrier(); rcu_barrier();
call_netdevice_notifiers(NETDEV_UNREGISTER_FINAL, dev);
new_nsid = peernet2id_alloc(dev_net(dev), net); new_nsid = peernet2id_alloc(dev_net(dev), net);
/* If there is an ifindex conflict assign a new one */ /* If there is an ifindex conflict assign a new one */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment