Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Aug 2026 14:35:34 +0000
From:      Kevin Bowling <kbowling@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2a803e6f349c - main - ixgbe: Use PF MTU for 82599 VF jumbo policy
Message-ID:  <6a75ed36.45a1d.f1d997d@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=2a803e6f349c3d6cf770089f8a71bc5139308465

commit 2a803e6f349c3d6cf770089f8a71bc5139308465
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-05 14:14:44 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-07 14:29:42 +0000

    ixgbe: Use PF MTU for 82599 VF jumbo policy
    
    The shared maximum frame size is raised by VF LPE requests, so it
    cannot describe the PF MTU when enforcing the 82599 PF/VF jumbo
    restriction. Consult the PF ifnet MTU instead.
    
    Also correct the API 1.1 and later comparison so a jumbo VF is enabled
    when, and only when, the PF itself uses a jumbo MTU. This matches the
    policy implemented by DPDK.
    
    MFC after:      2 weeks
---
 sys/dev/ixgbe/if_sriov.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c
index 32b4935e3b44..af0027a073c8 100644
--- a/sys/dev/ixgbe/if_sriov.c
+++ b/sys/dev/ixgbe/if_sriov.c
@@ -491,6 +491,9 @@ ixgbe_vf_clear_mac_filters(struct ixgbe_softc *sc, struct ixgbe_vf *vf,
 static boolean_t
 ixgbe_vf_frame_size_compatible(struct ixgbe_softc *sc, struct ixgbe_vf *vf)
 {
+	if_t ifp;
+	bool pf_jumbo;
+
 	/*
 	 * Frame size compatibility between PF and VF is only a problem on
 	 * 82599-based cards.  X540 and later support any combination of jumbo
@@ -499,6 +502,10 @@ ixgbe_vf_frame_size_compatible(struct ixgbe_softc *sc, struct ixgbe_vf *vf)
 	if (sc->hw.mac.type != ixgbe_mac_82599EB)
 		return (true);
 
+	/* sc->max_frame_size includes VF requests; use the PF's actual MTU. */
+	ifp = iflib_get_ifp(sc->ctx);
+	pf_jumbo = if_getmtu(ifp) > ETHERMTU;
+
 	switch (vf->api_ver) {
 	case IXGBE_API_VER_1_0:
 	case IXGBE_API_VER_UNKNOWN:
@@ -506,8 +513,7 @@ ixgbe_vf_frame_size_compatible(struct ixgbe_softc *sc, struct ixgbe_vf *vf)
 		 * On legacy (1.0 and older) VF versions, we don't support
 		 * jumbo frames on either the PF or the VF.
 		 */
-		if (sc->max_frame_size > ETHER_MAX_LEN ||
-		    vf->maximum_frame_size > ETHER_MAX_LEN)
+		if (pf_jumbo || vf->maximum_frame_size > ETHER_MAX_LEN)
 			return (false);
 
 		return (true);
@@ -526,10 +532,7 @@ ixgbe_vf_frame_size_compatible(struct ixgbe_softc *sc, struct ixgbe_vf *vf)
 		 * Jumbo frames only work with VFs if the PF is also using
 		 * jumbo frames.
 		 */
-		if (sc->max_frame_size <= ETHER_MAX_LEN)
-			return (true);
-
-		return (false);
+		return (pf_jumbo);
 	}
 } /* ixgbe_vf_frame_size_compatible */
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a75ed36.45a1d.f1d997d>