lagg: allow lacp to manage the link state

Lacp needs to manage the link state itself. Unlike other
lagg protocols, the ability of lacp to pass traffic
depends not only on the lagg members having link, but also
on the lacp protocol converging to a distributing state with the
link partner.

If we prematurely mark the link as up, then we will send a
gratuitous arp (via arp_handle_ifllchange()) before the lacp
interface is capable of passing traffic. When this happens,
the gratuitous arp is lost, and our link partner may cache
a stale mac address (eg, when the base mac address for the
lagg bundle changes, due to a BIOS change re-ordering NIC
unit numbers)

Reviewed by: jtl, hselasky
Sponsored by: Netflix
This commit is contained in:
Andrew Gallatin 2018-08-13 14:13:25 +00:00
parent 839d21d62e
commit 5ccac9f972
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337709
2 changed files with 9 additions and 0 deletions

View File

@ -711,6 +711,8 @@ lacp_disable_distributing(struct lacp_port *lp)
}
lp->lp_state &= ~LACP_STATE_DISTRIBUTING;
if_link_state_change(sc->sc_ifp,
sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN);
}
static void
@ -745,6 +747,9 @@ lacp_enable_distributing(struct lacp_port *lp)
} else
/* try to become the active aggregator */
lacp_select_active_aggregator(lsc);
if_link_state_change(sc->sc_ifp,
sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN);
}
static void

View File

@ -1737,6 +1737,10 @@ lagg_linkstate(struct lagg_softc *sc)
LAGG_XLOCK_ASSERT(sc);
/* LACP handles link state itself */
if (sc->sc_proto == LAGG_PROTO_LACP)
return;
/* Our link is considered up if at least one of our ports is active */
LAGG_RLOCK();
CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {