From nobody Tue May 12 13:02:00 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gFGvY138pz6dd6x for ; Tue, 12 May 2026 13:02:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gFGvX5qW0z4DkF for ; Tue, 12 May 2026 13:02:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778590920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bs/zBvMaG/oAvERUrUZolhqYPLqheCL4h5whELKB12s=; b=YuLE1PgETUH3/NrHck+wVJCLS50nIBfDqjrsOEPYQnMejPrUG9e0d1U5pINkwNQq55Uj1y zs9qXRD7wTaDzeum2y3Yq8KohYepV5prkkhrtAjE+GyxGPSTXegWgWSqLURT5R/FOPhXYh Bn3rYxpZxhR9ghCZlKdF+IkactdtTklYheK/hNVhpD6MhbJYzAtppqkJa5dZKff59omeH/ lwpucMafmNxZoY+z10/tTTU4tOJXWRGLiR3tgFtFQfpUBY8zjaCCvqDHlA2FtgZEYsFq2h p7hku27nW2Oi7btP/33BITu9yu/ZkpsGUuoYS8gUpepWGbO7a/920zmLkODFdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778590920; a=rsa-sha256; cv=none; b=gva5lDWo2/jucfIJIY/zziWOHHkijImM/SfwLOPnClre3xpSlIvIRJxn0lu8x4c3+p8cmJ S4UTtlWiuWC6vFqy70qiAG4eJPH05pijbpMWu5tytUBCnaHDxVn3VbpPTeaimFYzLfaNyO IOuZfkrGOCDSRM1jGf6cpsP1U83SyPEPUOUrKJSob/1JmOzGK2u1uxM+ORB5mU7lyAPSvB rUGjV4C4z45hDKPjRFMpQ93X4DXophNt4x1qTvOZumJTBOv3YTHEi/gqWBdE3gAFLzKrCZ 8GXYlGbR/Jk6nYaxU2gcItFA2n9gvjvYDJwWhb2OBiJAGfAYolmVREc02M/2PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778590920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bs/zBvMaG/oAvERUrUZolhqYPLqheCL4h5whELKB12s=; b=SxRCJatbZ5nJYpKhnlh+Vd817E5y/WJB03M4fhAEJRGImu7CNLHJsefyUYK9Ig7BPmjXdo rfQ2LySQDf36GP6FdUj2oKWbtoJQQ5sz1Nh2R19eRLj7hEyxc43r9TymY9oEgPvzS5lGxL II6gO2BO8n/o6SEfsiq5xJaWg2VFGuCRqw/07h+seEagRcD97MHZfcMOcPX9zGGWC2MM/X 55Nd8BngxVhJQhnShh8ayGoNeyoQdepUjnW4TtmyRWIjWX0elImi/5u+60zlJ0QdlglhGU XIYHDNeTD69ldXyFzYMX4ZnIfrgo+UV7ucrKypILhHJMwFaoecEJ1vC6Pjcmuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gFGvX5L1qz13dx for ; Tue, 12 May 2026 13:02:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1de2a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 12 May 2026 13:02:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 9f69446d4548 - main - lacp: fix link state with multiple aggregators List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f69446d45484c16d2b9b9bf71bbb2fca86cb6e5 Auto-Submitted: auto-generated Date: Tue, 12 May 2026 13:02:00 +0000 Message-Id: <6a0324c8.1de2a.5c820de6@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=9f69446d45484c16d2b9b9bf71bbb2fca86cb6e5 commit 9f69446d45484c16d2b9b9bf71bbb2fca86cb6e5 Author: Andrew Gallatin AuthorDate: 2026-05-12 12:52:24 +0000 Commit: Andrew Gallatin CommitDate: 2026-05-12 12:52:24 +0000 lacp: fix link state with multiple aggregators When we have multiple aggregators, the link state should reflect the state of the active aggregator. This change was prompted by a script pruning 10GbE interfaces from an lacp bundle with 100GbE interfaces. Mixing speeds like this creates multiple aggregators. When the last 10GbE interface was removed, lagg0 would loose link because the current aggregator's port count would drop to 0, even though the 100GbE aggregator had active ports. This left the system in a hard to diagnose state where lagg0 reported "active", but all outgoing IP traffic was dropped, due to the RT_LINK_IS_UP() check noticing lagg0's if_link_state was marked as down. Reviewed by: zlei Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D56579 --- sys/net/ieee8023ad_lacp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index 281d16bc6c05..8c695f71cc0f 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -682,6 +682,7 @@ static void lacp_disable_distributing(struct lacp_port *lp) { struct lacp_aggregator *la = lp->lp_aggregator; + struct lacp_aggregator *la_active; struct lacp_softc *lsc = lp->lp_lsc; struct lagg_softc *sc = lsc->lsc_softc; char buf[LACP_LAGIDSTR_MAX+1]; @@ -703,7 +704,6 @@ lacp_disable_distributing(struct lacp_port *lp) TAILQ_REMOVE(&la->la_ports, lp, lp_dist_q); la->la_nports--; - sc->sc_active = la->la_nports; if (lsc->lsc_active_aggregator == la) { lacp_suppress_distributing(lsc, la); @@ -713,6 +713,8 @@ lacp_disable_distributing(struct lacp_port *lp) } lp->lp_state &= ~LACP_STATE_DISTRIBUTING; + la_active = lsc->lsc_active_aggregator; + sc->sc_active = la_active != NULL ? la_active->la_nports : 0; if_link_state_change(sc->sc_ifp, sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN); } @@ -721,6 +723,7 @@ static void lacp_enable_distributing(struct lacp_port *lp) { struct lacp_aggregator *la = lp->lp_aggregator; + struct lacp_aggregator *la_active; struct lacp_softc *lsc = lp->lp_lsc; struct lagg_softc *sc = lsc->lsc_softc; char buf[LACP_LAGIDSTR_MAX+1]; @@ -739,7 +742,6 @@ lacp_enable_distributing(struct lacp_port *lp) KASSERT(la->la_refcnt > la->la_nports, ("aggregator refcnt invalid")); TAILQ_INSERT_HEAD(&la->la_ports, lp, lp_dist_q); la->la_nports++; - sc->sc_active = la->la_nports; lp->lp_state |= LACP_STATE_DISTRIBUTING; @@ -750,6 +752,8 @@ lacp_enable_distributing(struct lacp_port *lp) /* try to become the active aggregator */ lacp_select_active_aggregator(lsc); + la_active = lsc->lsc_active_aggregator; + sc->sc_active = la_active != NULL ? la_active->la_nports : 0; if_link_state_change(sc->sc_ifp, sc->sc_active ? LINK_STATE_UP : LINK_STATE_DOWN); }