From nobody Tue Nov 03 02:41:55 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 4jJXsN5vkBz6xfj5 for ; Tue, 03 Nov 2026 02:42:00 +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 4jJXsN3vL5z4QSh for ; Tue, 03 Nov 2026 02:42:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793673720; 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=sKcy5lhlMfVt6OEmEOaFrjU5uzXU7VM2Tw4Xv3OgrFo=; b=b/Of+bdfeBSsKQZ+DFMD4GefmMH2FcDzMnlBUf9eTcgvjAPPZHfAxzHKuc7xnwM9RqGwTt 0nWTxdBWRG4oT9ey2UrYig/CZb49G5ujYqbpCuYR3qCnyeNY3xiABKJerXyhznpc5LSw38 6rZGKIToEiUH04Do4Pm8AMryarIm/Fqx8wu0ksIdSvt/VwBTnuM2IpQKCVeEVGLsrMEqeV w1dU0rvruyhQzk01uYpwMZ9uruN9oRD6z1feCziX1su2OHLTJ1eG8QXdbvaoNSCf3sHSns PhNdT2N4ycFuw8F+xKqw+xp8Ozcyb6STyv8447qAIuxXumsBQCLHVmWseExixQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793673720; b=Pjh37mtimCqGWRz+BhrUDtIEJabHKepnkVMH9KuR5Lt7Mn2YzFoB0/zNFj9XkEXRUIy44a dWWpUo7WzDeqOgJpQZWqZgnkQTu3ZtAQiUdeZcZ8LpJy6Xh3mLkfOyzQHRY+ZUnjuVXFMl EfS94ibPrkXuLtPI0pORVwoc0hpzbSbzUvgOrPFZqB/19gTwdj0KFDIzB7nhVyRZ08aO36 Ut8+ALXUw/3y3UB5U2rFRRx66DI4Wul0v2npw0FRbDMKaSUzrWmgdeO7PpvJuUYZuRRkxh dQq7H5yHcFKkvDywHx/NWWeMpiBt/DT0dzKDIO1/6vrCAhtMBXnD4BR3j0IyNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793673720; 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=sKcy5lhlMfVt6OEmEOaFrjU5uzXU7VM2Tw4Xv3OgrFo=; b=UhDQWudisfKoSMGxPUtHGFcTkYlIxPfBzPGiYgy9hlb3vGT8L5zJcpf8/94UWwOzfp+pDh T5YvZ6i2HOfV2rX+LYZesz3vkIESATSBnUqDHuJA5z62xBqcZ74Ekmp5H3kJ/GKxs63Cij 1iKa5nvzQIPBY/3kwnyxegCPr3Q8Vx55qEg0gv7ARRgblxJWvKr1zai8wb+fKh00bhOUUU uSIeVpsAiZ2zrG31Wxe3B7wXANehvI42QRnufL3dGeTH/JMlhdVI06dMlWP6L+PJAptt+S ssRZtvzP0e5MS97aCJIz+WCVyf/FkzeTkgB0gqL/wq4dLnpJTE6w52uDHcx9cA== 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 4jJXsN3Yjsz1Byc for ; Tue, 03 Nov 2026 02:42:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b546 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 03 Nov 2026 02:41:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 933c4f6e06c2 - main - 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 Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 933c4f6e06c276548783247242b75814027159eb Auto-Submitted: auto-generated Date: Tue, 03 Nov 2026 02:41:55 +0000 Message-Id: <6ae949f3.3b546.570a42a7@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=933c4f6e06c276548783247242b75814027159eb commit 933c4f6e06c276548783247242b75814027159eb Author: Kevin Bowling AuthorDate: 2026-11-02 00:40:25 +0000 Commit: Kevin Bowling CommitDate: 2026-11-03 02:41:46 +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. MFC after: 2 weeks Sponsored by: BBOX.io --- 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;