Skip to content

Commit

Permalink
lacp: Select a may-enable IF as the lead IF
Browse files Browse the repository at this point in the history
A reboot of one switch in an MC-LAG bond makes all bond links
to go down, causing a total connectivity loss for 3 seconds.

Packet capture shows that spurious LACP PDUs are sent to OVS with
a different MAC address (partner system id) during the final
stages of the MC-LAG switch reboot.

The current code selects a lead interface based on information
in the LACP PDU, regardless of its synchronization state. If a
non-synchronized interface is selected as the OVS lead interface
then all other interfaces are forced down as their stored partner
system id differs and the bond ends up with no working interface.
The bond recovers within three seconds after the last spurious
message.

To avoid the problem, this commit requires a lead interface
to be synchronized. In case no synchronized interface exists,
the selection of lead interface is done as in the current code.

Signed-off-by: Torgny Lindberg <torgny.lindberg@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
blp committed Dec 23, 2016
1 parent ddcfd8e commit 336a558
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -127,6 +127,7 @@ Thomas Graf tgraf@redhat.com
Thomas Lacroix thomas.lacroix@citrix.com
Todd Deshane deshantm@gmail.com
Tom Everman teverman@google.com
Torgny Lindberg torgny.lindberg@ericsson.com
Tsvi Slonim tsvi@toroki.com
Tyler Coumbes coumbes@gmail.com
Valient Gough vgough@pobox.com
Expand Down
9 changes: 8 additions & 1 deletion lib/lacp.c
Expand Up @@ -588,11 +588,13 @@ lacp_update_attached(struct lacp *lacp) OVS_REQUIRES(mutex)
{
struct slave *lead, *slave;
struct lacp_info lead_pri;
bool lead_enable;
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 10);

lacp->update = false;

lead = NULL;
lead_enable = false;
HMAP_FOR_EACH (slave, node, &lacp->slaves) {
struct lacp_info pri;

Expand All @@ -615,9 +617,14 @@ lacp_update_attached(struct lacp *lacp) OVS_REQUIRES(mutex)

slave->attached = true;
slave_get_priority(slave, &pri);
bool enable = slave_may_enable__(slave);

if (!lead || memcmp(&pri, &lead_pri, sizeof pri) < 0) {
if (!lead
|| enable > lead_enable
|| (enable == lead_enable
&& memcmp(&pri, &lead_pri, sizeof pri) < 0)) {
lead = slave;
lead_enable = enable;
lead_pri = pri;
}
}
Expand Down

0 comments on commit 336a558

Please sign in to comment.