From nobody Fri Nov 28 20:59:38 2025 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 4dJ5Jq0HW7z6JH6j for ; Fri, 28 Nov 2025 20:59:39 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJ5Jp6Q9Dz3cX6 for ; Fri, 28 Nov 2025 20:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764363578; 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=ZhSkBlnNgVIgh3oxaIwjVHZdoyEU1K/2d8lYMZLIJ2w=; b=wRUFBml4RbWD88O2TpX2h6yr9Tu4nOe7mqXUPxt6Mt7y9L7VQlDl3fFama+n0hSxVxZYw9 BJmHWf31Y4+icOJU9ZTSYsE38wNv5qYbWKk3NhI14+TvnyZveu8kkHXB1xqjvkDZwr5POb KnUKHFfLBqSq/53XnY41D4LznzDy07FZ4tCcbEvlOp0VA/hLTwceiSHmHn12h14MenWIS2 S2T0xMdUsw99Zb19/9iUf03OWUzeeEDku6KjVS0lRuBw94o2ycvtt9siJXA7qNDso0WVGE OqkCBHE4IHIYWzRNHqMJvDX8ln0d6QLtLgW47149/vY+1iTOD6h7Yu8IF2XjqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764363578; 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=ZhSkBlnNgVIgh3oxaIwjVHZdoyEU1K/2d8lYMZLIJ2w=; b=f+FSob7VuKwl0RaujLizSU8ltMpTc8K2yoiq4S1ICIeZ4vP6QFcyrALeD7iTl1EO3LKYII KXwiox51YqMYsiOYyZT/7KpaPwTg3N8hLVOX/qVMa4N+9Q5MLMeSUi7LJS4Ixh/c8y2Z2t ZCYQp0qIYGYvrk7XRmR7sqPlQLpOjlBrugbJDiMrn7kApw0ExrqRtPc9Wn78jML89MtyXZ DY5UWYeJYfERcw4Lnw9UHoyjFDTSRpvLWJFx6pzkvXbrXrcrl2viNqK0nj9l3KlFTx5aiB YmC+8wAKaeM7LwfeddIC6pHf/C68yexf5VA0vLMRcViSA6FEJgWWiEEKvTnuYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764363578; a=rsa-sha256; cv=none; b=vCxjK6ew2QoxU3w7p+2h3/LM9VqF7ndxDbTyiprAOOjgVfpHWEjgE8pR5mGziagOEelfZf zywpxRmmQdRFSv5gKMf8Q7rinzH21YRiw3iyI8iek3sv/zshTPpQ0uqRNvjJUS5/SgFUIo k889Q2tJBpjfYB1UYsr7LiPGdH3/rnVSFszXKbb4SumnIpp+oJCcd7dvIRSx8C6TZB42G3 wCBSDjSevHlAR9rQIaG0Xz3ahHZwopD4A3HAGMU00xWMzS0TkZsT0XQ7FL2gqMdG/i0fTD Oa/efDIip5TCVJs3Yv5UTHbXM+kl4Q93lmKg7GlTIzaOMGRkotmxv8GluUYNyg== 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 4dJ5Jp5zx1z3SQ for ; Fri, 28 Nov 2025 20:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30a8f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Nov 2025 20:59:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Krzysztof Galazka Subject: git: 40a6ada9e614 - stable/14 - igb(4): Fix VLAN support on VFs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40a6ada9e614c1a6fd93e4164f7de416af1a23b2 Auto-Submitted: auto-generated Date: Fri, 28 Nov 2025 20:59:38 +0000 Message-Id: <692a0d3a.30a8f.3f503b03@gitrepo.freebsd.org> The branch stable/14 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=40a6ada9e614c1a6fd93e4164f7de416af1a23b2 commit 40a6ada9e614c1a6fd93e4164f7de416af1a23b2 Author: Krzysztof Galazka AuthorDate: 2025-11-17 15:30:26 +0000 Commit: Krzysztof Galazka CommitDate: 2025-11-28 20:59:24 +0000 igb(4): Fix VLAN support on VFs Virtual Functions are considered untrusted and have no control over VLAN filtering configuration in HW. To allow using VLANs on VF intreface driver has to assume that VLAN HW Filtering is always enabled and pass requests for adding or removing VLAN tags to Physical Function driver using Mailbox API. Signed-off-by: Krzysztof Galazka Approved by: kbowling (mentor) Reviewed by: erj (previous version) Tested by: gowtham.kumar.ks_intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D53245 (cherry picked from commit 1839526b7315cae62efbd2d1493e6243439effcb) --- sys/dev/e1000/if_em.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 9040949b36c7..ce4269728903 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4048,7 +4048,15 @@ em_if_vlan_register(if_ctx_t ctx, u16 vtag) bit = vtag & 0x1F; sc->shadow_vfta[index] |= (1 << bit); ++sc->num_vlans; - em_if_vlan_filter_write(sc); + if (!sc->vf_ifp) + em_if_vlan_filter_write(sc); + else + /* + * Physical funtion may reject registering VLAN + * but we have no way to inform the stack + * about that. + */ + e1000_vfta_set_vf(&sc->hw, vtag, true); } static void @@ -4061,7 +4069,10 @@ em_if_vlan_unregister(if_ctx_t ctx, u16 vtag) bit = vtag & 0x1F; sc->shadow_vfta[index] &= ~(1 << bit); --sc->num_vlans; - em_if_vlan_filter_write(sc); + if (!sc->vf_ifp) + em_if_vlan_filter_write(sc); + else + e1000_vfta_set_vf(&sc->hw, vtag, false); } static bool @@ -4119,22 +4130,15 @@ em_if_vlan_filter_write(struct e1000_softc *sc) { struct e1000_hw *hw = &sc->hw; - if (sc->vf_ifp) - return; + KASSERT(!sc->vf_ifp, ("VLAN filter write on VF\n")); /* Disable interrupts for lem(4) devices during the filter change */ if (hw->mac.type < em_mac_min) em_if_intr_disable(sc->ctx); for (int i = 0; i < EM_VFTA_SIZE; i++) - if (sc->shadow_vfta[i] != 0) { - /* XXXKB: incomplete VF support, we returned above */ - if (sc->vf_ifp) - e1000_vfta_set_vf(hw, sc->shadow_vfta[i], - true); - else - e1000_write_vfta(hw, i, sc->shadow_vfta[i]); - } + if (sc->shadow_vfta[i] != 0) + e1000_write_vfta(hw, i, sc->shadow_vfta[i]); /* Re-enable interrupts for lem-class devices */ if (hw->mac.type < em_mac_min) @@ -4149,8 +4153,10 @@ em_setup_vlan_hw_support(if_ctx_t ctx) if_t ifp = iflib_get_ifp(ctx); u32 reg; - /* XXXKB: Return early if we are a VF until VF decap and filter - * management is ready and tested. + /* + * Only PFs have control over VLAN HW filtering + * configuration. VFs have to act as if it's always + * enabled. */ if (sc->vf_ifp) return;