/* 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;
hmap_init(&ofproto->learned_cookies);
ovs_list_init(&ofproto->expirable);
ofproto->connmgr = connmgr_create(ofproto, datapath_name, datapath_name);
- ofproto->min_mtu = INT_MAX;
+ ofproto->min_mtu = find_min_mtu(ofproto);
cmap_init(&ofproto->groups);
ovs_mutex_unlock(&ofproto_mutex);
ofproto->ogf.types = 0xf;
return;
}
if (ofport_is_internal(p, port)) {
- if (dev_mtu > p->min_mtu) {
- if (!netdev_set_mtu(port->netdev, p->min_mtu)) {
- dev_mtu = p->min_mtu;
- }
+ if (!netdev_set_mtu(port->netdev, p->min_mtu)) {
+ dev_mtu = p->min_mtu;
}
port->mtu = dev_mtu;
return;
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'.
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