summaryrefslogtreecommitdiff
path: root/net/openvswitch/vport-internal_dev.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-04-17 13:30:32 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-17 13:30:32 -0400
commit92cf1f23cc9390ea5c00e8185c1f7910c3d15452 (patch)
tree5efa469a504fa66d2127aeaf607b47b919e298b5 /net/openvswitch/vport-internal_dev.c
parent98d2f0e68c4de36c56fbe3baeae30c001f012243 (diff)
parente0f0ecf33c3f13401f90bff5afdc3ed1bb40b9af (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
Jesse Gross says: ==================== A number of improvements for net-next/3.10. Highlights include: * Properly exposing linux/openvswitch.h to userspace after the uapi changes. * Simplification of locking. It immediately makes things simpler to reason about and avoids holding RTNL mutex for longer than necessary. In the near future it will also enable tunnel registration and more fine-grained locking. * Miscellaneous cleanups and simplifications. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/vport-internal_dev.c')
-rw-r--r--net/openvswitch/vport-internal_dev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 40f8a2489c90..9604760494b1 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -173,16 +173,19 @@ static struct vport *internal_dev_create(const struct vport_parms *parms)
if (vport->port_no == OVSP_LOCAL)
netdev_vport->dev->features |= NETIF_F_NETNS_LOCAL;
+ rtnl_lock();
err = register_netdevice(netdev_vport->dev);
if (err)
goto error_free_netdev;
dev_set_promiscuity(netdev_vport->dev, 1);
+ rtnl_unlock();
netif_start_queue(netdev_vport->dev);
return vport;
error_free_netdev:
+ rtnl_unlock();
free_netdev(netdev_vport->dev);
error_free_vport:
ovs_vport_free(vport);
@@ -195,10 +198,13 @@ static void internal_dev_destroy(struct vport *vport)
struct netdev_vport *netdev_vport = netdev_vport_priv(vport);
netif_stop_queue(netdev_vport->dev);
+ rtnl_lock();
dev_set_promiscuity(netdev_vport->dev, -1);
/* unregister_netdevice() waits for an RCU grace period. */
unregister_netdevice(netdev_vport->dev);
+
+ rtnl_unlock();
}
static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)