vswitchd: Skip updelay on slave when only a single bond slave is up.
authorBen Pfaff <blp@nicira.com>
Mon, 13 Jul 2009 18:09:52 +0000 (11:09 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 15 Jul 2009 00:04:40 +0000 (17:04 -0700)
If a network device takes a few seconds to detect carrier, as some do, then
when bringing up a network device and then immediately adding that device
to a bridge, the bond code would start out with that slave considered down
and apply the full updelay to it before bringing it up.  With the 31-second
updelay set by XenServer, this is excessive: we end up having no
connectivity at all for 31 seconds even though there is no reason for it.

This commit makes the bond code disregard the updelay when an interface
comes up on a bond that has no enabled interfaces, and updates the
documentation to match.

Part of bug #1566.

vswitchd/bridge.c
vswitchd/ovs-vswitchd.conf.5.in

index d2c83b8..224a3e5 100644 (file)
@@ -1341,6 +1341,10 @@ bond_link_status_update(struct iface *iface, bool carrier)
         iface->delay_expires = LLONG_MAX;
         VLOG_INFO_RL(&rl, "interface %s: will not be %s",
                      iface->name, carrier ? "disabled" : "enabled");
+    } else if (carrier && port->updelay && port->active_iface < 0) {
+        iface->delay_expires = time_msec();
+        VLOG_INFO_RL(&rl, "interface %s: skipping %d ms updelay since no "
+                     "other interface is up", iface->name, port->updelay);
     } else {
         int delay = carrier ? port->updelay : port->downdelay;
         iface->delay_expires = time_msec() + delay;
index 81e007f..d0e2474 100644 (file)
@@ -167,6 +167,10 @@ enabling or disabling an interface, set the value of
 \fBbonding.\fIname\fB.updelay\fR or
 \fBbonding.\fIname\fB.downdelay\fR, respectively, to a positive
 integer, interpreted in milliseconds.
+The \fBupdelay\fR setting is honored only when at least one bonded
+interface is already enabled.  When no interfaces are enabled, then
+the first bond interface to come up is enabled immediately.  The
+\fBdowndelay\fR setting is always honored.
 .PP
 The following syntax bonds \fBeth0\fR and \fBeth1\fR into a bonding
 device named \fBbond0\fR, which is added to bridge \fBmybr\fR along