From nobody Thu Oct 29 05:01:42 2026 X-Original-To: dev-commits-src-branches@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 4jFXBt14CHz6xmkS for ; Thu, 29 Oct 2026 05:01:42 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFXBt0RXgz4fxx for ; Thu, 29 Oct 2026 05:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793250102; 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=A9tnHidpcPT9oBCB0TW6RqLz1n4QcK3xajVvIxi40m4=; b=w05MPQ5aMS5lsBf7NRSmrgTl+bprIigTHHC39DSfe+Ewqz+i1PN8XTUGe5Y2sCrx33M31Z U+rrMSntC2nfjWuuVzL5Xq92qyoiLWQYbOdoKVi1GuXmN6eQGgZpJp3BK0WtnQ/0KuKsfw TO93XZ4ZeMoSoBCT5Eq/+6M342VNmdAhkXD+GWHzNcrJHA+m89D6A8KjGrpnpAREBkia1h S63tWCxLRwVYEOroXp5P0Ml6aK06JStU+eu4XQXde3zp6tS2w5yjIa4dH9O74XWukcawXu hfZHKXBSZGnkCFwVqtrZyC/beeM3ehEYzj3ZS88i987lIX3NdSgvWrTE9ScnEg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793250102; b=JWxnctGG/mYjPc8s945/W5LGsvEG0+xeUkYK1dwLRbicyH2f1Atq693dzbg1A+TR7W7Uow 0/briba8SgNX/bKsk3Fwc/3EvLFMGmSHxXcUThgdq2VR/IGyz9n8EjjADNsTcQkkFEV7yQ 0PvUPmlJzZOKT0KB1p4qeX84svVkNCSU4EMXYNAhMaRb4O5cNyVxZk1pk6VTbWb7soIWtP K0H6GUizcwSSdxJvn0vSoZxaI8eO4hjhicjG4cJPDW+jt30PjY80OCr+6K3eEyXIquH7fQ b55OfDYQXr3YhfuEHPqnOiWhqKKmbpURLL4yY1UDovtDZias4JKRdjrulo//6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793250102; 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=A9tnHidpcPT9oBCB0TW6RqLz1n4QcK3xajVvIxi40m4=; b=nDTAUzCu41jWfM6VBz4E5l8TX7Dunv3RfTdADW5OqmupB0ERHBjmMqjGmJDV2nuY/UN3rO PCYrfCTuqkKrYBSxfYJd2/QMVIJ9je1ushowPrMhEQdX3jQUTB1Sx2ZhE3HlTRyKqD6dCP BgpKbtDgxfolClTCW/T+zc4FJ8NnfhFX1KQBoXoFFPEk8/xD4PmaBFBXdMdLdrlFhxFprc zefZKsM+5ONMOoqNmjTv/rBzuiUzu8MP39W0oZnSGvdbkCeNMV4sKpYEQBG4unO0dDSELV DkyjcIwiSNKN/Ucn2gZDnmI+PthSbp3nrED9ttE7aLWCyrMd/KAjb834Ad7n0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jFXBt05XRzPG8 for ; Thu, 29 Oct 2026 05:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33326 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 05:01:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 544102932584 - stable/15 - hn: Serialize VF link events with datapath handoff List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 544102932584a66a52a4dacc166ba8a1c32b936c Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 05:01:42 +0000 Message-Id: <6ae2d336.33326.521737d4@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=544102932584a66a52a4dacc166ba8a1c32b936c commit 544102932584a66a52a4dacc166ba8a1c32b936c Author: Kevin Bowling AuthorDate: 2026-09-15 00:22:13 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 05:01:32 +0000 hn: Serialize VF link events with datapath handoff Hold hn_vf_lock across the VF identity/state check and link publication. Otherwise an event can observe an enabled VF, pause during fallback, then overwrite the freshly reported synthetic carrier with stale VF state. Ignore events while switching or after the association generation changes. The link notification only queues further work, so the callback does not need the sleepable hn lock. Document that association serial numbers are currently diagnostic: hn_ismyvf() matches the VF by MAC, while notifications gate availability. Sponsored by: BBOX.io (cherry picked from commit 6b3b1d6d4f43d1521e5e10b759e3542deaf23667) --- sys/dev/hyperv/netvsc/if_hn.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index 27a8f517d3f8..fd49a8cb100d 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -2145,10 +2145,16 @@ static void hn_ifnet_lnkevent(void *xsc, if_t ifp, int link_state) { struct hn_softc *sc = xsc; + struct rm_priotracker pt; + /* Publish before a concurrent handoff can restore synthetic carrier. */ + rm_rlock(&sc->hn_vf_lock, &pt); if (sc->hn_vf_ifp == ifp && - (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) + (sc->hn_xvf_flags & (HN_XVFFLAG_ENABLED | HN_XVFFLAG_SWITCHING)) == + HN_XVFFLAG_ENABLED && sc->hn_vf_active_assoc == + atomic_load_acq_int(&sc->hn_vf_assoc)) if_link_state_change(sc->hn_ifp, link_state); + rm_runlock(&sc->hn_vf_lock, &pt); } static int @@ -7544,6 +7550,7 @@ hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) if_printf(sc->hn_ifp, "invalid VF association notification\n"); return; } + /* The serial is diagnostic; hn_ismyvf() matches the VF by MAC. */ /* Preserve withdrawals even when the worker coalesces notices. */ state = (atomic_load_int(&sc->hn_vf_assoc) + HN_VF_ASSOC_GENINC) & ~HN_VF_ASSOC_ALLOCATED;