]> git.proxmox.com Git - mirror_ovs.git/commitdiff
Revert "ofproto: Always set MTU for new internal ports."
authorDaniele Di Proietto <diproiettod@vmware.com>
Thu, 1 Sep 2016 22:49:51 +0000 (15:49 -0700)
committerDaniele Di Proietto <diproiettod@vmware.com>
Fri, 2 Sep 2016 23:01:11 +0000 (16:01 -0700)
This reverts commit 47bf118665a3d0f3c153d1fe80e9af02ac9a4e9c.
While the commit tries to make it more consistent, it breaks some system
tests.  The assumptions made on the tests are probably made by many
users, so it's better to revert it.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
ofproto/ofproto.c
tests/ofproto-dpif.at

index 9d62b72bbf4fca7437c7d10e4b4566f1e03130bc..da7372de041f985835082b65bbf7828f87f5f796 100644 (file)
@@ -281,8 +281,6 @@ static void meter_insert_rule(struct rule *);
 /* unixctl. */
 static void ofproto_unixctl_init(void);
 
-static int find_min_mtu(struct ofproto *p);
-
 /* All registered ofproto classes, in probe order. */
 static const struct ofproto_class **ofproto_classes;
 static size_t n_ofproto_classes;
@@ -516,7 +514,7 @@ ofproto_create(const char *datapath_name, const char *datapath_type,
     hmap_init(&ofproto->learned_cookies);
     ovs_list_init(&ofproto->expirable);
     ofproto->connmgr = connmgr_create(ofproto, datapath_name, datapath_name);
-    ofproto->min_mtu = find_min_mtu(ofproto);
+    ofproto->min_mtu = INT_MAX;
     cmap_init(&ofproto->groups);
     ovs_mutex_unlock(&ofproto_mutex);
     ofproto->ogf.types = 0xf;
@@ -2752,8 +2750,10 @@ update_mtu(struct ofproto *p, struct ofport *port)
         return;
     }
     if (ofport_is_internal(p, port)) {
-        if (!netdev_set_mtu(port->netdev, p->min_mtu)) {
-            dev_mtu = p->min_mtu;
+        if (dev_mtu > p->min_mtu) {
+           if (!netdev_set_mtu(port->netdev, p->min_mtu)) {
+               dev_mtu = p->min_mtu;
+           }
         }
         port->mtu = dev_mtu;
         return;
index 8e5fde6d73de7d739f1ed8a7474700e1d3a491fb..d7705da8767cf4202af6d949221bb6e85da93a7d 100644 (file)
@@ -8863,11 +8863,6 @@ AT_CLEANUP
 AT_SETUP([ofproto - set mtu])
 OVS_VSWITCHD_START
 
-# Check that initial MTU is 1500 for 'br0'.
-AT_CHECK([ovs-vsctl get Interface br0 mtu], [0], [dnl
-1500
-])
-
 add_of_ports br0 1
 
 # Check that initial MTU is 1500 for 'br0' and 'p1'.
@@ -8897,9 +8892,5 @@ AT_CHECK([ovs-vsctl add-port br0 p2 -- set int p2 type=dummy mtu_request=1600])
 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p2 mtu=1600])
 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
 
-# New internal port.  The MTU should be updated even for a newly added port.
-AT_CHECK([ovs-vsctl add-port br0 int1 -- set int int1 type=internal])
-AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface int1 mtu=1600])
-
 OVS_VSWITCHD_STOP
 AT_CLEANUP