gre: Net namespace identifiers are read_mostly.
[openvswitch] / datapath / dp_notify.c
index f22d8b342f1b1b3d88d19132a2ad88d83feaec56..0278988d69a08bbc4e753e28d0ad26c05880ce92 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/netdevice.h>
 
 #include "datapath.h"
-
+#include "dp_dev.h"
 
 static int dp_device_event(struct notifier_block *unused, unsigned long event, 
                void *ptr) 
@@ -20,7 +20,12 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
        struct net_bridge_port *p;
        struct datapath *dp;
 
-       p = dev->br_port;
+       if (is_dp_dev(dev)) {
+               struct dp_dev *dp_dev = dp_dev_priv(dev);
+               p = dp_dev->dp->ports[dp_dev->port_no];
+       } else {
+               p = dev->br_port;
+       }
        if (!p)
                return NOTIFY_DONE;
        dp = p->dp;
@@ -40,6 +45,14 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
                        mutex_unlock(&dp->mutex);
                }
                break;
+
+       case NETDEV_CHANGEMTU:
+               if (!is_dp_dev(dev)) {
+                       mutex_lock(&dp->mutex);
+                       set_dp_devs_mtu(dp, dev);
+                       mutex_unlock(&dp->mutex);
+               }
+               break;
        }
        return NOTIFY_DONE;
 }