aboutsummaryrefslogtreecommitdiff
path: root/datapath/dp_notify.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-12-03 15:44:51 -0800
committerBen Pfaff <blp@nicira.com>2010-12-03 15:44:51 -0800
commit7237e4f4b6155eb4854cebc0a45fe845f0950b40 (patch)
tree5849bcaff29e40abd33aa0653b543338137dcdf7 /datapath/dp_notify.c
parente779d8d90d65297473febcf82ec44c9225cc4fe3 (diff)
datapath: Merge vport "attach" into "create" and "detach" into "destroy".
These steps are sequentially in lockstep, so we might as well combine them. This expands the region over which the vport_lock is held. I didn't carefully verify that this was OK. This also eliminates the synchronize_rcu() call from destruction of tunnel vports, since they didn't appear to me to need it. It should be possible to eliminate the synchronize_rcu() from the netdev, patch, and internal_dev vports, but this commit does not do that. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath/dp_notify.c')
-rw-r--r--datapath/dp_notify.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/datapath/dp_notify.c b/datapath/dp_notify.c
index e7d08bc3..1415833f 100644
--- a/datapath/dp_notify.c
+++ b/datapath/dp_notify.c
@@ -33,9 +33,11 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
switch (event) {
case NETDEV_UNREGISTER:
- mutex_lock(&dp->mutex);
- dp_detach_port(vport);
- mutex_unlock(&dp->mutex);
+ if (!is_internal_dev(dev)) {
+ mutex_lock(&dp->mutex);
+ dp_detach_port(vport);
+ mutex_unlock(&dp->mutex);
+ }
break;
case NETDEV_CHANGENAME: