|
@@ -98,7 +98,6 @@ struct vxlan_fdb {
|
|
|
|
|
|
/* salt for hash table */
|
|
/* salt for hash table */
|
|
static u32 vxlan_salt __read_mostly;
|
|
static u32 vxlan_salt __read_mostly;
|
|
-static struct workqueue_struct *vxlan_wq;
|
|
|
|
|
|
|
|
static inline bool vxlan_collect_metadata(struct vxlan_sock *vs)
|
|
static inline bool vxlan_collect_metadata(struct vxlan_sock *vs)
|
|
{
|
|
{
|
|
@@ -1053,7 +1052,9 @@ static void __vxlan_sock_release(struct vxlan_sock *vs)
|
|
vxlan_notify_del_rx_port(vs);
|
|
vxlan_notify_del_rx_port(vs);
|
|
spin_unlock(&vn->sock_lock);
|
|
spin_unlock(&vn->sock_lock);
|
|
|
|
|
|
- queue_work(vxlan_wq, &vs->del_work);
|
|
|
|
|
|
+ synchronize_net();
|
|
|
|
+ udp_tunnel_sock_release(vs->sock);
|
|
|
|
+ kfree(vs);
|
|
}
|
|
}
|
|
|
|
|
|
static void vxlan_sock_release(struct vxlan_dev *vxlan)
|
|
static void vxlan_sock_release(struct vxlan_dev *vxlan)
|
|
@@ -2674,13 +2675,6 @@ static const struct ethtool_ops vxlan_ethtool_ops = {
|
|
.get_link = ethtool_op_get_link,
|
|
.get_link = ethtool_op_get_link,
|
|
};
|
|
};
|
|
|
|
|
|
-static void vxlan_del_work(struct work_struct *work)
|
|
|
|
-{
|
|
|
|
- struct vxlan_sock *vs = container_of(work, struct vxlan_sock, del_work);
|
|
|
|
- udp_tunnel_sock_release(vs->sock);
|
|
|
|
- kfree_rcu(vs, rcu);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static struct socket *vxlan_create_sock(struct net *net, bool ipv6,
|
|
static struct socket *vxlan_create_sock(struct net *net, bool ipv6,
|
|
__be16 port, u32 flags)
|
|
__be16 port, u32 flags)
|
|
{
|
|
{
|
|
@@ -2726,8 +2720,6 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, bool ipv6,
|
|
for (h = 0; h < VNI_HASH_SIZE; ++h)
|
|
for (h = 0; h < VNI_HASH_SIZE; ++h)
|
|
INIT_HLIST_HEAD(&vs->vni_list[h]);
|
|
INIT_HLIST_HEAD(&vs->vni_list[h]);
|
|
|
|
|
|
- INIT_WORK(&vs->del_work, vxlan_del_work);
|
|
|
|
-
|
|
|
|
sock = vxlan_create_sock(net, ipv6, port, flags);
|
|
sock = vxlan_create_sock(net, ipv6, port, flags);
|
|
if (IS_ERR(sock)) {
|
|
if (IS_ERR(sock)) {
|
|
pr_info("Cannot bind port %d, err=%ld\n", ntohs(port),
|
|
pr_info("Cannot bind port %d, err=%ld\n", ntohs(port),
|
|
@@ -3346,10 +3338,6 @@ static int __init vxlan_init_module(void)
|
|
{
|
|
{
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
- vxlan_wq = alloc_workqueue("vxlan", 0, 0);
|
|
|
|
- if (!vxlan_wq)
|
|
|
|
- return -ENOMEM;
|
|
|
|
-
|
|
|
|
get_random_bytes(&vxlan_salt, sizeof(vxlan_salt));
|
|
get_random_bytes(&vxlan_salt, sizeof(vxlan_salt));
|
|
|
|
|
|
rc = register_pernet_subsys(&vxlan_net_ops);
|
|
rc = register_pernet_subsys(&vxlan_net_ops);
|
|
@@ -3370,7 +3358,6 @@ out3:
|
|
out2:
|
|
out2:
|
|
unregister_pernet_subsys(&vxlan_net_ops);
|
|
unregister_pernet_subsys(&vxlan_net_ops);
|
|
out1:
|
|
out1:
|
|
- destroy_workqueue(vxlan_wq);
|
|
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
late_initcall(vxlan_init_module);
|
|
late_initcall(vxlan_init_module);
|
|
@@ -3379,7 +3366,6 @@ static void __exit vxlan_cleanup_module(void)
|
|
{
|
|
{
|
|
rtnl_link_unregister(&vxlan_link_ops);
|
|
rtnl_link_unregister(&vxlan_link_ops);
|
|
unregister_netdevice_notifier(&vxlan_notifier_block);
|
|
unregister_netdevice_notifier(&vxlan_notifier_block);
|
|
- destroy_workqueue(vxlan_wq);
|
|
|
|
unregister_pernet_subsys(&vxlan_net_ops);
|
|
unregister_pernet_subsys(&vxlan_net_ops);
|
|
/* rcu_barrier() is called by netns */
|
|
/* rcu_barrier() is called by netns */
|
|
}
|
|
}
|