From: Ben Pfaff Date: Mon, 13 Jul 2009 18:09:52 +0000 (-0700) Subject: vswitchd: Skip updelay on slave when only a single bond slave is up. X-Git-Tag: v0.90.3~3^2~12 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=25ce84b23bb6316d0471e155c764bc617797d728;p=sliver-openvswitch.git vswitchd: Skip updelay on slave when only a single bond slave is up. 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. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index d2c83b884..224a3e5f7 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -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; diff --git a/vswitchd/ovs-vswitchd.conf.5.in b/vswitchd/ovs-vswitchd.conf.5.in index 81e007fbb..d0e24741f 100644 --- a/vswitchd/ovs-vswitchd.conf.5.in +++ b/vswitchd/ovs-vswitchd.conf.5.in @@ -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