From nobody Fri Nov 13 01:09:45 2026 X-Original-To: dev-commits-src-all@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 4jQfLK49TCz6xyJh for ; Fri, 13 Nov 2026 01:09:45 +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 4jQfLK3Pyzz4ky9 for ; Fri, 13 Nov 2026 01:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794532185; 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=V0dZfI/WfR7EWpdsnfvAu034RL7tHc6mHhrrogMfbeU=; b=AWBpGEepGvPpS0jabyhQ9az3EsXyd9QVSSJel2Edk/S1J/wfDkzlgDwp8TmuRcckt6CCHQ Q6GlC/9jAg80VDArafuaalMd4zhJJMwDvHFJHqVMmpA+fPrroeEU5mMLn0w8q5GQ/ZEGW/ RsoSxaFTSGKlVgg2zBn7WvpPidYxcAwaEC8C/cSCIZpPGddgMfHOG6phF0OAHdzk5iulS5 JY/k/0GJm9dQzHOJF1ZS0lTstj4Nl6vA/aVnh6Sxj2/itOQh5mwdn/dq8DytI4l/2OMgjC toT+JcyITrVIef9ZsN0hCdwfOChF6D50e8tD8kpv3oJPv4mSHnU6S8zctA0iUg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794532185; b=rwZoTOOS7WcfWrLKomRTVR3hkHL0Il2x0UQGHBpXrBEiH0Q0Uhos3dQLmUoYqTrLcuZ3gB heijt/W0MCMqN/bzdOsJHnt+6b6DJIc+f9sIGVZGOltZQc+AyIH8hpS31b+80cmDKLxQQr r5wF+WVh7iemCldjay6ToExOstWFEuPCt/xtTNMfh5NHHo8g0FBBpV/hRX63amTK89N0Ho lnDedkrGT/Dza6myvi41YWCbd544Nn4xlZF2LswJxApDp2VHn9ed/e23tyy6c3oiqjP6w7 9ECB7dzT1GbrZPwM6gv9vibsISSy2ZYEQWKRBrYVmFRlNnx8EL3LyWgX9m+j9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794532185; 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=V0dZfI/WfR7EWpdsnfvAu034RL7tHc6mHhrrogMfbeU=; b=xwbDdrnQl5brxeOqjjjNN9/2UzqBtKBwSDUV3g0IkBZnpXFw3CbA7l4lENQFWcbYTeAMvT iPH9F9U+AnWUXxZXoGtaZ74MmpSdn1vV+vf7IXBo8ULaPHCH/J/nXh6PHFZ5eILDBp615Z iMQdZLsnoz6HlF93yDrgbCMx/gZzFoxAi8pVLc7Zb1OylIogK7Z1iZiqawffihw9UvoN3X Rqw1QUFljgxD/RMJvr2MJggPpvX2djUidsC6LzLTT9QMe6+z/JJSY0x3ARXcNRm/mX784n OIj65c7cz5olftE4GTOff1nXq95iLLdI92yOiZhbf9U/zDkeTx680pWpFSpkiQ== 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 4jQfLK2wdJz1Q93 for ; Fri, 13 Nov 2026 01:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 189c9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 13 Nov 2026 01:09:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 2825404f8749 - stable/15 - iavf: Honor negotiated VLAN offload capabilities List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the 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: 2825404f87498148ed686e7fab87e6ed215fe60b Auto-Submitted: auto-generated Date: Fri, 13 Nov 2026 01:09:45 +0000 Message-Id: <6af66359.189c9.cf68fa8@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2825404f87498148ed686e7fab87e6ed215fe60b commit 2825404f87498148ed686e7fab87e6ed215fe60b Author: Kevin Bowling AuthorDate: 2026-11-02 00:40:25 +0000 Commit: Kevin Bowling CommitDate: 2026-11-13 01:09:37 +0000 iavf: Honor negotiated VLAN offload capabilities The driver advertised VLAN offload unconditionally, even when the PF did not grant it, as observed with an E835 VF under Hyper-V. This tells the stack to rely on hardware tag insertion and sends the PF unsupported VLAN filter requests. Advertise hardware VLAN tagging and filtering only when GET_VF_RESOURCES grants the legacy VLAN capability. Do not allocate filter shadow entries or send ADD_VLAN/DEL_VLAN requests without that capability. Retain VLAN MTU and checksum/TSO support for software-tagged packets. Keep advertised capabilities stable across resets, since existing VLAN interfaces may already rely on them. If resource rediscovery removes previously advertised VLAN offload, leave the VF stopped and require reattachment rather than resume with a stale offload contract. A newly granted capability is not exposed until reattach. Sponsored by: BBOX.io (cherry picked from commit 933c4f6e06c276548783247242b75814027159eb) --- sys/dev/iavf/iavf_vc_common.c | 5 +++++ sys/dev/iavf/if_iavf_iflib.c | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/iavf/iavf_vc_common.c b/sys/dev/iavf/iavf_vc_common.c index a605ec0901bf..c67f660f9356 100644 --- a/sys/dev/iavf/iavf_vc_common.c +++ b/sys/dev/iavf/iavf_vc_common.c @@ -483,6 +483,11 @@ iavf_sync_vlans(struct iavf_sc *sc) int error, first_error; sx_assert(iflib_ctx_lock_get(sc->vsi.ctx), SA_XLOCKED); + /* Software VLANs need no PF filter configuration. */ + if ((sc->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) == 0) { + atomic_store_rel_32(&sc->vlan_batch_pending, 0); + return (0); + } if (iavf_test_state(&sc->state, IAVF_STATE_RESET_PENDING) || iavf_test_state(&sc->state, IAVF_STATE_RESET_RECOVERY) || iavf_test_state(&sc->state, IAVF_STATE_VC_POLLING) || diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index 304347316a75..4fb0237d2d7c 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -414,7 +414,11 @@ iavf_if_attach_pre(if_ctx_t ctx) if ((sc->vf_res->vf_cap_flags & (VIRTCHNL_VF_OFFLOAD_RSS_REG | VIRTCHNL_VF_OFFLOAD_RSS_PF)) == VIRTCHNL_VF_OFFLOAD_RSS_PF) scctx->isc_rss_table_size = sc->vf_res->rss_lut_size; - scctx->isc_capabilities = scctx->isc_capenable = IAVF_CAPS; + scctx->isc_capabilities = IAVF_CAPS; + if ((sc->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) == 0) + scctx->isc_capabilities &= + ~(IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWFILTER); + scctx->isc_capenable = scctx->isc_capabilities; scctx->isc_tx_csum_flags = CSUM_OFFLOAD; return (0); @@ -1123,6 +1127,16 @@ iavf_reestablish_vc(struct iavf_sc *sc) if (error != 0) goto fail; + /* Do not keep advertising an offload that the PF no longer provides. */ + if ((vsi->shared->isc_capabilities & IFCAP_VLAN_HWTAGGING) != 0 && + (sc->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) == 0) { + if (iavf_mbx_log_allowed(sc)) + device_printf(sc->dev, + "PF VLAN offload capabilities changed; reattach the VF\n"); + error = ENOTSUP; + goto fail; + } + if (vsi->num_tx_queues > sc->vsi_res->num_queue_pairs || vsi->num_rx_queues > sc->vsi_res->num_queue_pairs || vsi->num_rx_queues + 1 > sc->vf_res->max_vectors) { @@ -2027,6 +2041,8 @@ iavf_if_vlan_register(if_ctx_t ctx, u16 vtag) struct iavf_sc *sc = iavf_sc_from_ctx(ctx); struct iavf_vsi *vsi = &sc->vsi; + if ((vsi->shared->isc_capabilities & IFCAP_VLAN_HWFILTER) == 0) + return; if ((vtag == 0) || (vtag > 4095)) /* Invalid */ return; @@ -2054,6 +2070,8 @@ iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag) struct iavf_vsi *vsi = &sc->vsi; int i = 0; + if ((vsi->shared->isc_capabilities & IFCAP_VLAN_HWFILTER) == 0) + return; if ((vtag == 0) || (vtag > 4095) || (vsi->num_vlans == 0)) /* Invalid */ return;