From nobody Mon May 06 22:27:51 2024 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 4VYGJ74lYRz5JTkS; Mon, 06 May 2024 22:27:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VYGJ73ynqz4QRg; Mon, 6 May 2024 22:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715034471; 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=04/nUVtZIKcGq67iI7yIqVdAj+zQDCVTppn/tMXSKr8=; b=mhs1H6kFEAJo1twsyqNMOb6APET+8tqzXuUWiMxPaVVgga3Eiwc5kSI4GxDUnuYqnUI8Ka JydxYiWi2TjnjgtWg7pBHLLkooDwWdPQRCKec3xkpqQX6TmPxnL+PLsH/tLq61hfhmm3e9 1u0lOl4fKUi1ZnIHlVekguKhyMxCBqns7xG9tKntcLBgoLQVwT0dQzG1pxhjfw9J7fDfMO FtO9h2/RBbeTERtQMGNM4+JoLJG3aQ5UlTwBBiuXW0x6KG4ImvA6WOgTcXTyMRmCCkSH4/ AAjQg1uoa23yPlzH0SlmzuR1kpbBGqkyIKWzIzVoSaDqXLKJr6ss/Zy8DQDkxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715034471; a=rsa-sha256; cv=none; b=fBuGl1M2XFX9kEXq1mVXsFljaN3y0gve909YamJiRQ6CE3gGNzpGikAa2amBByvUBdmHvE NtOeHqzt5OTQMaDDIS8FeCCLfiylW1euw2L18Kw2gnrTPc93Utwmuk0P2liVgXlMTDF4Ab n3Tt9hP/aIO+lIUcs4AOccob/36MmeB1ykkRZsqvEQ6bfQmYUMpMRflW7x6XrNnTsCuHYG XbAX10wollYMuaRgN05aiB19+RpFvtszWGQ97wqp1/1eYx42LJOKAduOassr/z/RuTU55B +uZUR9HEhbf53/96+WaEt+6eEybrmhEmzJX8K1nHLX0V/RB2jH3fTFdiOMY1RA== 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=1715034471; 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=04/nUVtZIKcGq67iI7yIqVdAj+zQDCVTppn/tMXSKr8=; b=mK49yT2GVgiEUbXWN9Bu1rFkWf8C+S2sRtZ/lBF5mRT/YwZ76v6WTCPwkOuUl2/8zQVAvO SdkqTZsMXxJ9YXfS4v53A9x6VvXnTOUvuZ73lUcK3PmQpL4kU/HFYZJFoVBfxd7/q7F/sV IUzft1Ge6BgaTvGMq8UMOk+3Mj7YdXRZvHLxWsrtEimU+ZrRL0spWlCIGH2KZ8/FqhWo21 eYQN7K5RGDxWXtbEIiNRY4rU92JJMovzpr5k6RA5zv6FqtykdAs2W3JjTuTLhuKH5I4fBy 0WW1K1yLpe4ocu8fi2L1b+/5MuMh4MHKg8F99Ec9YKqF9ZzGRmNrlUsA1OXqhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VYGJ73RrlzGG1; Mon, 6 May 2024 22:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 446MRpgk052314; Mon, 6 May 2024 22:27:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 446MRp8Z052311; Mon, 6 May 2024 22:27:51 GMT (envelope-from git) Date: Mon, 6 May 2024 22:27:51 GMT Message-Id: <202405062227.446MRp8Z052311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 570685971c6a - main - lagg: propagate up/down to the children 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 570685971c6ad30c75103453a38fdb2dff432bef Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=570685971c6ad30c75103453a38fdb2dff432bef commit 570685971c6ad30c75103453a38fdb2dff432bef Author: Gleb Smirnoff AuthorDate: 2024-05-06 22:25:53 +0000 Commit: Gleb Smirnoff CommitDate: 2024-05-06 22:27:32 +0000 lagg: propagate up/down to the children Based on the old submission from asomers@. With modern state of locking in lagg(4), the patch got much simplier. Enable the test that was waiting for this change. PR: 226144 Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D44605 --- sys/net/if_lagg.c | 24 ++++++++++++++++++++++++ tests/sys/net/if_lagg_test.sh | 1 - 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 554d8c2c1bcb..1f169ee32696 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -137,6 +137,7 @@ static void lagg_port_ifdetach(void *arg __unused, struct ifnet *); static int lagg_port_checkstacking(struct lagg_softc *); #endif static void lagg_port2req(struct lagg_port *, struct lagg_reqport *); +static void lagg_if_updown(struct lagg_softc *, bool); static void lagg_init(void *); static void lagg_stop(struct lagg_softc *); static int lagg_ioctl(struct ifnet *, u_long, caddr_t); @@ -1265,6 +1266,25 @@ lagg_watchdog_infiniband(void *arg) callout_reset(&sc->sc_watchdog, hz, &lagg_watchdog_infiniband, arg); } +static void +lagg_if_updown(struct lagg_softc *sc, bool up) +{ + struct ifreq ifr = {}; + struct lagg_port *lp; + + LAGG_XLOCK_ASSERT(sc); + + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (up) + if_up(lp->lp_ifp); + else + if_down(lp->lp_ifp); + + if (lp->lp_ioctl != NULL) + lp->lp_ioctl(lp->lp_ifp, SIOCSIFFLAGS, (caddr_t)&ifr); + } +} + static void lagg_init(void *xsc) { @@ -1291,6 +1311,8 @@ lagg_init(void *xsc) if_setlladdr(lp->lp_ifp, IF_LLADDR(ifp), ifp->if_addrlen); } + lagg_if_updown(sc, true); + lagg_proto_init(sc); if (ifp->if_type == IFT_INFINIBAND) { @@ -1320,6 +1342,8 @@ lagg_stop(struct lagg_softc *sc) callout_stop(&sc->sc_watchdog); mtx_unlock(&sc->sc_mtx); + lagg_if_updown(sc, false); + callout_drain(&sc->sc_watchdog); } diff --git a/tests/sys/net/if_lagg_test.sh b/tests/sys/net/if_lagg_test.sh index 6b99aaedfbbf..1e07d4db294d 100755 --- a/tests/sys/net/if_lagg_test.sh +++ b/tests/sys/net/if_lagg_test.sh @@ -358,7 +358,6 @@ updown_body() { local TAP0 TAP1 LAGG MAC - atf_expect_fail "PR 226144 Upping a lagg interrface should automatically up its children" # Configure the lagg interface to use an RFC5737 nonrouteable addresses ADDR="192.0.2.2" MASK="24"