diff options
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r-- | net/openvswitch/datapath.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index e6d7255183eb..aecddb9bb80a 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #include "vport-netdev.h" | 59 | #include "vport-netdev.h" |
60 | 60 | ||
61 | int ovs_net_id __read_mostly; | 61 | int ovs_net_id __read_mostly; |
62 | EXPORT_SYMBOL(ovs_net_id); | ||
62 | 63 | ||
63 | static struct genl_family dp_packet_genl_family; | 64 | static struct genl_family dp_packet_genl_family; |
64 | static struct genl_family dp_flow_genl_family; | 65 | static struct genl_family dp_flow_genl_family; |
@@ -1764,6 +1765,7 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1764 | return -ENOMEM; | 1765 | return -ENOMEM; |
1765 | 1766 | ||
1766 | ovs_lock(); | 1767 | ovs_lock(); |
1768 | restart: | ||
1767 | dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); | 1769 | dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); |
1768 | err = -ENODEV; | 1770 | err = -ENODEV; |
1769 | if (!dp) | 1771 | if (!dp) |
@@ -1795,8 +1797,11 @@ static int ovs_vport_cmd_new(struct sk_buff *skb, struct genl_info *info) | |||
1795 | 1797 | ||
1796 | vport = new_vport(&parms); | 1798 | vport = new_vport(&parms); |
1797 | err = PTR_ERR(vport); | 1799 | err = PTR_ERR(vport); |
1798 | if (IS_ERR(vport)) | 1800 | if (IS_ERR(vport)) { |
1801 | if (err == -EAGAIN) | ||
1802 | goto restart; | ||
1799 | goto exit_unlock_free; | 1803 | goto exit_unlock_free; |
1804 | } | ||
1800 | 1805 | ||
1801 | err = ovs_vport_cmd_fill_info(vport, reply, info->snd_portid, | 1806 | err = ovs_vport_cmd_fill_info(vport, reply, info->snd_portid, |
1802 | info->snd_seq, 0, OVS_VPORT_CMD_NEW); | 1807 | info->snd_seq, 0, OVS_VPORT_CMD_NEW); |
@@ -2112,12 +2117,18 @@ static int __init dp_init(void) | |||
2112 | if (err) | 2117 | if (err) |
2113 | goto error_netns_exit; | 2118 | goto error_netns_exit; |
2114 | 2119 | ||
2120 | err = ovs_netdev_init(); | ||
2121 | if (err) | ||
2122 | goto error_unreg_notifier; | ||
2123 | |||
2115 | err = dp_register_genl(); | 2124 | err = dp_register_genl(); |
2116 | if (err < 0) | 2125 | if (err < 0) |
2117 | goto error_unreg_notifier; | 2126 | goto error_unreg_netdev; |
2118 | 2127 | ||
2119 | return 0; | 2128 | return 0; |
2120 | 2129 | ||
2130 | error_unreg_netdev: | ||
2131 | ovs_netdev_exit(); | ||
2121 | error_unreg_notifier: | 2132 | error_unreg_notifier: |
2122 | unregister_netdevice_notifier(&ovs_dp_device_notifier); | 2133 | unregister_netdevice_notifier(&ovs_dp_device_notifier); |
2123 | error_netns_exit: | 2134 | error_netns_exit: |
@@ -2137,6 +2148,7 @@ error: | |||
2137 | static void dp_cleanup(void) | 2148 | static void dp_cleanup(void) |
2138 | { | 2149 | { |
2139 | dp_unregister_genl(ARRAY_SIZE(dp_genl_families)); | 2150 | dp_unregister_genl(ARRAY_SIZE(dp_genl_families)); |
2151 | ovs_netdev_exit(); | ||
2140 | unregister_netdevice_notifier(&ovs_dp_device_notifier); | 2152 | unregister_netdevice_notifier(&ovs_dp_device_notifier); |
2141 | unregister_pernet_device(&ovs_net_ops); | 2153 | unregister_pernet_device(&ovs_net_ops); |
2142 | rcu_barrier(); | 2154 | rcu_barrier(); |