patch 'net/gve: reject MTU needing Rx scatter when disabled' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 5 17:43:02 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/07/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/6266b14b8f717e73bc790f856e25c9e70e91e81d

Thanks.

Luca Boccassi

---
>From 6266b14b8f717e73bc790f856e25c9e70e91e81d Mon Sep 17 00:00:00 2001
From: Ryan Wolfe <rnwolfe at google.com>
Date: Mon, 19 Oct 2026 16:20:04 -0400
Subject: [PATCH] net/gve: reject MTU needing Rx scatter when disabled

[ upstream commit 8b812d0489536206a6ce5d6402462525c4906e40 ]

GQI chains a frame larger than one Rx buffer into a multi-segment mbuf
whether or not the application enabled RTE_ETH_RX_OFFLOAD_SCATTER, so
an application that did not ask for scatter can still receive chained
mbufs once the MTU exceeds the Rx buffer.

Refuse such a configuration on GQI. Rx queue setup fails when the
current MTU plus the Ethernet header and the GVE_RX_PAD bytes ahead of
the frame does not fit in the queue's Rx buffer, and an MTU change
fails on the same test against each configured Rx queue. The buffer
length comes from one helper shared with queue setup, so the check
matches the size the device is given. DQO is unchanged.

Fixes: 496d4d2c8b54 ("net/gve: support jumbo frame for GQI")

Suggested-by: Stephen Hemminger <stephen at networkplumber.org>
Signed-off-by: Ryan Wolfe <rnwolfe at google.com>
---
 drivers/net/gve/gve_ethdev.c | 18 ++++++++++++++++++
 drivers/net/gve/gve_ethdev.h |  9 +++++++++
 drivers/net/gve/gve_rx.c     | 31 +++++++++++++++++++++++++------
 3 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index ee2f0d9a09c..f1f0d740475 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -752,6 +752,24 @@ gve_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		return -EBUSY;
 	}
 
+	/* GQI chains a frame larger than one Rx buffer into a multi-segment
+	 * mbuf. No Rx offload is per-queue here, so check the port offloads.
+	 */
+	if (gve_is_gqi(priv) &&
+	    !(dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SCATTER)) {
+		for (uint16_t i = 0; i < dev->data->nb_rx_queues; i++) {
+			struct gve_rx_queue *rxq = dev->data->rx_queues[i];
+
+			if (rxq != NULL &&
+			    gve_rx_gqi_needs_scatter(mtu, rxq->rx_buf_len)) {
+				PMD_DRV_LOG(ERR,
+					    "MTU %u needs Rx scatter with %u byte Rx buffers",
+					    mtu, rxq->rx_buf_len);
+				return -EINVAL;
+			}
+		}
+	}
+
 	err = gve_adminq_set_mtu(priv, mtu);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to set mtu as %u err = %d", mtu, err);
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index 6eed80502fe..3aaf1a769c4 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -326,6 +326,15 @@ gve_is_gqi(struct gve_priv *priv)
 		priv->queue_format == GVE_GQI_QPL_FORMAT;
 }
 
+/* GQI places GVE_RX_PAD bytes ahead of the frame in its first Rx buffer
+ * and chains the rest of a larger frame into further buffers.
+ */
+static inline bool
+gve_rx_gqi_needs_scatter(uint16_t mtu, uint16_t rx_buf_len)
+{
+	return (uint32_t)mtu + RTE_ETHER_HDR_LEN + GVE_RX_PAD > rx_buf_len;
+}
+
 static inline bool
 gve_get_admin_queue_ok(struct gve_priv *priv)
 {
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index 8fd044e5833..e63ae79bed4 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -295,6 +295,16 @@ gve_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 	rte_free(q);
 }
 
+static uint16_t
+gve_rx_buf_len_gqi(struct rte_mempool *pool)
+{
+	uint32_t mbuf_len =
+		rte_pktmbuf_data_room_size(pool) - RTE_PKTMBUF_HEADROOM;
+
+	return RTE_MIN((uint16_t)GVE_RX_MAX_BUF_SIZE_GQI,
+		       RTE_ALIGN_FLOOR(mbuf_len, GVE_RX_BUF_ALIGN_GQI));
+}
+
 int
 gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 		uint16_t nb_desc, unsigned int socket_id,
@@ -304,7 +314,8 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	const struct rte_memzone *mz;
 	struct gve_rx_queue *rxq;
 	uint16_t free_thresh;
