projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
xenserver: Gracefully refresh network UUIDs on pool join or leave.
[openvswitch]
/
datapath
/
dp_notify.c
diff --git
a/datapath/dp_notify.c
b/datapath/dp_notify.c
index f22d8b342f1b1b3d88d19132a2ad88d83feaec56..4a16a93fdc5356d24620b94690b8476a16b03774 100644
(file)
--- a/
datapath/dp_notify.c
+++ b/
datapath/dp_notify.c
@@
-1,6
+1,6
@@
/*
* Distributed under the terms of the GNU GPL version 2.
/*
* Distributed under the terms of the GNU GPL version 2.
- * Copyright (c) 2007, 2008, 2009 Nicira Networks.
+ * Copyright (c) 2007, 2008, 2009
, 2010
Nicira Networks.
*
* Significant portions of this file may be copied from parts of the Linux
* kernel, by Linus Torvalds and others.
*
* Significant portions of this file may be copied from parts of the Linux
* kernel, by Linus Torvalds and others.
@@
-11,16
+11,28
@@
#include <linux/netdevice.h>
#include "datapath.h"
#include <linux/netdevice.h>
#include "datapath.h"
-
+#include "vport-internal_dev.h"
+#include "vport-netdev.h"
static int dp_device_event(struct notifier_block *unused, unsigned long event,
void *ptr)
{
struct net_device *dev = ptr;
static int dp_device_event(struct notifier_block *unused, unsigned long event,
void *ptr)
{
struct net_device *dev = ptr;
- struct net_bridge_port *p;
+ struct vport *vport;
+ struct dp_port *p;
struct datapath *dp;
struct datapath *dp;
- p = dev->br_port;
+ if (is_internal_dev(dev))
+ vport = internal_dev_get_vport(dev);
+ else {
+ vport = netdev_get_vport(dev);
+
+ if (!vport)
+ return NOTIFY_DONE;
+ }
+
+ p = vport_get_dp_port(vport);
+
if (!p)
return NOTIFY_DONE;
dp = p->dp;
if (!p)
return NOTIFY_DONE;
dp = p->dp;
@@
-28,7
+40,7
@@
static int dp_device_event(struct notifier_block *unused, unsigned long event,
switch (event) {
case NETDEV_UNREGISTER:
mutex_lock(&dp->mutex);
switch (event) {
case NETDEV_UNREGISTER:
mutex_lock(&dp->mutex);
- dp_de
l_port(p
);
+ dp_de
tach_port(p, 1
);
mutex_unlock(&dp->mutex);
break;
mutex_unlock(&dp->mutex);
break;
@@
-40,6
+52,14
@@
static int dp_device_event(struct notifier_block *unused, unsigned long event,
mutex_unlock(&dp->mutex);
}
break;
mutex_unlock(&dp->mutex);
}
break;
+
+ case NETDEV_CHANGEMTU:
+ if (!is_internal_dev(dev)) {
+ mutex_lock(&dp->mutex);
+ set_internal_devs_mtu(dp);
+ mutex_unlock(&dp->mutex);
+ }
+ break;
}
return NOTIFY_DONE;
}
}
return NOTIFY_DONE;
}