From nobody Thu Oct 29 06:43:20 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 4jFZS86rHRz6xvQ6 for ; Thu, 29 Oct 2026 06:43:20 +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 4jFZS84nbyz3NqL for ; Thu, 29 Oct 2026 06:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793256200; 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=dNEhS2FUe5EctDQKmA0ORgSxNLXTrdkZ2gMOikvDdIA=; b=VluB71/ElniDbJnzFWh0+cDIcr16hmTb3UVY6PTmfKd4GwIY8ycqor3SWCh6mL73lcx0ie Pxho9JnuvA/7fEdL063RcTtizHcC+czuWViNadjWH3tek/1nirxkRlpy86/twh0Vy2OX5Y zU9TKysbiNJI/wn5/GIfiazZbUu5ND9PeKWjpjSpkGEiDmDEfs9N8jH8h1OWjQgvNj4Aqp alj4S1xrgc9YBvHAe1pgqui1q1kgQjnnedbmPnHw3LgepoErbONIn4Iu7hBaPMCd+tW7Ii 7fmA4lJbukcs9Lr5bgAFDL//YGwZFNqzMJSjjRX5M0zkmKK+1z7HeJwYLum2Kw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793256200; b=YuvPv4xJZC7vrZsjXG3E7pqoh8b0RhVZ4cO81DuF9XHiSDl35YR3FxalkuGQPj2UE5ovAy vP5EyuK63YjllEPlcXwAqiU2Fy/KcdyDVj2wvQ+rvUzuqAKMJPpbyTyW7OtGeonbivyO0z BUjaCjPoVh8AcoRhK8elbZRz1Z7q0p4dywivFqpDEFt4sXWOJoNQNS7cZrVfAbYETIn3qs 81mPAAyh1E08FCtWJUCZYd+Cq3nch0ZE0cxkXrbhAG9Ac2O2itaiFqsY55TEjWGdpczDLN KNHZ2IyPTtm/v9tNsNnCEPwdCR40dKrY7nSdRj02q9Rw5WlAqWSBmnvA4q6rAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793256200; 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=dNEhS2FUe5EctDQKmA0ORgSxNLXTrdkZ2gMOikvDdIA=; b=LYHx2YTrz6T28abcvw95UP5LAHn+OMuuubyuIvQmnchs8TdGc2hqDKYS0E84/MVV9rpdBu noZpr+RtvCAmAWa5XhoAox69t7saS1yBkRuWAseJK5QIr+7PwMcs4UBN4KIbQQQU5BrCVT VBTcrbkxgIJbqIQ3Go3cI106jFkqE9Zp0Kp1+fT4RjZ0UvCw0OL6iwVwRndFjzNIgfCqL1 2Q1m5EIcvKD1F3IE5SkSPLZZTpJlePqa1FQlI1ZBvN25icCo5Gt5s4UxMinWZ9WeKalASX Osh2HmCcnZkZVhQAHH5r5JGeYBVfsGaQayu3GmCFL8rebthgL2drXZYPl4HRyQ== 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 4jFZS811FYzRqn for ; Thu, 29 Oct 2026 06:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ee05 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 06:43:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 25535b498760 - stable/15 - hn: Refresh VF RSS configuration after link recovery 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: 25535b498760dff714b6601835ca6e3f239dfdd4 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 06:43:20 +0000 Message-Id: <6ae2eb08.3ee05.756cbfdc@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=25535b498760dff714b6601835ca6e3f239dfdd4 commit 25535b498760dff714b6601835ca6e3f239dfdd4 Author: Kevin Bowling AuthorDate: 2026-09-18 11:25:44 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 06:42:12 +0000 hn: Refresh VF RSS configuration after link recovery A VF can finish initialization or reset recovery after hn's handoff-time RSS query returned ENXIO. In that case hn suppresses synthetic receive hash metadata, but previously left it disabled even after the VF could answer the queries again. Queue an RSS refresh on a VF link-up notification, using the existing VF worker in both transparent and non-transparent modes. Revalidate the association, active VF path, administrative state, and carrier under hn_lock before querying and reconfiguring synthetic RSS. Coalesce the requests with an atomic flag and retain a request while capability forwarding temporarily excludes the worker. Keep the existing query validity checks and unsupported-query fallback unchanged. This is a one-shot refresh, not a readiness poll. Recovery without a link-up notification, or a query that still fails during the refresh, does not trigger another retry by itself. A later link-up or normal handoff can query again. Consuming the request while the VF path is inactive is intentional: the next handoff queries RSS unconditionally. Continue to reprogram RSS after a successful query even when the cached key and types match. They are updated before host reconfiguration and do not prove that the previous programming succeeded. The event callback only records and schedules work; RSS queries and host reconfiguration remain in sleepable context. No packet-path changes or new timer are needed. With an E835 iavf VF, reproduced an ENABLE_QUEUES timeout and an ENXIO RSS query in both transparent and non-transparent modes. In each mode hn restored mbuf_hash after VF recovery, without another interface reconfiguration. Sponsored by: BBOX.io (cherry picked from commit 1568e6bb3c9d4007492d0297c0dfa3834a2ba751) --- sys/dev/hyperv/netvsc/if_hn.c | 34 +++++++++++++++++++++++++++------- sys/dev/hyperv/netvsc/if_hnvar.h | 1 + 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index d8ac23a4af6e..6d9953dd2217 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -2084,7 +2084,7 @@ hn_xpnt_vf_init_taskfunc(void *xsc, int pending __unused) hn_rxvf_change_locked(sc, sc->hn_vf_ifp, false); hn_rxvf_change_locked(sc, sc->hn_vf_ifp, (if_getflags(sc->hn_vf_ifp) & IFF_UP) != 0); - goto done; + goto rss; } if (sc->hn_vf_active_assoc != 0 && sc->hn_vf_active_assoc != atomic_load_acq_int(&sc->hn_vf_assoc)) @@ -2096,7 +2096,7 @@ hn_xpnt_vf_init_taskfunc(void *xsc, int pending __unused) } hn_xpnt_vf_sync_vlans(sc, false); if (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED) - goto done; + goto rss; if (if_getdrvflags(sc->hn_ifp) & IFF_DRV_RUNNING) { /* @@ -2108,6 +2108,20 @@ hn_xpnt_vf_init_taskfunc(void *xsc, int pending __unused) } hn_xpnt_vf_init(sc); } +rss: + /* + * A link-up event can follow recovery from a failed handoff RSS query. + * An inactive path can consume this request: its next handoff queries + * RSS again. This is a one-shot refresh, not a readiness poll. + */ + if (atomic_readandclear_int(&sc->hn_vf_rss_refresh) != 0 && + ((sc->hn_flags & HN_FLAG_RXVF) || + (sc->hn_xvf_flags & HN_XVFFLAG_ENABLED)) && + (sc->hn_vf_active_assoc & HN_VF_ASSOC_ALLOCATED) != 0 && + sc->hn_vf_active_assoc == atomic_load_acq_int(&sc->hn_vf_assoc) && + (if_getflags(sc->hn_vf_ifp) & IFF_UP) != 0 && + if_getlinkstate(sc->hn_vf_ifp) == LINK_STATE_UP) + hn_vf_rss_fixup(sc, true); done: HN_UNLOCK(sc); } @@ -2281,11 +2295,18 @@ hn_ifnet_lnkevent(void *xsc, if_t ifp, int link_state) /* 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 | HN_XVFFLAG_SWITCHING)) == + if (sc->hn_vf_ifp != ifp) + goto out; + if (link_state == LINK_STATE_UP) { + /* RSS queries and host reconfiguration require sleepable context. */ + atomic_store_rel_int(&sc->hn_vf_rss_refresh, 1); + taskqueue_enqueue_timeout(sc->hn_vf_taskq, &sc->hn_vf_init, 0); + } + if ((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); +out: rm_runlock(&sc->hn_vf_lock, &pt); } @@ -2718,10 +2739,9 @@ hn_attach(device_t dev) hn_ifnet_event, sc, EVENTHANDLER_PRI_ANY); sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); - } else { - sc->hn_ifnet_lnkhand = EVENTHANDLER_REGISTER(ifnet_link_event, - hn_ifnet_lnkevent, sc, EVENTHANDLER_PRI_ANY); } + sc->hn_ifnet_lnkhand = EVENTHANDLER_REGISTER(ifnet_link_event, + hn_ifnet_lnkevent, sc, EVENTHANDLER_PRI_ANY); /* * NOTE: diff --git a/sys/dev/hyperv/netvsc/if_hnvar.h b/sys/dev/hyperv/netvsc/if_hnvar.h index 7fde5c8fe30e..9d19137579e6 100644 --- a/sys/dev/hyperv/netvsc/if_hnvar.h +++ b/sys/dev/hyperv/netvsc/if_hnvar.h @@ -278,6 +278,7 @@ struct hn_softc { bool hn_detaching; /* hn_lock */ u_int hn_vf_assoc; /* atomic generation + allocated */ u_int hn_vf_active_assoc; /* confirmed VF generation */ + u_int hn_vf_rss_refresh; /* atomic link-up request */ struct taskqueue *hn_vf_taskq; struct timeout_task hn_vf_init; struct task hn_vf_vlancap;