-	uint32_t mbuf_len;
+	uint16_t rx_buf_len;
+	uint64_t offloads;
 	int err = 0;
 
 	/* Ring size is required to be a power of two. */
@@ -314,6 +325,18 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 		return -EINVAL;
 	}
 
+	/* A frame larger than one Rx buffer is chained into a multi-segment
+	 * mbuf, which the application must have asked for.
+	 */
+	offloads = dev->data->dev_conf.rxmode.offloads | conf->offloads;
+	rx_buf_len = gve_rx_buf_len_gqi(pool);
+	if (!(offloads & RTE_ETH_RX_OFFLOAD_SCATTER) &&
+	    gve_rx_gqi_needs_scatter(dev->data->mtu, rx_buf_len)) {
+		PMD_DRV_LOG(ERR, "MTU %u needs Rx scatter with %u byte Rx buffers",
+			    dev->data->mtu, rx_buf_len);
+		return -EINVAL;
+	}
+
 	/* Free memory if needed. */
 	if (dev->data->rx_queues[queue_id]) {
 		gve_rx_queue_release(dev, queue_id);
@@ -349,11 +372,7 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	rxq->hw = hw;
 	rxq->ntfy_addr = &hw->db_bar2[rte_be_to_cpu_32(hw->irq_dbs[rxq->ntfy_id].id)];
 
-	mbuf_len =
-		rte_pktmbuf_data_room_size(rxq->mpool) - RTE_PKTMBUF_HEADROOM;
-	rxq->rx_buf_len =
-		RTE_MIN((uint16_t)GVE_RX_MAX_BUF_SIZE_GQI,
-			RTE_ALIGN_FLOOR(mbuf_len, GVE_RX_BUF_ALIGN_GQI));
+	rxq->rx_buf_len = rx_buf_len;
 
 	/* Allocate software ring */
 	rxq->sw_ring = rte_zmalloc_socket("gve rx sw ring", sizeof(struct rte_mbuf *) * nb_desc,
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-05 16:42:48.556951259 +0000
+++ 0095-net-gve-reject-MTU-needing-Rx-scatter-when-disabled.patch	2026-11-05 16:42:45.033064133 +0000
@@ -1 +1 @@
-From 8b812d0489536206a6ce5d6402462525c4906e40 Mon Sep 17 00:00:00 2001
+From 6266b14b8f717e73bc790f856e25c9e70e91e81d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8b812d0489536206a6ce5d6402462525c4906e40 ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -30 +31 @@
-index 08b6bb831e..7506c46d9a 100644
+index ee2f0d9a09c..f1f0d740475 100644
@@ -33 +34 @@
-@@ -1031,6 +1031,24 @@ gve_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -752,6 +752,24 @@ gve_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
@@ -55 +56 @@
- 	err = process_priv->ctrl_ops->set_mtu(priv, mtu);
+ 	err = gve_adminq_set_mtu(priv, mtu);
@@ -59 +60 @@
-index be744d955b..26c6a304a6 100644
+index 6eed80502fe..3aaf1a769c4 100644
@@ -62 +63 @@
-@@ -456,6 +456,15 @@ gve_is_gqi(struct gve_priv *priv)
+@@ -326,6 +326,15 @@ gve_is_gqi(struct gve_priv *priv)
@@ -79 +80 @@
-index 09f9d8d480..4a455b3067 100644
+index 8fd044e5833..e63ae79bed4 100644
@@ -82,2 +83,2 @@
-@@ -297,6 +297,16 @@ gve_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
- 	dev->data->rx_queues[qid] = NULL;
+@@ -295,6 +295,16 @@ gve_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
+ 	rte_free(q);
@@ -99 +100 @@
-@@ -306,7 +316,8 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
+@@ -304,7 +314,8 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
@@ -109 +110 @@
-@@ -316,6 +327,18 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
+@@ -314,6 +325,18 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
@@ -128 +129 @@
-@@ -351,11 +374,7 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
+@@ -349,11 +372,7 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
@@ -130 +131 @@
- 	rxq->ntfy_addr = &hw->db_bar[rte_be_to_cpu_32(hw->irq_dbs[rxq->ntfy_id].id)];
+ 	rxq->ntfy_addr = &hw->db_bar2[rte_be_to_cpu_32(hw->irq_dbs[rxq->ntfy_id].id)];


More information about the stable mailing list