svn commit: r337709 - head/sys/net
Andrew Gallatin
gallatin at FreeBSD.org
Mon Aug 13 14:13:26 UTC 2018
Author: gallatin
Date: Mon Aug 13 14:13:25 2018
New Revision: 337709
URL: https://svnweb.freebsd.org/changeset/base/337709
Log:
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
Modified:
head/sys/net/ieee8023ad_lacp.c
head/sys/net/if_lagg.c
Modified: head/sys/net/ieee8023ad_lacp.c
==============================================================================
--- head/sys/net/ieee8023ad_lacp.c Mon Aug 13 13:58:45 2018 (r337708)
+++ head/sys/net/ieee8023ad_lacp.c Mon Aug 13 14:13:25 2018 (r337709)
@@ -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
Modified: head/sys/net/if_lagg.c
==============================================================================
--- head/sys/net/if_lagg.c Mon Aug 13 13:58:45 2018 (r337708)
+++ head/sys/net/if_lagg.c Mon Aug 13 14:13:25 2018 (r337709)
@@ -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) {
More information about the svn-src-head
mailing list