* [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support
@ 2026-12-03 23:26 Joshua Washington
2026-12-03 23:26 ` [PATCH 01/12] net/gve: disable queue start and stop Joshua Washington
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
Cc: dev, Joshua Washington
This patch series collects 11 bug fixes followed by DQO scattered Rx
support for the GVE PMD:
Fixes (patches 01-11):
- Disable per-queue start/stop ops until individual queue lifecycle
commands are supported, preventing device/driver ring desync.
- Free partially received GQI Rx chains on queue teardown and avoid
allocating an extra unposted mbuf in GQI Rx queue setup.
- Guard against integer underflow in GQI Rx when frag_size < GVE_RX_PAD
and against integer truncation / descriptor bounds violations in GQI
QPL Tx.
- Stop counting normal ring-exhaustion backpressure as oerrors in DQO
Tx.
- Disable unsupported TCP LRO/RSC offload and drop multi-segment Rx
packets when scatter is disabled in DQO.
- Reject non-power-of-2 ring sizes in DQO Rx/Tx setup.
- Handle RSS allocation failures cleanly without corrupting cached state.
- Reject unsupported flow attributes and item masks.
Feature (patch 12):
- Add scattered Rx offload support for the DQO descriptor format.
Jasper Tran O'Leary (7):
net/gve: disable unsupported TCP LRO offload
net/gve: drop multi-seg Rx packets if scatter is off
net/gve: reject non-power-of-2 ring sizes on DQO
net/gve: properly handle RSS realloc failures
net/gve: reject unsupported flow attributes and item masks
net/gve: fix mbuf leak on GQI Rx queue start
net/gve: support scattered Rx for DQO
Joshua Washington (3):
net/gve: fix integer underflow in GQI Rx path
net/gve: fix integer truncation in GQI QPL Tx path
net/gve: do not count unsent DQO Tx packets as oerrors
Mark Blasko (2):
net/gve: disable queue start and stop
net/gve: free partially received GQI Rx packet
doc/guides/nics/features/gve.ini | 3 +-
doc/guides/nics/gve.rst | 19 ++
doc/guides/rel_notes/release_27_03.rst | 4 +
drivers/net/gve/base/gve_adminq.c | 7 +-
drivers/net/gve/gve_ethdev.c | 86 ++++++---
drivers/net/gve/gve_ethdev.h | 18 +-
drivers/net/gve/gve_flow_rule.c | 241 ++++++++++++++++++++-----
drivers/net/gve/gve_rss.c | 53 +-----
drivers/net/gve/gve_rss.h | 7 +-
drivers/net/gve/gve_rx.c | 49 +++--
drivers/net/gve/gve_rx_dqo.c | 152 ++++++++++++----
drivers/net/gve/gve_tx.c | 59 ++++--
drivers/net/gve/gve_tx_dqo.c | 25 ++-
13 files changed, 514 insertions(+), 209 deletions(-)
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 01/12] net/gve: disable queue start and stop
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 02/12] net/gve: free partially received GQI Rx packet Joshua Washington
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Junfeng Guo; +Cc: dev, Mark Blasko, stable
From: Mark Blasko <blasko@google.com>
Stopping a single Rx or Tx queue only resets the software state of the
queue. The queue is never destroyed on the device, and starting it again
does not create it on the device either, so the device keeps its stale
position in the ring and may keep using buffers that have already been
released. Afterwards, the device and driver no longer agree on which
descriptors are valid. On DQO Tx queues, this makes the device process
zeroed descriptors, which it treats as malicious driver behavior,
disabling the queue.
Fixing this requires creating and destroying individual queues on the
device. Until that is supported, remove the queue start and stop ops,
so that applications get -ENOTSUP instead of a broken queue. All queues
are still started and stopped along with the device.
Fixes: b044845bb015 ("net/gve: support queue start/stop")
Cc: stable@dpdk.org
Suggested-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Mark Blasko <blasko@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
doc/guides/nics/features/gve.ini | 1 -
drivers/net/gve/gve_ethdev.c | 8 --------
2 files changed, 9 deletions(-)
diff --git a/doc/guides/nics/features/gve.ini b/doc/guides/nics/features/gve.ini
index 5566511b6b..909858d8f0 100644
--- a/doc/guides/nics/features/gve.ini
+++ b/doc/guides/nics/features/gve.ini
@@ -5,7 +5,6 @@
;
[Features]
Speed capabilities = Y
-Queue start/stop = Y
MTU update = Y
Scattered Rx = P
TSO = Y
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 8ee52fdd47..e71f97646f 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -1477,10 +1477,6 @@ static const struct eth_dev_ops gve_eth_dev_ops = {
.tx_queue_setup = gve_tx_queue_setup,
.rx_queue_release = gve_rx_queue_release,
.tx_queue_release = gve_tx_queue_release,
- .rx_queue_start = gve_rx_queue_start,
- .tx_queue_start = gve_tx_queue_start,
- .rx_queue_stop = gve_rx_queue_stop,
- .tx_queue_stop = gve_tx_queue_stop,
.flow_ops_get = gve_flow_ops_get,
.link_update = gve_link_update,
.stats_get = gve_dev_stats_get,
@@ -1505,10 +1501,6 @@ static const struct eth_dev_ops gve_eth_dev_ops_dqo = {
.tx_queue_setup = gve_tx_queue_setup_dqo,
.rx_queue_release = gve_rx_queue_release_dqo,
.tx_queue_release = gve_tx_queue_release_dqo,
- .rx_queue_start = gve_rx_queue_start_dqo,
- .tx_queue_start = gve_tx_queue_start_dqo,
- .rx_queue_stop = gve_rx_queue_stop_dqo,
- .tx_queue_stop = gve_tx_queue_stop_dqo,
.flow_ops_get = gve_flow_ops_get,
.link_update = gve_link_update,
.stats_get = gve_dev_stats_get,
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 02/12] net/gve: free partially received GQI Rx packet
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
2026-12-03 23:26 ` [PATCH 01/12] net/gve: disable queue start and stop Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 03/12] net/gve: fix integer underflow in GQI Rx path Joshua Washington
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Junfeng Guo, Jeroen de Borst, Rushil Gupta
Cc: dev, Mark Blasko, stable
From: Mark Blasko <blasko@google.com>
A GQI Rx burst can return while a packet spanning multiple descriptors
is only partially received. The fragments received so far are detached
from the software ring and kept in the queue's reassembly context
until the last fragment arrives.
Releasing the queue's mbufs, as done when the device is stopped,
only freed the mbufs still in the software ring. The partial
packet was leaked, and the reassembly context was left populated, so
the first packet received after a restart was treated as a continuation
of the stale packet: it was appended to it, or dropped if the stale
packet had an error.
Free the partial packet and clear the reassembly context when releasing
the queue's mbufs.
Fixes: 496d4d2c8b54 ("net/gve: support jumbo frame for GQI")
Cc: stable@dpdk.org
Signed-off-by: Mark Blasko <blasko@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
drivers/net/gve/gve_rx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index 31c187ca83..8e7557e774 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -278,6 +278,9 @@ gve_release_rxq_mbufs(struct gve_rx_queue *rxq)
{
uint16_t i;
+ rte_pktmbuf_free(rxq->ctx.mbuf_head);
+ gve_rx_ctx_clear(&rxq->ctx);
+
for (i = 0; i < rxq->nb_rx_desc; i++) {
if (rxq->sw_ring[i]) {
rte_pktmbuf_free_seg(rxq->sw_ring[i]);
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 03/12] net/gve: fix integer underflow in GQI Rx path
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
2026-12-03 23:26 ` [PATCH 01/12] net/gve: disable queue start and stop Joshua Washington
2026-12-03 23:26 ` [PATCH 02/12] net/gve: free partially received GQI Rx packet Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 04/12] net/gve: fix integer truncation in GQI QPL Tx path Joshua Washington
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Junfeng Guo, Xiaoyun Li
Cc: dev, stable, Jasper Tran O'Leary
In gve_rx(), GVE_RX_PAD is unconditionally subtracted from frag_size on
the first fragment of a packet without verifying that frag_size is at
least GVE_RX_PAD. If the descriptor reports a length smaller than
GVE_RX_PAD, the uint16_t subtraction underflows, causing an
out-of-bounds copy in gve_rx_mbuf() when operating in QPL mode.
Check that frag_size >= GVE_RX_PAD on the first fragment before
subtracting. If it is smaller, log an error, mark the packet to be
dropped, increment rxq->stats.errors, and jump to drop_frag.
Fixes: a46583cf43c8 ("net/gve: support Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Jasper Tran O'Leary <jtranoleary@google.com>
---
drivers/net/gve/gve_rx.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index 8e7557e774..1985e9ad02 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -156,8 +156,16 @@ gve_rx(struct gve_rx_queue *rxq, volatile struct gve_rx_desc *rxd, uint16_t rx_i
goto drop_frag;
}
- if (is_first_frag)
+ if (is_first_frag) {
+ if (unlikely(frag_size < GVE_RX_PAD)) {
+ PMD_DRV_DP_LOG(ERR, "Rx fragment size (%u) smaller than padding (%u)",
+ frag_size, GVE_RX_PAD);
+ ctx->drop_pkt = true;
+ rxq->stats.errors++;
+ goto drop_frag;
+ }
frag_size -= GVE_RX_PAD;
+ }
rxe = rxq->sw_ring[rx_id];
gve_rx_mbuf(rxq, rxe, frag_size, rx_id);
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 04/12] net/gve: fix integer truncation in GQI QPL Tx path
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (2 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 03/12] net/gve: fix integer underflow in GQI Rx path Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 05/12] net/gve: do not count unsent DQO Tx packets as oerrors Joshua Washington
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Xiaoyun Li, Junfeng Guo
Cc: dev, stable, Jasper Tran O'Leary
In the GQ QPL Tx path, header length and payload length are computed as
uint32_t, but gve_tx_alloc_from_fifo() takes a uint16_t length. A
packet or TSO payload of 65536 bytes or greater truncates the higher
order bits, causing the FIFO to allocate a smaller size before copying
the full 32-bit length and overflowing the FIFO.
Additionally, GQI Tx descriptors only support 16-bit packet and segment
lengths, and packets exceeding sw_ring or FIFO capacity previously
stalled the queue indefinitely on backpressure checks.
Widen the length parameter of gve_tx_alloc_from_fifo() from uint16_t to
uint32_t, and validate each packet up front before consuming ring or
FIFO resources. Drop, free, and count in invalid_pkts and errors any
packet that is empty, exceeds UINT16_MAX bytes, lacks TSO headers or
payload (hlen == 0 || pkt_len <= hlen), exceeds sw_ring capacity
(nb_segs > nb_tx_desc - 1), or requires more FIFO space than fifo_size.
Fixes: a46583cf43c8 ("net/gve: support Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Jasper Tran O'Leary <jtranoleary@google.com>
---
drivers/net/gve/gve_tx.c | 59 ++++++++++++++++++++++++++++++----------
1 file changed, 45 insertions(+), 14 deletions(-)
diff --git a/drivers/net/gve/gve_tx.c b/drivers/net/gve/gve_tx.c
index bf778a86e6..aa4fba07fd 100644
--- a/drivers/net/gve/gve_tx.c
+++ b/drivers/net/gve/gve_tx.c
@@ -233,7 +233,7 @@ gve_tx_reclaim_fifo_qpl(struct gve_tx_queue *txq, uint32_t tx_tail,
}
static inline uint64_t
-gve_tx_alloc_from_fifo(struct gve_tx_queue *txq, uint16_t tx_id, uint16_t len)
+gve_tx_alloc_from_fifo(struct gve_tx_queue *txq, uint16_t tx_id, uint32_t len)
{
uint32_t head = txq->fifo_head;
uint32_t size = txq->fifo_size;
@@ -268,6 +268,34 @@ gve_tx_alloc_from_fifo(struct gve_tx_queue *txq, uint16_t tx_id, uint16_t len)
return fifo_addr;
}
+static inline bool
+gve_tx_validate_pkt_limits_qpl(const struct gve_tx_queue *txq,
+ const struct rte_mbuf *tx_pkt,
+ uint64_t ol_flags, uint32_t hlen)
+{
+ uint32_t fifo_needed;
+
+ if (unlikely(tx_pkt->pkt_len == 0 || tx_pkt->pkt_len > UINT16_MAX))
+ return false;
+
+ if (unlikely(tx_pkt->nb_segs > txq->nb_tx_desc - 1))
+ return false;
+
+ if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
+ if (unlikely(hlen == 0 || tx_pkt->pkt_len <= hlen))
+ return false;
+ fifo_needed = RTE_ALIGN(hlen, RTE_CACHE_LINE_SIZE) +
+ RTE_ALIGN(tx_pkt->pkt_len - hlen, RTE_CACHE_LINE_SIZE);
+ } else {
+ fifo_needed = RTE_ALIGN(tx_pkt->pkt_len, RTE_CACHE_LINE_SIZE);
+ }
+
+ if (unlikely(fifo_needed > txq->fifo_size))
+ return false;
+
+ return true;
+}
+
static inline uint16_t
gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
{
@@ -303,6 +331,22 @@ gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
tx_pkt = *tx_pkts++;
ol_flags = tx_pkt->ol_flags;
+ tx_offload.l2_len = tx_pkt->l2_len;
+ tx_offload.l3_len = tx_pkt->l3_len;
+ tx_offload.l4_len = tx_pkt->l4_len;
+ tx_offload.tso_segsz = tx_pkt->tso_segsz;
+
+ hlen = ol_flags & RTE_MBUF_F_TX_TCP_SEG ?
+ (uint32_t)(tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len) :
+ tx_pkt->pkt_len;
+
+ if (unlikely(!gve_tx_validate_pkt_limits_qpl(txq, tx_pkt, ol_flags, hlen))) {
+ txq->stats.invalid_pkts++;
+ txq->stats.errors++;
+ rte_pktmbuf_free(tx_pkt);
+ continue;
+ }
+
if (txq->sw_nb_free < tx_pkt->nb_segs) {
gve_tx_clean_swr_qpl(txq);
if (txq->sw_nb_free < tx_pkt->nb_segs)
@@ -317,25 +361,12 @@ gve_tx_burst_qpl(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
if (txq->nb_free < nb_used)
goto end_of_tx;
- tx_offload.l2_len = tx_pkt->l2_len;
- tx_offload.l3_len = tx_pkt->l3_len;
- tx_offload.l4_len = tx_pkt->l4_len;
- tx_offload.tso_segsz = tx_pkt->tso_segsz;
-
first = tx_pkt;
txd = &txr[tx_id];
- hlen = ol_flags & RTE_MBUF_F_TX_TCP_SEG ?
- (uint32_t)(tx_offload.l2_len + tx_offload.l3_len + tx_offload.l4_len) :
- tx_pkt->pkt_len;
if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
uint32_t data_len, need;
- if (unlikely(tx_pkt->pkt_len <= hlen)) {
- rte_pktmbuf_free(tx_pkt);
- txq->stats.errors++;
- continue;
- }
data_len = tx_pkt->pkt_len - hlen;
need = RTE_ALIGN(hlen, RTE_CACHE_LINE_SIZE) +
RTE_ALIGN(data_len, RTE_CACHE_LINE_SIZE);
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 05/12] net/gve: do not count unsent DQO Tx packets as oerrors
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (3 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 04/12] net/gve: fix integer truncation in GQI QPL Tx path Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 06/12] net/gve: disable unsupported TCP LRO offload Joshua Washington
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Jeroen de Borst, Junfeng Guo, Rushil Gupta
Cc: dev, stable, Jasper Tran O'Leary
In DPDK, unsent packets in a burst due to ring exhaustion are returned
to the application. Such packets should not be counted as errors, as
they were not dropped, and the packets themselves have no errors.
gve_tx_burst_dqo() erroneously counts such packets as oerrors,
artificially inflating the statistic.
Count only packets actually dropped and freed by the driver
(nb_tx - nb_sent) in errors.
Fixes: 98e3bbc9159b ("net/gve: support basic stats for DQO")
Cc: stable@dpdk.org
Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Jasper Tran O'Leary <jtranoleary@google.com>
---
drivers/net/gve/gve_tx_dqo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index 72730eb1c5..db432fd2f6 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -480,7 +480,7 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
txq->stats.packets += nb_sent;
txq->stats.bytes += bytes;
- txq->stats.errors += nb_pkts - nb_sent;
+ txq->stats.errors += nb_tx - nb_sent;
}
return nb_tx;
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 06/12] net/gve: disable unsupported TCP LRO offload
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (4 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 05/12] net/gve: do not count unsent DQO Tx packets as oerrors Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 07/12] net/gve: drop multi-seg Rx packets if scatter is off Joshua Washington
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Junfeng Guo, Xiaoyun Li
Cc: dev, Jasper Tran O'Leary, stable
From: Jasper Tran O'Leary <jtranoleary@google.com>
Currently, the driver advertises TCP large receive offload (LRO) on DQO
devices and enables hardware receive side coalescing (RSC) when
requested, even though the receive datapath does not yet handle
coalesced packets.
Stop advertising TCP LRO and leave hardware RSC disabled until full LRO
support is implemented.
Fixes: 71dea04cdf9a ("net/gve: support device info and configure")
Cc: stable@dpdk.org
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
drivers/net/gve/base/gve_adminq.c | 1 -
drivers/net/gve/gve_ethdev.c | 6 +-----
drivers/net/gve/gve_ethdev.h | 1 -
3 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/gve/base/gve_adminq.c b/drivers/net/gve/base/gve_adminq.c
index 65e865939f..893763f3a3 100644
--- a/drivers/net/gve/base/gve_adminq.c
+++ b/drivers/net/gve/base/gve_adminq.c
@@ -799,7 +799,6 @@ static int gve_adminq_create_rx_queue(struct gve_priv *priv, u32 queue_index)
cpu_to_be16(rxq->rx_buf_len);
cmd.create_rx_queue.rx_buff_ring_size =
cpu_to_be16(rxq->nb_rx_desc);
- cmd.create_rx_queue.enable_rsc = !!(priv->enable_rsc);
}
return gve_adminq_issue_cmd(priv, &cmd);
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index e71f97646f..39921c14c8 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -255,9 +255,6 @@ gve_dev_configure(struct rte_eth_dev *dev)
priv->rss_config.alg = GVE_RSS_HASH_TOEPLITZ;
}
- if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TCP_LRO)
- priv->enable_rsc = 1;
-
if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
err = rte_mbuf_dyn_rx_timestamp_register(&priv->mbuf_timestamp_offset,
&priv->mbuf_timestamp_mask);
@@ -968,8 +965,7 @@ gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->rx_offload_capa |=
RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |
RTE_ETH_RX_OFFLOAD_UDP_CKSUM |
- RTE_ETH_RX_OFFLOAD_TCP_CKSUM |
- RTE_ETH_RX_OFFLOAD_TCP_LRO;
+ RTE_ETH_RX_OFFLOAD_TCP_CKSUM;
}
dev_info->default_rxconf = (struct rte_eth_rxconf) {
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index 0370dc1479..f13ce31223 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -350,7 +350,6 @@ struct gve_priv {
uint16_t default_tx_num_queues; /* default num tx queues to set up */
uint16_t default_rx_num_queues; /* default num rx queues to set up */
enum gve_queue_format queue_format; /* see enum gve_queue_format */
- uint8_t enable_rsc;
uint16_t max_nb_txq;
uint16_t max_nb_rxq;
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 07/12] net/gve: drop multi-seg Rx packets if scatter is off
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (5 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 06/12] net/gve: disable unsupported TCP LRO offload Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 08/12] net/gve: reject non-power-of-2 ring sizes on DQO Joshua Washington
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Rushil Gupta, Junfeng Guo, Jeroen de Borst,
Jasper Tran O'Leary
Cc: dev, stable
From: Jasper Tran O'Leary <jtranoleary@google.com>
Lowering the guest MTU does not lower the host receive filter below the
VPC MTU. Sending the AdminQ command that sets the driver MTU does not
restrict that host filter.
For example, if an application starts on a jumbo-MTU VPC with a
1500-byte guest MTU, default 2 KB mbufs, and scatter RX disabled, then
the device can still split incoming frames larger than the receive
buffer length (rx_buf_len) across multiple RX buffers.
While GQI already drops multi-buffer frames when scatter RX is disabled,
DQO still delivers each fragment as a separate corrupt mbuf. Fix DQO by
rejecting RX buffers smaller than the device maximum frame size at queue
setup, and by checking the end-of-packet indicator during burst
processing to drop multi-buffer frames across bursts. Count one RX error
and free all associated mbufs per dropped packet, track the device-level
scatter flag, and clear partial packet context on queue reset and
teardown for both GQI and DQO.
Fixes: 496d4d2c8b54 ("net/gve: support jumbo frame for GQI")
Fixes: 45da16b5b181 ("net/gve: support basic Rx data path for DQO")
Fixes: 52e58f2ab666 ("net/gve: free context mbuf on later segment drop")
Cc: stable@dpdk.org
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
drivers/net/gve/gve_ethdev.c | 3 ++
drivers/net/gve/gve_ethdev.h | 17 ++++++++-
drivers/net/gve/gve_rx.c | 34 ++++++++---------
drivers/net/gve/gve_rx_dqo.c | 72 ++++++++++++++++++++++++++----------
4 files changed, 89 insertions(+), 37 deletions(-)
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 39921c14c8..f27932aa89 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -255,6 +255,9 @@ gve_dev_configure(struct rte_eth_dev *dev)
priv->rss_config.alg = GVE_RSS_HASH_TOEPLITZ;
}
+ dev->data->scattered_rx =
+ !!(dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SCATTER);
+
if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
err = rte_mbuf_dyn_rx_timestamp_register(&priv->mbuf_timestamp_offset,
&priv->mbuf_timestamp_mask);
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index f13ce31223..46e4d1edc0 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -210,6 +210,15 @@ struct gve_rx_ctx {
bool drop_pkt;
};
+static inline void
+gve_rx_ctx_clear(struct gve_rx_ctx *ctx)
+{
+ ctx->mbuf_head = NULL;
+ ctx->mbuf_tail = NULL;
+ ctx->total_frags = 0;
+ ctx->drop_pkt = false;
+}
+
struct gve_rx_queue {
volatile struct gve_rx_desc *rx_desc_ring;
volatile union gve_rx_data_slot *rx_data_ring;
@@ -263,7 +272,7 @@ struct gve_rx_queue {
struct rte_mbuf **refill_bufs;
uint8_t is_gqi_qpl;
- /* the port enabled RTE_ETH_RX_OFFLOAD_SCATTER (GQI) */
+ /* the port enabled RTE_ETH_RX_OFFLOAD_SCATTER */
bool scatter;
bool timestamp_enabled;
};
@@ -466,6 +475,12 @@ 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_rx_dqo_needs_scatter(uint16_t mtu, uint16_t rx_buf_len)
+{
+ return (uint32_t)mtu + RTE_ETHER_HDR_LEN > 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 1985e9ad02..05430621de 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -138,10 +138,10 @@ gve_rx(struct gve_rx_queue *rxq, volatile struct gve_rx_desc *rxd, uint16_t rx_i
bool is_first_frag = ctx->total_frags == 0;
struct rte_mbuf *rxe;
- if (ctx->drop_pkt)
+ if (unlikely(ctx->drop_pkt))
goto drop_frag;
- if (rxd->flags_seq & GVE_RXF_ERR) {
+ if (unlikely(rxd->flags_seq & GVE_RXF_ERR)) {
ctx->drop_pkt = true;
rxq->stats.errors++;
goto drop_frag;
@@ -150,7 +150,7 @@ gve_rx(struct gve_rx_queue *rxq, volatile struct gve_rx_desc *rxd, uint16_t rx_i
/* The device chains a frame larger than one Rx buffer whatever MTU
* it was given, so drop it unless the application enabled scatter.
*/
- if (is_first_frag && !is_last_frag && !rxq->scatter) {
+ if (unlikely(is_first_frag && !is_last_frag && !rxq->scatter)) {
ctx->drop_pkt = true;
rxq->stats.errors++;
goto drop_frag;
@@ -188,26 +188,19 @@ gve_rx(struct gve_rx_queue *rxq, volatile struct gve_rx_desc *rxd, uint16_t rx_i
}
}
- goto finish_frag;
+ ctx->total_frags++;
+ return is_last_frag;
drop_frag:
/* The refill puts a new mbuf in this slot, so free the old one. */
- rte_pktmbuf_free(rxq->sw_ring[rx_id]);
- rxq->sw_ring[rx_id] = NULL;
-finish_frag:
+ if (rxq->sw_ring[rx_id] != NULL) {
+ rte_pktmbuf_free_seg(rxq->sw_ring[rx_id]);
+ rxq->sw_ring[rx_id] = NULL;
+ }
ctx->total_frags++;
return is_last_frag;
}
-static void
-gve_rx_ctx_clear(struct gve_rx_ctx *ctx)
-{
- ctx->mbuf_head = NULL;
- ctx->mbuf_tail = NULL;
- ctx->drop_pkt = false;
- ctx->total_frags = 0;
-}
-
uint16_t
gve_rx_burst(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
{
@@ -228,7 +221,7 @@ gve_rx_burst(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
if (gve_rx(rxq, rxd, rx_id)) {
if (!ctx->drop_pkt)
rx_pkts[nb_rx++] = ctx->mbuf_head;
- else
+ else if (ctx->mbuf_head != NULL)
rte_pktmbuf_free(ctx->mbuf_head);
rxq->nb_avail += ctx->total_frags;
gve_rx_ctx_clear(ctx);
@@ -279,6 +272,7 @@ gve_reset_rxq(struct gve_rx_queue *rxq)
rxq->next_avail = 0;
rxq->nb_avail = rxq->nb_rx_desc;
rxq->expected_seqno = 1;
+ gve_rx_ctx_clear(&rxq->ctx);
}
static inline void
@@ -296,6 +290,10 @@ gve_release_rxq_mbufs(struct gve_rx_queue *rxq)
}
}
+ if (rxq->ctx.mbuf_head != NULL)
+ rte_pktmbuf_free(rxq->ctx.mbuf_head);
+ gve_rx_ctx_clear(&rxq->ctx);
+
rxq->nb_avail = rxq->nb_rx_desc;
}
@@ -402,6 +400,8 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
rxq->rx_buf_len = rx_buf_len;
rxq->scatter = !!(offloads & RTE_ETH_RX_OFFLOAD_SCATTER);
+ if (rxq->scatter)
+ dev->data->scattered_rx = 1;
/* Allocate software ring */
rxq->sw_ring = rte_zmalloc_socket("gve rx sw ring", sizeof(struct rte_mbuf *) * nb_desc,
diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
index 03c62edee6..0d6665307b 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -168,6 +168,7 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
uint16_t rx_id;
uint16_t nb_rx;
uint64_t bytes;
+ bool is_eop;
bytes = 0;
nb_rx = 0;
@@ -192,7 +193,6 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rte_io_rmb();
- rxq->nb_rx_hold++;
rx_id++;
if (rx_id == rxq->nb_rx_desc) {
rx_id = 0;
@@ -200,19 +200,34 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
}
rx_buf_id = rte_le_to_cpu_16(rx_desc->buf_id);
+ is_eop = rx_desc->end_of_packet != 0;
+ rxm = NULL;
+
if (unlikely(rx_buf_id >= rxq->nb_rx_desc)) {
- PMD_DRV_DP_LOG(ERR, "Invalid buf_id %d", rx_buf_id);
- continue;
+ PMD_DRV_DP_LOG(ERR, "Invalid rx_buf_id %u on queue %u",
+ rx_buf_id, rxq->queue_id);
+ if (!rxq->ctx.drop_pkt) {
+ rxq->stats.errors++;
+ rxq->ctx.drop_pkt = true;
+ }
+ } else {
+ rxm = rxq->sw_ring[rx_buf_id];
+ rxq->sw_ring[rx_buf_id] = NULL;
+ gve_completed_buf_list_push(rxq, rx_buf_id);
+ rxq->nb_rx_hold++;
}
- rxm = rxq->sw_ring[rx_buf_id];
- gve_completed_buf_list_push(rxq, rx_buf_id);
- rxq->sw_ring[rx_buf_id] = NULL;
-
- /* Free buffer and report error. */
- if (unlikely(rx_desc->rx_error)) {
+ if (!rxq->ctx.drop_pkt &&
+ unlikely(rx_desc->rx_error != 0 || !is_eop)) {
rxq->stats.errors++;
- rte_pktmbuf_free(rxm);
+ rxq->ctx.drop_pkt = true;
+ }
+
+ if (unlikely(rxq->ctx.drop_pkt)) {
+ if (rxm != NULL)
+ rte_pktmbuf_free(rxm);
+ if (is_eop)
+ gve_rx_ctx_clear(&rxq->ctx);
continue;
}
@@ -239,9 +254,8 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
bytes += pkt_len;
}
+ rxq->rx_tail = rx_id;
if (nb_rx > 0) {
- rxq->rx_tail = rx_id;
-
rxq->stats.packets += nb_rx;
rxq->stats.bytes += bytes;
}
@@ -262,6 +276,8 @@ gve_release_rxq_mbufs_dqo(struct gve_rx_queue *rxq)
}
}
+ gve_rx_ctx_clear(&rxq->ctx);
+
rxq->nb_avail = rxq->nb_rx_desc;
}
@@ -316,6 +332,17 @@ gve_reset_rx_ring_state_dqo(struct gve_rx_queue *rxq)
rxq->rx_tail = 0;
rxq->cur_gen_bit = 1;
+ gve_rx_ctx_clear(&rxq->ctx);
+}
+
+static uint16_t
+gve_rx_buf_len_dqo(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_DQO,
+ RTE_ALIGN_FLOOR(mbuf_len, GVE_RX_BUF_ALIGN_DQO));
}
int
@@ -328,9 +355,21 @@ gve_rx_queue_setup_dqo(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;
int err = 0;
+ /* Without Rx scatter support on DQO, each Rx buffer must fit any
+ * incoming frame up to the device maximum MTU.
+ */
+ rx_buf_len = gve_rx_buf_len_dqo(pool);
+ if (gve_rx_dqo_needs_scatter(hw->max_mtu, rx_buf_len)) {
+ PMD_DRV_LOG(ERR,
+ "Max MTU %u needs at least %u byte Rx buffers (got %u)",
+ hw->max_mtu, hw->max_mtu + RTE_ETHER_HDR_LEN,
+ rx_buf_len);
+ return -EINVAL;
+ }
+
/* Free memory if needed */
if (dev->data->rx_queues[queue_id]) {
gve_rx_queue_release_dqo(dev, queue_id);
@@ -371,12 +410,7 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
rxq->mpool = pool;
rxq->hw = hw;
rxq->ntfy_addr = &hw->db_bar[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_DQO,
- RTE_ALIGN_FLOOR(mbuf_len, GVE_RX_BUF_ALIGN_DQO));
+ rxq->rx_buf_len = rx_buf_len;
/* Allocate software ring */
rxq->sw_ring = rte_zmalloc_socket("gve rx sw ring",
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 08/12] net/gve: reject non-power-of-2 ring sizes on DQO
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (6 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 07/12] net/gve: drop multi-seg Rx packets if scatter is off Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 09/12] net/gve: properly handle RSS realloc failures Joshua Washington
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Junfeng Guo, Jeroen de Borst, Rushil Gupta
Cc: dev, Jasper Tran O'Leary, stable
From: Jasper Tran O'Leary <jtranoleary@google.com>
Both DQO RX and TX datapaths wrap ring indices by bitmasking with one
less than the ring size, and the hardware specification requires all
descriptor, buffer, and completion rings to be power-of-2 sized. While
GQI queue setup enforces this requirement, DQO RX and TX queue setup
omit the check.
Fix DQO RX and TX queue setup by rejecting non-power-of-2 descriptor
counts. Also validate TX descriptor thresholds before releasing an
existing queue or allocating queue state so invalid thresholds do not
leak memory.
Fixes: 1dc00f4fc74b ("net/gve: add Rx queue setup for DQO")
Fixes: a14d391c7d99 ("net/gve: add Tx queue setup for DQO")
Cc: stable@dpdk.org
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
drivers/net/gve/gve_rx_dqo.c | 7 +++++++
drivers/net/gve/gve_tx_dqo.c | 23 +++++++++++++++--------
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
index 0d6665307b..c4fe9692a7 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -358,6 +358,13 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
uint16_t rx_buf_len;
int err = 0;
+ /* Ring size is required to be a power of two. */
+ if (!rte_is_power_of_2(nb_desc)) {
+ PMD_DRV_LOG(ERR, "Invalid ring size %u. GVE ring size must be a power of 2.",
+ nb_desc);
+ return -EINVAL;
+ }
+
/* Without Rx scatter support on DQO, each Rx buffer must fit any
* incoming frame up to the device maximum MTU.
*/
diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index db432fd2f6..45559d78ce 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -595,6 +595,21 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
uint16_t sw_size;
int err = 0;
+ /* Ring size is required to be a power of two. */
+ if (!rte_is_power_of_2(nb_desc)) {
+ PMD_DRV_LOG(ERR, "Invalid ring size %u. GVE ring size must be a power of 2.",
+ nb_desc);
+ return -EINVAL;
+ }
+
+ /* need to check free_thresh here */
+ free_thresh = conf->tx_free_thresh ?
+ conf->tx_free_thresh : GVE_DEFAULT_TX_FREE_THRESH;
+ rs_thresh = conf->tx_rs_thresh ?
+ conf->tx_rs_thresh : GVE_DEFAULT_TX_RS_THRESH;
+ if (check_tx_thresh_dqo(nb_desc, rs_thresh, free_thresh))
+ return -EINVAL;
+
/* Free memory if needed. */
if (dev->data->tx_queues[queue_id]) {
gve_tx_queue_release_dqo(dev, queue_id);
@@ -610,14 +625,6 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
return -ENOMEM;
}
- /* need to check free_thresh here */
- free_thresh = conf->tx_free_thresh ?
- conf->tx_free_thresh : GVE_DEFAULT_TX_FREE_THRESH;
- rs_thresh = conf->tx_rs_thresh ?
- conf->tx_rs_thresh : GVE_DEFAULT_TX_RS_THRESH;
- if (check_tx_thresh_dqo(nb_desc, rs_thresh, free_thresh))
- return -EINVAL;
-
txq->nb_tx_desc = nb_desc;
txq->nb_complq_desc = nb_desc * DQO_TX_MULTIPLIER;
txq->free_thresh = free_thresh;
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 09/12] net/gve: properly handle RSS realloc failures
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (7 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 08/12] net/gve: reject non-power-of-2 ring sizes on DQO Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 10/12] net/gve: reject unsupported flow attributes and item masks Joshua Washington
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Jeroen de Borst, Rushil Gupta
Cc: dev, Jasper Tran O'Leary, stable
From: Jasper Tran O'Leary <jtranoleary@google.com>
Updating the cached private RSS configuration overwrites the key and
redirection table pointers directly with the reallocation result and
updates metadata sizes before allocations succeed. If reallocation fails
under memory pressure, the previous buffers are leaked and the cached
configuration retains NULL pointers alongside non-zero sizes, causing
subsequent RSS queries or updates to dereference NULL.
Move private RSS cache management out of gve_adminq_configure_rss() into
a wrapper in gve_ethdev.c so the base AdminQ helper only sends the
device command. Pre-allocate the replacement cache with
gve_init_rss_config() before issuing the AdminQ command, and transfer
ownership into priv->rss_config via gve_update_priv_rss_config() only
after the command succeeds, eliminating rte_realloc() and ensuring a
failed allocation never leaves the cache corrupted or out of sync with
the device. Also propagate gve_init_rss_config_from_priv() failure in
gve_dev_configure().
Fixes: d6ac6f456398 ("net/gve: add RSS helpers")
Cc: stable@dpdk.org
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
drivers/net/gve/base/gve_adminq.c | 6 ++--
drivers/net/gve/gve_ethdev.c | 41 ++++++++++++++++++++++--
| 53 ++++++-------------------------
| 7 ++--
4 files changed, 54 insertions(+), 53 deletions(-)
diff --git a/drivers/net/gve/base/gve_adminq.c b/drivers/net/gve/base/gve_adminq.c
index 893763f3a3..d077c40b9a 100644
--- a/drivers/net/gve/base/gve_adminq.c
+++ b/drivers/net/gve/base/gve_adminq.c
@@ -8,7 +8,6 @@
#include "../gve_ethdev.h"
#include "gve_adminq.h"
#include "gve_register.h"
-#include "gve_rss.h"
#define GVE_MAX_ADMINQ_RELEASE_CHECK 500
#define GVE_ADMINQ_SLEEP_LEN 20
@@ -1244,7 +1243,8 @@ int gve_adminq_configure_rss(struct gve_priv *priv,
int err = 0;
int i;
- if (!rss_config->indir_size || !rss_config->key_size)
+ if (!rss_config || !rss_config->indir_size || !rss_config->key_size ||
+ !rss_config->indir || !rss_config->key)
return -EINVAL;
indir = gve_alloc_dma_mem(&indirection_table_dma_mem,
@@ -1278,8 +1278,6 @@ int gve_adminq_configure_rss(struct gve_priv *priv,
};
err = gve_adminq_execute_cmd(priv, &cmd);
- if (err == 0)
- gve_update_priv_rss_config(priv, rss_config);
out:
if (indir)
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index f27932aa89..dcb270d269 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -275,7 +275,10 @@ gve_dev_configure(struct rte_eth_dev *dev)
if (err == 0) {
struct gve_rss_config update_reta_config;
- gve_init_rss_config_from_priv(priv, &update_reta_config);
+ err = gve_init_rss_config_from_priv(priv, &update_reta_config);
+ if (err != 0)
+ return err;
+
gve_generate_rss_reta(dev, &update_reta_config);
err = process_priv->ctrl_ops->configure_rss(priv, &update_reta_config);
@@ -1707,6 +1710,40 @@ gve_adminq_get_device_properties(struct gve_priv *priv)
return gve_adminq_describe_device(priv);
}
+static int
+gve_configure_rss_adminq(struct gve_priv *priv,
+ struct gve_rss_config *rss_config)
+{
+ struct gve_rss_config new_cache = {0};
+ int err;
+
+ if (priv == NULL || rss_config == NULL ||
+ rss_config->key_size == 0 || rss_config->key == NULL ||
+ rss_config->indir_size == 0 || rss_config->indir == NULL)
+ return -EINVAL;
+
+ err = gve_init_rss_config(&new_cache, rss_config->key_size,
+ rss_config->indir_size);
+ if (err != 0)
+ return err;
+
+ err = gve_adminq_configure_rss(priv, rss_config);
+ if (err != 0) {
+ gve_free_rss_config(&new_cache);
+ return err;
+ }
+
+ new_cache.hash_types = rss_config->hash_types;
+ new_cache.alg = rss_config->alg;
+ memcpy(new_cache.key, rss_config->key,
+ (size_t)rss_config->key_size * sizeof(*new_cache.key));
+ memcpy(new_cache.indir, rss_config->indir,
+ (size_t)rss_config->indir_size * sizeof(*new_cache.indir));
+
+ gve_update_priv_rss_config(priv, &new_cache);
+ return 0;
+}
+
static const struct gve_ctrl_ops gve_adminq_ops = {
.init_ctrl_plane = gve_adminq_alloc,
.free_ctrl_plane = gve_adminq_free,
@@ -1718,7 +1755,7 @@ static const struct gve_ctrl_ops gve_adminq_ops = {
.create_rx_queues = gve_adminq_create_rx_queues,
.destroy_rx_queues = gve_adminq_destroy_rx_queues,
.report_link_speed = gve_adminq_report_link_speed,
- .configure_rss = gve_adminq_configure_rss,
+ .configure_rss = gve_configure_rss_adminq,
.add_flow_rule = gve_adminq_add_flow_rule,
.del_flow_rule = gve_adminq_del_flow_rule,
.reset_flow_rules = gve_adminq_reset_flow_rules,
--git a/drivers/net/gve/gve_rss.c b/drivers/net/gve/gve_rss.c
index 691ec6dab1..a6863aa7a5 100644
--- a/drivers/net/gve/gve_rss.c
+++ b/drivers/net/gve/gve_rss.c
@@ -75,53 +75,18 @@ gve_free_rss_config(struct gve_rss_config *gve_rss_conf)
memset(gve_rss_conf, 0, sizeof(*gve_rss_conf));
}
-int
-gve_update_priv_rss_config(struct gve_priv *priv, struct gve_rss_config *config)
+void
+gve_update_priv_rss_config(struct gve_priv *priv,
+ struct gve_rss_config *new_config)
{
- struct gve_rss_config *priv_config = &priv->rss_config;
- int key_bytes, indir_bytes;
-
- if (!config)
- return -EINVAL;
- if (config->key_size == 0 || !config->key)
- return -EINVAL;
- if (config->indir_size == 0 || !config->indir)
- return -EINVAL;
-
- priv_config->hash_types = config->hash_types;
- priv_config->alg = config->alg;
-
- priv_config->key_size = config->key_size;
- key_bytes = priv_config->key_size * sizeof(*priv_config->key);
- if (!priv_config->key)
- priv_config->key = rte_zmalloc("priv rss key", key_bytes,
- RTE_CACHE_LINE_SIZE);
- else
- priv_config->key = rte_realloc(priv_config->key, key_bytes,
- RTE_CACHE_LINE_SIZE);
- if (!priv_config->key)
- return -ENOMEM;
-
- priv_config->indir_size = config->indir_size;
- indir_bytes = priv_config->indir_size * sizeof(*priv_config->indir);
- if (!priv_config->indir)
- priv_config->indir = rte_zmalloc("priv rss reta", indir_bytes,
- RTE_CACHE_LINE_SIZE);
- else
- priv_config->indir = rte_realloc(priv_config->indir,
- indir_bytes, RTE_CACHE_LINE_SIZE);
-
- if (!priv_config->indir)
- return -ENOMEM;
-
- memcpy(priv_config->indir, config->indir,
- config->indir_size * sizeof(*priv_config->indir));
- memcpy(priv_config->key, config->key,
- config->key_size * sizeof(*priv_config->key));
+ if (priv == NULL || new_config == NULL ||
+ new_config == &priv->rss_config)
+ return;
+ gve_free_rss_config(&priv->rss_config);
+ priv->rss_config = *new_config;
+ memset(new_config, 0, sizeof(*new_config));
priv->rss_cache_dirty = false;
-
- return 0;
}
int
--git a/drivers/net/gve/gve_rss.h b/drivers/net/gve/gve_rss.h
index 64ac0514b9..aef92d1f16 100644
--- a/drivers/net/gve/gve_rss.h
+++ b/drivers/net/gve/gve_rss.h
@@ -56,11 +56,12 @@ void
gve_free_rss_config(struct gve_rss_config *gve_rss_conf);
/**
- * Updates the rss_config stored in `priv` with the contents of `config`.
+ * Updates the rss_config stored in `priv` by taking ownership of the
+ * buffers in `new_config` and clearing `new_config`. This cannot fail.
*/
-int
+void
gve_update_priv_rss_config(struct gve_priv *priv,
- struct gve_rss_config *config);
+ struct gve_rss_config *new_config);
/**
* Updates the RSS key stored in `gve_rss_conf`. It is prioritized as follows:
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 10/12] net/gve: reject unsupported flow attributes and item masks
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (8 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 09/12] net/gve: properly handle RSS realloc failures Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 11/12] net/gve: fix mbuf leak on GQI Rx queue start Joshua Washington
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Jasper Tran O'Leary; +Cc: dev, stable
From: Jasper Tran O'Leary <jtranoleary@google.com>
Flow attribute and pattern validation silently ignores several match
criteria which are either malformed or unsupported by gVNIC instead of
returning an error.
A rule specifying a non-zero flow group or non-zero mask bits on header
fields which are not currently supported on gVNIC (such as TCP flags or
IP TTL) is incorrectly accepted and programmed into group 0 with only
supported 5-tuple fields, creating a broader rule than requested.
On the other hand, rules which pass a mask with a null spec and rules
which include non-zero reserved attribute bits are invalid by definition
and should be rejected.
Fix flow validation by rejecting non-zero flow group and reserved
attributes, rejecting masks without a spec, and validating item masks
against each protocol's supported fields. Also mask rule keys with the
active mask so unmasked spec bits are cleared, and document the flow
group limitation.
Fixes: 82ef40fb2e7e ("net/gve: support flow API")
Cc: stable@dpdk.org
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
doc/guides/nics/gve.rst | 1 +
drivers/net/gve/gve_flow_rule.c | 241 +++++++++++++++++++++++++-------
2 files changed, 192 insertions(+), 50 deletions(-)
diff --git a/doc/guides/nics/gve.rst b/doc/guides/nics/gve.rst
index cf6a38f97a..5a1efad05b 100644
--- a/doc/guides/nics/gve.rst
+++ b/doc/guides/nics/gve.rst
@@ -130,6 +130,7 @@ Security Protocols
- Flow steering operations are only supported in the primary process.
- Only ingress flow rules are allowed.
+- Flow groups are not supported (must be 0).
- Flow priorities are not supported (must be 0).
- Masking is limited to full matches i.e. ``0x00...0`` or ``0xFF...F``.
diff --git a/drivers/net/gve/gve_flow_rule.c b/drivers/net/gve/gve_flow_rule.c
index aec039c32b..e59e026bc0 100644
--- a/drivers/net/gve/gve_flow_rule.c
+++ b/drivers/net/gve/gve_flow_rule.c
@@ -35,127 +35,246 @@ gve_validate_flow_attr(const struct rte_flow_attr *attr,
"Priority levels are not supported");
return -EINVAL;
}
+ if (attr->group != 0) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ATTR_GROUP, attr,
+ "Flow groups are not supported");
+ return -EINVAL;
+ }
+ if (attr->reserved != 0) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ATTR, attr,
+ "Reserved flow attributes must be zero");
+ return -EINVAL;
+ }
return 0;
}
-static void
+static bool
+gve_flow_mask_is_supported(const void *mask, const void *sup_mask, size_t size)
+{
+ const uint8_t *m = mask;
+ const uint8_t *s = sup_mask;
+ size_t i;
+
+ for (i = 0; i < size; i++) {
+ if ((m[i] & ~s[i]) != 0)
+ return false;
+ }
+
+ return true;
+}
+
+static int
gve_parse_ipv4(const struct rte_flow_item *item,
- struct gve_flow_rule_params *rule)
+ struct gve_flow_rule_params *rule,
+ struct rte_flow_error *error)
{
- if (item->spec) {
+ if (item->spec != NULL) {
const struct rte_flow_item_ipv4 *spec = item->spec;
const struct rte_flow_item_ipv4 *mask =
- item->mask ? item->mask : &rte_flow_item_ipv4_mask;
+ item->mask != NULL ? item->mask :
+ &rte_flow_item_ipv4_mask;
+
+ if (item->mask != NULL &&
+ !gve_flow_mask_is_supported(mask, &rte_flow_item_ipv4_mask,
+ sizeof(*mask))) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_MASK, item,
+ "Unsupported fields set in item mask");
+ return -EINVAL;
+ }
- rule->key.src_ip[0] = spec->hdr.src_addr;
- rule->key.dst_ip[0] = spec->hdr.dst_addr;
+ rule->key.src_ip[0] = spec->hdr.src_addr & mask->hdr.src_addr;
+ rule->key.dst_ip[0] = spec->hdr.dst_addr & mask->hdr.dst_addr;
rule->mask.src_ip[0] = mask->hdr.src_addr;
rule->mask.dst_ip[0] = mask->hdr.dst_addr;
}
+
+ return 0;
}
-static void
+static int
gve_parse_ipv6(const struct rte_flow_item *item,
- struct gve_flow_rule_params *rule)
+ struct gve_flow_rule_params *rule,
+ struct rte_flow_error *error)
{
- if (item->spec) {
+ if (item->spec != NULL) {
const struct rte_flow_item_ipv6 *spec = item->spec;
const struct rte_flow_item_ipv6 *mask =
- item->mask ? item->mask : &rte_flow_item_ipv6_mask;
+ item->mask != NULL ? item->mask :
+ &rte_flow_item_ipv6_mask;
const __be32 *src_ip = (const __be32 *)&spec->hdr.src_addr;
const __be32 *src_mask = (const __be32 *)&mask->hdr.src_addr;
const __be32 *dst_ip = (const __be32 *)&spec->hdr.dst_addr;
const __be32 *dst_mask = (const __be32 *)&mask->hdr.dst_addr;
int i;
+ if (item->mask != NULL &&
+ !gve_flow_mask_is_supported(mask, &rte_flow_item_ipv6_mask,
+ sizeof(*mask))) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_MASK, item,
+ "Unsupported fields set in item mask");
+ return -EINVAL;
+ }
+
/*
* The device expects IPv6 addresses as an array of 4 32-bit words
* in reverse word order (the MSB word at index 3 and the LSB word
* at index 0). We must reverse the DPDK network byte order array.
*/
for (i = 0; i < 4; i++) {
- rule->key.src_ip[3 - i] = src_ip[i];
- rule->key.dst_ip[3 - i] = dst_ip[i];
+ rule->key.src_ip[3 - i] = src_ip[i] & src_mask[i];
+ rule->key.dst_ip[3 - i] = dst_ip[i] & dst_mask[i];
rule->mask.src_ip[3 - i] = src_mask[i];
rule->mask.dst_ip[3 - i] = dst_mask[i];
}
}
+
+ return 0;
}
-static void
+static int
gve_parse_udp(const struct rte_flow_item *item,
- struct gve_flow_rule_params *rule)
+ struct gve_flow_rule_params *rule,
+ struct rte_flow_error *error)
{
- if (item->spec) {
+ if (item->spec != NULL) {
const struct rte_flow_item_udp *spec = item->spec;
const struct rte_flow_item_udp *mask =
- item->mask ? item->mask : &rte_flow_item_udp_mask;
+ item->mask != NULL ? item->mask :
+ &rte_flow_item_udp_mask;
+
+ if (item->mask != NULL &&
+ !gve_flow_mask_is_supported(mask, &rte_flow_item_udp_mask,
+ sizeof(*mask))) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_MASK, item,
+ "Unsupported fields set in item mask");
+ return -EINVAL;
+ }
- rule->key.src_port = spec->hdr.src_port;
- rule->key.dst_port = spec->hdr.dst_port;
+ rule->key.src_port = spec->hdr.src_port & mask->hdr.src_port;
+ rule->key.dst_port = spec->hdr.dst_port & mask->hdr.dst_port;
rule->mask.src_port = mask->hdr.src_port;
rule->mask.dst_port = mask->hdr.dst_port;
}
+
+ return 0;
}
-static void
+static int
gve_parse_tcp(const struct rte_flow_item *item,
- struct gve_flow_rule_params *rule)
+ struct gve_flow_rule_params *rule,
+ struct rte_flow_error *error)
{
- if (item->spec) {
+ if (item->spec != NULL) {
const struct rte_flow_item_tcp *spec = item->spec;
const struct rte_flow_item_tcp *mask =
- item->mask ? item->mask : &rte_flow_item_tcp_mask;
+ item->mask != NULL ? item->mask :
+ &rte_flow_item_tcp_mask;
- rule->key.src_port = spec->hdr.src_port;
- rule->key.dst_port = spec->hdr.dst_port;
+ if (item->mask != NULL &&
+ !gve_flow_mask_is_supported(mask, &rte_flow_item_tcp_mask,
+ sizeof(*mask))) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_MASK, item,
+ "Unsupported fields set in item mask");
+ return -EINVAL;
+ }
+
+ rule->key.src_port = spec->hdr.src_port & mask->hdr.src_port;
+ rule->key.dst_port = spec->hdr.dst_port & mask->hdr.dst_port;
rule->mask.src_port = mask->hdr.src_port;
rule->mask.dst_port = mask->hdr.dst_port;
}
+
+ return 0;
}
-static void
+static int
gve_parse_sctp(const struct rte_flow_item *item,
- struct gve_flow_rule_params *rule)
+ struct gve_flow_rule_params *rule,
+ struct rte_flow_error *error)
{
- if (item->spec) {
+ if (item->spec != NULL) {
const struct rte_flow_item_sctp *spec = item->spec;
const struct rte_flow_item_sctp *mask =
- item->mask ? item->mask : &rte_flow_item_sctp_mask;
+ item->mask != NULL ? item->mask :
+ &rte_flow_item_sctp_mask;
- rule->key.src_port = spec->hdr.src_port;
- rule->key.dst_port = spec->hdr.dst_port;
+ if (item->mask != NULL &&
+ !gve_flow_mask_is_supported(mask, &rte_flow_item_sctp_mask,
+ sizeof(*mask))) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_MASK, item,
+ "Unsupported fields set in item mask");
+ return -EINVAL;
+ }
+
+ rule->key.src_port = spec->hdr.src_port & mask->hdr.src_port;
+ rule->key.dst_port = spec->hdr.dst_port & mask->hdr.dst_port;
rule->mask.src_port = mask->hdr.src_port;
rule->mask.dst_port = mask->hdr.dst_port;
}
+
+ return 0;
}
-static void
+static int
gve_parse_esp(const struct rte_flow_item *item,
- struct gve_flow_rule_params *rule)
+ struct gve_flow_rule_params *rule,
+ struct rte_flow_error *error)
{
- if (item->spec) {
+ if (item->spec != NULL) {
const struct rte_flow_item_esp *spec = item->spec;
const struct rte_flow_item_esp *mask =
- item->mask ? item->mask : &rte_flow_item_esp_mask;
+ item->mask != NULL ? item->mask :
+ &rte_flow_item_esp_mask;
+
+ if (item->mask != NULL &&
+ !gve_flow_mask_is_supported(mask, &rte_flow_item_esp_mask,
+ sizeof(*mask))) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_MASK, item,
+ "Unsupported fields set in item mask");
+ return -EINVAL;
+ }
- rule->key.spi = spec->hdr.spi;
+ rule->key.spi = spec->hdr.spi & mask->hdr.spi;
rule->mask.spi = mask->hdr.spi;
}
+
+ return 0;
}
-static void
-gve_parse_ah(const struct rte_flow_item *item, struct gve_flow_rule_params *rule)
+static int
+gve_parse_ah(const struct rte_flow_item *item,
+ struct gve_flow_rule_params *rule,
+ struct rte_flow_error *error)
{
- if (item->spec) {
+ if (item->spec != NULL) {
const struct rte_flow_item_ah *spec = item->spec;
const struct rte_flow_item_ah *mask =
- item->mask ? item->mask : &rte_flow_item_ah_mask;
+ item->mask != NULL ? item->mask :
+ &rte_flow_item_ah_mask;
- rule->key.spi = spec->spi;
+ if (item->mask != NULL &&
+ !gve_flow_mask_is_supported(mask, &rte_flow_item_ah_mask,
+ sizeof(*mask))) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_MASK, item,
+ "Unsupported fields set in item mask");
+ return -EINVAL;
+ }
+
+ rule->key.spi = spec->spi & mask->spi;
rule->mask.spi = mask->spi;
}
+
+ return 0;
}
static int
@@ -166,6 +285,7 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
const struct rte_flow_item *item = pattern;
enum rte_flow_item_type l3_type = RTE_FLOW_ITEM_TYPE_VOID;
enum rte_flow_item_type l4_type = RTE_FLOW_ITEM_TYPE_VOID;
+ int err;
if (pattern == NULL) {
rte_flow_error_set(error, EINVAL,
@@ -175,7 +295,9 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
}
for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
- if (item->last) {
+ if (item->type == RTE_FLOW_ITEM_TYPE_VOID)
+ continue;
+ if (item->last != NULL) {
/* Last and range are not supported as match criteria. */
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -183,9 +305,14 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
"No support for range");
return -EINVAL;
}
+ if (item->spec == NULL && item->mask != NULL) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Mask cannot be specified without spec");
+ return -EINVAL;
+ }
switch (item->type) {
- case RTE_FLOW_ITEM_TYPE_VOID:
- break;
case RTE_FLOW_ITEM_TYPE_IPV4:
if (l3_type != RTE_FLOW_ITEM_TYPE_VOID) {
rte_flow_error_set(error, EINVAL,
@@ -194,7 +321,9 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
"Multiple L3 items not supported");
return -EINVAL;
}
- gve_parse_ipv4(item, rule);
+ err = gve_parse_ipv4(item, rule, error);
+ if (err != 0)
+ return err;
l3_type = item->type;
break;
case RTE_FLOW_ITEM_TYPE_IPV6:
@@ -205,7 +334,9 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
"Multiple L3 items not supported");
return -EINVAL;
}
- gve_parse_ipv6(item, rule);
+ err = gve_parse_ipv6(item, rule, error);
+ if (err != 0)
+ return err;
l3_type = item->type;
break;
case RTE_FLOW_ITEM_TYPE_UDP:
@@ -216,7 +347,9 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
"Multiple L4 items not supported");
return -EINVAL;
}
- gve_parse_udp(item, rule);
+ err = gve_parse_udp(item, rule, error);
+ if (err != 0)
+ return err;
l4_type = item->type;
break;
case RTE_FLOW_ITEM_TYPE_TCP:
@@ -227,7 +360,9 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
"Multiple L4 items not supported");
return -EINVAL;
}
- gve_parse_tcp(item, rule);
+ err = gve_parse_tcp(item, rule, error);
+ if (err != 0)
+ return err;
l4_type = item->type;
break;
case RTE_FLOW_ITEM_TYPE_SCTP:
@@ -238,7 +373,9 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
"Multiple L4 items not supported");
return -EINVAL;
}
- gve_parse_sctp(item, rule);
+ err = gve_parse_sctp(item, rule, error);
+ if (err != 0)
+ return err;
l4_type = item->type;
break;
case RTE_FLOW_ITEM_TYPE_ESP:
@@ -249,7 +386,9 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
"Multiple L4 items not supported");
return -EINVAL;
}
- gve_parse_esp(item, rule);
+ err = gve_parse_esp(item, rule, error);
+ if (err != 0)
+ return err;
l4_type = item->type;
break;
case RTE_FLOW_ITEM_TYPE_AH:
@@ -260,7 +399,9 @@ gve_validate_and_parse_flow_pattern(const struct rte_flow_item pattern[],
"Multiple L4 items not supported");
return -EINVAL;
}
- gve_parse_ah(item, rule);
+ err = gve_parse_ah(item, rule, error);
+ if (err != 0)
+ return err;
l4_type = item->type;
break;
default:
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 11/12] net/gve: fix mbuf leak on GQI Rx queue start
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (9 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 10/12] net/gve: reject unsupported flow attributes and item masks Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-03 23:26 ` [PATCH 12/12] net/gve: support scattered Rx for DQO Joshua Washington
2026-12-04 19:13 ` [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Stephen Hemminger
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington, Xiaoyun Li, Junfeng Guo
Cc: dev, Jasper Tran O'Leary, stable
From: Jasper Tran O'Leary <jtranoleary@google.com>
When a GQI Rx queue is started, gve_rxq_mbufs_alloc() fills every slot
of the software ring with an mbuf but posts only nb_rx_desc - 1 buffers
to the device. The first refill then begins at the last slot of the
ring and stores a newly allocated mbuf there without freeing the one
the initial fill left in it. One mbuf per queue is lost every time a
queue is started and goes on to receive traffic.
Allocate nb_rx_desc - 1 mbufs up front. This is the number of buffers
posted to the device, and it is what the fallback path taken when the
bulk allocation fails already allocates.
Fixes: a46583cf43c8 ("net/gve: support Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
drivers/net/gve/gve_rx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c
index 05430621de..f0ad420992 100644
--- a/drivers/net/gve/gve_rx.c
+++ b/drivers/net/gve/gve_rx.c
@@ -487,7 +487,7 @@ gve_rxq_mbufs_alloc(struct gve_rx_queue *rxq)
uint16_t i;
int diag;
- diag = rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], rxq->nb_rx_desc);
+ diag = rte_pktmbuf_alloc_bulk(rxq->mpool, &rxq->sw_ring[0], rxq->nb_rx_desc - 1);
if (diag < 0) {
for (i = 0; i < rxq->nb_rx_desc - 1; i++) {
nmb = rte_pktmbuf_alloc(rxq->mpool);
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 12/12] net/gve: support scattered Rx for DQO
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (10 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 11/12] net/gve: fix mbuf leak on GQI Rx queue start Joshua Washington
@ 2026-12-03 23:26 ` Joshua Washington
2026-12-04 19:13 ` [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Stephen Hemminger
12 siblings, 0 replies; 14+ messages in thread
From: Joshua Washington @ 2026-12-03 23:26 UTC (permalink / raw)
To: Joshua Washington; +Cc: dev, Jasper Tran O'Leary
From: Jasper Tran O'Leary <jtranoleary@google.com>
Add scattered RX offload support for the DQO descriptor format.
When a received frame exceeds the size of a single RX buffer in DQO
mode, the device slices the packet across multiple RX buffers and clears
the end-of-packet indicator on all but the final completion descriptor.
- Advertise scattered RX for DQO and allow RX buffers smaller than the
device maximum frame size when scatter RX is enabled, while still
rejecting them at queue setup, port start, and MTU updates when
scatter is disabled.
- Chain segments across burst boundaries on the RX queue context, apply
packet type, checksum, RSS hash, and hardware timestamp metadata from
the end-of-packet completion descriptor, and free partial chains on
error or queue teardown.
- Update the GVE feature matrix and documentation for scattered RX.
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
doc/guides/nics/features/gve.ini | 2 +-
doc/guides/nics/gve.rst | 18 ++++++
doc/guides/rel_notes/release_27_03.rst | 4 ++
drivers/net/gve/gve_ethdev.c | 30 +++++----
drivers/net/gve/gve_rx_dqo.c | 85 +++++++++++++++++++-------
5 files changed, 104 insertions(+), 35 deletions(-)
diff --git a/doc/guides/nics/features/gve.ini b/doc/guides/nics/features/gve.ini
index 909858d8f0..3a746d73ef 100644
--- a/doc/guides/nics/features/gve.ini
+++ b/doc/guides/nics/features/gve.ini
@@ -6,7 +6,7 @@
[Features]
Speed capabilities = Y
MTU update = Y
-Scattered Rx = P
+Scattered Rx = Y
TSO = Y
RSS hash = Y
RSS key update = Y
diff --git a/doc/guides/nics/gve.rst b/doc/guides/nics/gve.rst
index 5a1efad05b..13634a178c 100644
--- a/doc/guides/nics/gve.rst
+++ b/doc/guides/nics/gve.rst
@@ -68,6 +68,7 @@ Supported features of the GVE PMD are:
- Multiple queues for Tx and Rx
- TSO offload
- Link state information
+- Rx multi-segments (Scattered Rx)
- Tx multi-segments (Scatter Tx)
- Tx UDP/TCP/SCTP Checksum
- RSS hash configuration
@@ -80,6 +81,23 @@ It'll be added in a future DPDK release.
Also, only GQI_QPL queue format is in use on GCP
since GQI_RDA hasn't been released in production.
+Scattered Rx
+^^^^^^^^^^^^
+
+The driver supports receiving a frame into multiple chained mbufs
+via the standard ``RTE_ETH_RX_OFFLOAD_SCATTER`` offload capability.
+
+**Limitations**
+
+- The device delivers frames up to its maximum MTU
+ (``max_mtu`` reported by ``rte_eth_dev_info_get()``),
+ regardless of the MTU configured on the port.
+- With the DQO queue format,
+ if ``RTE_ETH_RX_OFFLOAD_SCATTER`` is not enabled,
+ each Rx buffer must be large enough to hold a frame of the device maximum MTU,
+ i.e. ``max_mtu`` plus the 14-byte Ethernet header.
+ Rx queue setup, port start, and MTU update fail otherwise.
+
RSS
^^^
diff --git a/doc/guides/rel_notes/release_27_03.rst b/doc/guides/rel_notes/release_27_03.rst
index 114a71f1ec..d8352ab095 100644
--- a/doc/guides/rel_notes/release_27_03.rst
+++ b/doc/guides/rel_notes/release_27_03.rst
@@ -55,6 +55,10 @@ New Features
Also, make sure to start the actual text at the margin.
=======================================================
+* **Updated Google gve driver.**
+
+ Added scattered Rx support on DQO queues.
+
* **Updated Huawei hinic3 ethernet driver.**
* Added vport statistics, including CIR drop, and VF link
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index dcb270d269..866a3bba7b 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -462,25 +462,34 @@ gve_start_queues(struct rte_eth_dev *dev)
return ret;
}
-/* 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.
+/* A frame larger than one Rx buffer is chained into a multi-segment
+ * mbuf, which requires Rx scatter to be enabled. No Rx offload is
+ * per-queue here, so check the port offloads.
*/
static int
gve_rx_check_scatter(struct rte_eth_dev *dev, uint16_t mtu)
{
struct gve_priv *priv = dev->data->dev_private;
+ uint16_t check_mtu;
uint16_t i;
- if (!gve_is_gqi(priv) ||
- (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SCATTER))
+ if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SCATTER)
return 0;
+ check_mtu = gve_is_gqi(priv) ? mtu : RTE_MAX(mtu, priv->max_mtu);
for (i = 0; i < dev->data->nb_rx_queues; i++) {
struct gve_rx_queue *rxq = dev->data->rx_queues[i];
+ bool needs_scatter;
- if (rxq != NULL && gve_rx_gqi_needs_scatter(mtu, rxq->rx_buf_len)) {
+ if (rxq == NULL)
+ continue;
+
+ needs_scatter = gve_is_gqi(priv) ?
+ gve_rx_gqi_needs_scatter(check_mtu, rxq->rx_buf_len) :
+ gve_rx_dqo_needs_scatter(check_mtu, rxq->rx_buf_len);
+ if (needs_scatter) {
PMD_DRV_LOG(ERR, "MTU %u needs Rx scatter with %u byte Rx buffers",
- mtu, rxq->rx_buf_len);
+ check_mtu, rxq->rx_buf_len);
return -EINVAL;
}
}
@@ -950,12 +959,9 @@ gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->max_mtu = priv->max_mtu;
dev_info->min_mtu = RTE_ETHER_MIN_MTU;
- dev_info->rx_offload_capa = RTE_ETH_RX_OFFLOAD_RSS_HASH;
- /* GQI receives a frame larger than one Rx buffer as a chain of
- * buffers (gve_rx_burst follows GVE_RXF_PKT_CONT).
- */
- if (gve_is_gqi(priv))
- dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_SCATTER;
+ dev_info->rx_offload_capa =
+ RTE_ETH_RX_OFFLOAD_RSS_HASH |
+ RTE_ETH_RX_OFFLOAD_SCATTER;
if (priv->clk_read_type != GVE_DEV_CLK_UNSUPPORTED &&
priv->nic_ts_report_mz != NULL)
dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
index c4fe9692a7..c2431b6d88 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -155,6 +155,18 @@ gve_rx_set_mbuf_ptype(struct gve_priv *priv, struct rte_mbuf *rx_mbuf,
}
}
+static inline bool
+gve_rx_seg_invalid_dqo(volatile struct gve_rx_compl_desc_dqo *rx_desc,
+ struct gve_rx_queue *rxq, bool is_eop)
+{
+ bool is_first_seg = (rxq->ctx.mbuf_head == NULL);
+ bool unexpected_multiseg = is_first_seg && !is_eop && !rxq->scatter;
+ bool max_segs_exceeded = rxq->ctx.mbuf_head != NULL &&
+ rxq->ctx.mbuf_head->nb_segs >= RTE_MBUF_MAX_NB_SEGS;
+
+ return rx_desc->rx_error != 0 || unexpected_multiseg || max_segs_exceeded;
+}
+
uint16_t
gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
{
@@ -162,9 +174,10 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
struct gve_rx_queue *rxq;
uint64_t last_sync = 0;
struct gve_priv *priv;
+ struct rte_mbuf *pkt;
struct rte_mbuf *rxm;
uint16_t rx_buf_id;
- uint16_t pkt_len;
+ uint16_t frag_len;
uint16_t rx_id;
uint16_t nb_rx;
uint64_t bytes;
@@ -218,7 +231,7 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
}
if (!rxq->ctx.drop_pkt &&
- unlikely(rx_desc->rx_error != 0 || !is_eop)) {
+ unlikely(gve_rx_seg_invalid_dqo(rx_desc, rxq, is_eop))) {
rxq->stats.errors++;
rxq->ctx.drop_pkt = true;
}
@@ -226,19 +239,39 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
if (unlikely(rxq->ctx.drop_pkt)) {
if (rxm != NULL)
rte_pktmbuf_free(rxm);
+ if (rxq->ctx.mbuf_head != NULL) {
+ rte_pktmbuf_free(rxq->ctx.mbuf_head);
+ rxq->ctx.mbuf_head = NULL;
+ rxq->ctx.mbuf_tail = NULL;
+ }
if (is_eop)
gve_rx_ctx_clear(&rxq->ctx);
continue;
}
- pkt_len = rte_le_to_cpu_16(rx_desc->packet_len);
- rxm->pkt_len = pkt_len;
- rxm->data_len = pkt_len;
- rxm->port = rxq->port_id;
- gve_rx_set_mbuf_ptype(rxq->hw, rxm, rx_desc);
- rxm->ol_flags = RTE_MBUF_F_RX_RSS_HASH;
- gve_parse_csum_ol_flags(rxm, rx_desc);
- rxm->hash.rss = rte_le_to_cpu_32(rx_desc->hash);
+ frag_len = rte_le_to_cpu_16(rx_desc->packet_len);
+ rxm->data_len = frag_len;
+ if (rxq->ctx.mbuf_head == NULL) {
+ rxq->ctx.mbuf_head = rxm;
+ rxq->ctx.mbuf_tail = rxm;
+ rxm->nb_segs = 1;
+ rxm->pkt_len = frag_len;
+ rxm->port = rxq->port_id;
+ } else {
+ rxq->ctx.mbuf_head->nb_segs++;
+ rxq->ctx.mbuf_head->pkt_len += frag_len;
+ rxq->ctx.mbuf_tail->next = rxm;
+ rxq->ctx.mbuf_tail = rxm;
+ }
+
+ if (!is_eop)
+ continue;
+
+ pkt = rxq->ctx.mbuf_head;
+ gve_rx_set_mbuf_ptype(priv, pkt, rx_desc);
+ pkt->ol_flags = RTE_MBUF_F_RX_RSS_HASH;
+ gve_parse_csum_ol_flags(pkt, rx_desc);
+ pkt->hash.rss = rte_le_to_cpu_32(rx_desc->hash);
if (last_sync != 0 &&
(rx_desc->ts_sub_nsecs_low & GVE_DQO_RX_HWTSTAMP_VALID) &&
@@ -246,12 +279,14 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
uint32_t ts = rte_le_to_cpu_32(rx_desc->ts);
uint64_t full_ts = gve_reconstruct_ts(last_sync, ts);
- *RTE_MBUF_DYNFIELD(rxm, priv->mbuf_timestamp_offset, uint64_t *) = full_ts;
- rxm->ol_flags |= priv->mbuf_timestamp_mask;
+ *RTE_MBUF_DYNFIELD(pkt, priv->mbuf_timestamp_offset,
+ uint64_t *) = full_ts;
+ pkt->ol_flags |= priv->mbuf_timestamp_mask;
}
- rx_pkts[nb_rx++] = rxm;
- bytes += pkt_len;
+ rx_pkts[nb_rx++] = pkt;
+ bytes += pkt->pkt_len;
+ gve_rx_ctx_clear(&rxq->ctx);
}
rxq->rx_tail = rx_id;
@@ -276,6 +311,8 @@ gve_release_rxq_mbufs_dqo(struct gve_rx_queue *rxq)
}
}
+ if (rxq->ctx.mbuf_head != NULL)
+ rte_pktmbuf_free(rxq->ctx.mbuf_head);
gve_rx_ctx_clear(&rxq->ctx);
rxq->nb_avail = rxq->nb_rx_desc;
@@ -356,6 +393,7 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
struct gve_rx_queue *rxq;
uint16_t free_thresh;
uint16_t rx_buf_len;
+ uint64_t offloads;
int err = 0;
/* Ring size is required to be a power of two. */
@@ -365,15 +403,16 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
return -EINVAL;
}
- /* Without Rx scatter support on DQO, each Rx buffer must fit any
+ /* Without Rx scatter enabled, each DQO Rx buffer must fit any
* incoming frame up to the device maximum MTU.
*/
+ offloads = dev->data->dev_conf.rxmode.offloads | conf->offloads;
rx_buf_len = gve_rx_buf_len_dqo(pool);
- if (gve_rx_dqo_needs_scatter(hw->max_mtu, rx_buf_len)) {
+ if (!(offloads & RTE_ETH_RX_OFFLOAD_SCATTER) &&
+ gve_rx_dqo_needs_scatter(hw->max_mtu, rx_buf_len)) {
PMD_DRV_LOG(ERR,
- "Max MTU %u needs at least %u byte Rx buffers (got %u)",
- hw->max_mtu, hw->max_mtu + RTE_ETHER_HDR_LEN,
- rx_buf_len);
+ "Max MTU %u needs Rx scatter with %u byte Rx buffers",
+ hw->max_mtu, rx_buf_len);
return -EINVAL;
}
@@ -394,8 +433,7 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
}
/* Setup hardware timestamping if enabled */
- if ((conf->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) ||
- (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP))
+ if (offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)
rxq->timestamp_enabled = true;
/* check free_thresh here */
@@ -403,7 +441,7 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
conf->rx_free_thresh : GVE_DEFAULT_RX_FREE_THRESH;
if (free_thresh >= nb_desc) {
PMD_DRV_LOG(ERR, "rx_free_thresh (%u) must be less than nb_desc (%u).",
- free_thresh, rxq->nb_rx_desc);
+ free_thresh, nb_desc);
err = -EINVAL;
goto free_rxq;
}
@@ -413,6 +451,9 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
rxq->queue_id = queue_id;
rxq->port_id = dev->data->port_id;
rxq->ntfy_id = hw->num_ntfy_blks / 2 + queue_id;
+ rxq->scatter = !!(offloads & RTE_ETH_RX_OFFLOAD_SCATTER);
+ if (rxq->scatter)
+ dev->data->scattered_rx = 1;
rxq->mpool = pool;
rxq->hw = hw;
--
2.56.1.915.g69d5ec7298-goog
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
` (11 preceding siblings ...)
2026-12-03 23:26 ` [PATCH 12/12] net/gve: support scattered Rx for DQO Joshua Washington
@ 2026-12-04 19:13 ` Stephen Hemminger
12 siblings, 0 replies; 14+ messages in thread
From: Stephen Hemminger @ 2026-12-04 19:13 UTC (permalink / raw)
To: Joshua Washington; +Cc: dev
On Thu, 3 Dec 2026 15:26:23 -0800
Joshua Washington <joshwash@google.com> wrote:
> This patch series collects 11 bug fixes followed by DQO scattered Rx
> support for the GVE PMD:
>
> Fixes (patches 01-11):
> - Disable per-queue start/stop ops until individual queue lifecycle
> commands are supported, preventing device/driver ring desync.
> - Free partially received GQI Rx chains on queue teardown and avoid
> allocating an extra unposted mbuf in GQI Rx queue setup.
> - Guard against integer underflow in GQI Rx when frag_size < GVE_RX_PAD
> and against integer truncation / descriptor bounds violations in GQI
> QPL Tx.
> - Stop counting normal ring-exhaustion backpressure as oerrors in DQO
> Tx.
> - Disable unsupported TCP LRO/RSC offload and drop multi-segment Rx
> packets when scatter is disabled in DQO.
> - Reject non-power-of-2 ring sizes in DQO Rx/Tx setup.
> - Handle RSS allocation failures cleanly without corrupting cached state.
> - Reject unsupported flow attributes and item masks.
>
> Feature (patch 12):
> - Add scattered Rx offload support for the DQO descriptor format.
Lots of feedback from AI review pass.
Review of "net/gve" series (12 patches), applied on top of 27.03-rc0.
Patches 04, 07, 08 and 12 need next-net context; hunks were adjusted
to apply here. All 12 commits build with -Dwerror=true.
Errors
======
Patch 07/12, 12/12: rxq->scatter is stale after reconfigure
rxq->scatter is latched at Rx queue setup:
gve_rx.c:
rxq->scatter = !!(offloads & RTE_ETH_RX_OFFLOAD_SCATTER);
gve_rx_dqo.c:
rxq->scatter = !!(offloads & RTE_ETH_RX_OFFLOAD_SCATTER);
rte_eth_dev_configure() may run again on a stopped port with
different Rx offloads, and eth_dev_rx_queue_config() only releases
queues above the new count, so queues set up earlier survive with
the old flag. gve_dev_configure() updates dev->data->scattered_rx
from the new port offloads, but nothing updates rxq->scatter.
configure(no SCATTER), rx_queue_setup, configure(SCATTER), start:
the port has scatter on, rxq->scatter is false, and every chained
frame is dropped and counted as an Rx error:
gve_rx_dqo.c, gve_rx_seg_invalid_dqo():
bool unexpected_multiseg = is_first_seg && !is_eop && !rxq->scatter;
gve_rx.c, gve_rx():
if (unlikely(is_first_frag && !is_last_frag && !rxq->scatter)) {
gve_rx_check_scatter() returns 0 at its first test in this case, so
the mismatch is never noticed. In the other order the flag stays
true and GQI hands multi-segment mbufs to an application that
disabled the offload, since that function only re-validates the
buffer size.
The comment 12/12 adds to gve_dev_start() already describes this
sequence ("keeps Rx queues already set up, so check them again"), so
refresh the flag there as well:
for (i = 0; i < dev->data->nb_rx_queues; i++) {
struct gve_rx_queue *rxq = dev->data->rx_queues[i];
if (rxq != NULL)
rxq->scatter = !!(dev->data->dev_conf.rxmode.offloads &
RTE_ETH_RX_OFFLOAD_SCATTER);
}
Warnings
========
Patch 07/12: rxm dereferenced without the NULL check added alongside
if (unlikely(rxq->ctx.drop_pkt)) {
if (rxm != NULL)
rte_pktmbuf_free(rxm);
...
frag_len = rte_le_to_cpu_16(rx_desc->packet_len);
rxm->data_len = frag_len;
sw_ring[rx_buf_id] is cleared as soon as a completion consumes it and
is only repopulated by gve_rx_refill_dqo() at the end of the burst, so
a buf_id repeated within one burst yields rxm == NULL with drop_pkt
false. gve_completed_buf_list_push() also runs twice for that id,
leaving completed_buf_list[id] == id, which makes
gve_completed_buf_list_pop() hand out the same id indefinitely. Make
the two paths agree:
} else {
rxm = rxq->sw_ring[rx_buf_id];
if (unlikely(rxm == NULL)) {
PMD_DRV_DP_LOG(ERR, "Duplicate rx_buf_id %u on queue %u",
rx_buf_id, rxq->queue_id);
if (!rxq->ctx.drop_pkt) {
rxq->stats.errors++;
rxq->ctx.drop_pkt = true;
}
} else {
...
}
}
Patch 07/12: duplicate cleanup in gve_release_rxq_mbufs()
02/12 already adds the free and clear at the top of the function.
07/12 adds the same pair again after the loop, so the series ends with:
rte_pktmbuf_free(rxq->ctx.mbuf_head);
gve_rx_ctx_clear(&rxq->ctx);
for (i = 0; i < rxq->nb_rx_desc; i++) {
...
}
if (rxq->ctx.mbuf_head != NULL)
rte_pktmbuf_free(rxq->ctx.mbuf_head);
gve_rx_ctx_clear(&rxq->ctx);
The first clear NULLs mbuf_head, so the second pair is dead rather
than a double free. Drop the hunk from 07/12.
Patch 10/12: documented full-match restriction is still unenforced
gve_flow_mask_is_supported() only rejects bits outside the item's
default mask:
if ((m[i] & ~s[i]) != 0)
return false;
A partial mask on a field gve does support passes. Both port bytes of
rte_flow_item_udp_mask are set, so mask->hdr.src_port = 0x00ff is
accepted, and
rule->mask.src_port = mask->hdr.src_port;
is copied verbatim into the AdminQ command by
gve_adminq_add_flow_rule().
gve.rst states "Masking is limited to full matches i.e. 0x00...0 or
0xFF...F" and the commit message says masks are validated against
each protocol's supported fields. Either check each
supported field, e.g.
if ((mask->hdr.src_port != 0 && mask->hdr.src_port != UINT16_MAX) ||
(mask->hdr.dst_port != 0 && mask->hdr.dst_port != UINT16_MAX))
return reject;
or drop the claim from the documentation.
Info
====
Patch 07/12: DQO Rx queue setup is unusable on a jumbo VPC until 12/12
if (gve_rx_dqo_needs_scatter(hw->max_mtu, rx_buf_len)) {
return -EINVAL;
With a 2 KB mbuf pool rx_buf_len is 1920, so any max_mtu above 1906
fails setup unconditionally. 12/12 makes the test conditional on the
scatter offload. Both commits build, so bisect is safe, but a bisect
landing in 07..11 has no working DQO configuration on such a VPC.
Folding the condition into 07/12 avoids that.
Patch 12/12: RTE_MAX() is dead for DQO
check_mtu = gve_is_gqi(priv) ? mtu : RTE_MAX(mtu, priv->max_mtu);
rte_eth_dev_configure() and gve_dev_mtu_set() both reject an MTU above
priv->max_mtu, so the DQO arm always yields priv->max_mtu and the mtu
argument is unused there. Using priv->max_mtu directly also makes the
log line read as the device maximum rather than the requested MTU.
Patch 12/12: frag_len is not checked against rx_buf_len
frag_len = rte_le_to_cpu_16(rx_desc->packet_len);
rxm->data_len = frag_len;
packet_len is a 14-bit field, so it can exceed rx_buf_len, giving a
segment whose data_len is larger than its buffer; the head's pkt_len
then accumulates that across the chain. Pre-existing for the single
segment case, but 12/12 extends it to chains. Folding the test into
gve_rx_seg_invalid_dqo() would cover both.
Patch 07/12: DQO drop state needs an end-of-packet to clear
if (is_eop)
gve_rx_ctx_clear(&rxq->ctx);
drop_pkt now persists across bursts and is cleared only on an
end-of-packet completion, so a chain that never carries one leaves the
queue dropping every later completion until it is stopped and started.
Bounding it on the number of fragments dropped, rather than on EOP
alone, would make it self-recovering.
Patch 09/12: gve_init_rss_config() error path leaves a dangling key
if (!gve_rss_conf->indir) {
err = -ENOMEM;
goto err_with_key;
}
...
err_with_key:
rte_free(gve_rss_conf->key);
return err;
key is freed but not NULLed, and key_size and indir_size keep the
values assigned above. Every current caller lets the local struct die
on that path, so nothing dereferences it; pre-existing, not introduced
here, but it is the remaining hole in the area this patch tightens.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-12-04 19:13 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 23:26 [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Joshua Washington
2026-12-03 23:26 ` [PATCH 01/12] net/gve: disable queue start and stop Joshua Washington
2026-12-03 23:26 ` [PATCH 02/12] net/gve: free partially received GQI Rx packet Joshua Washington
2026-12-03 23:26 ` [PATCH 03/12] net/gve: fix integer underflow in GQI Rx path Joshua Washington
2026-12-03 23:26 ` [PATCH 04/12] net/gve: fix integer truncation in GQI QPL Tx path Joshua Washington
2026-12-03 23:26 ` [PATCH 05/12] net/gve: do not count unsent DQO Tx packets as oerrors Joshua Washington
2026-12-03 23:26 ` [PATCH 06/12] net/gve: disable unsupported TCP LRO offload Joshua Washington
2026-12-03 23:26 ` [PATCH 07/12] net/gve: drop multi-seg Rx packets if scatter is off Joshua Washington
2026-12-03 23:26 ` [PATCH 08/12] net/gve: reject non-power-of-2 ring sizes on DQO Joshua Washington
2026-12-03 23:26 ` [PATCH 09/12] net/gve: properly handle RSS realloc failures Joshua Washington
2026-12-03 23:26 ` [PATCH 10/12] net/gve: reject unsupported flow attributes and item masks Joshua Washington
2026-12-03 23:26 ` [PATCH 11/12] net/gve: fix mbuf leak on GQI Rx queue start Joshua Washington
2026-12-03 23:26 ` [PATCH 12/12] net/gve: support scattered Rx for DQO Joshua Washington
2026-12-04 19:13 ` [PATCH 00/12] net/gve: stability fixes and DQO scattered Rx support Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox