git: 9d48e88e0236 - main - gve: Page-align DQO descriptor and completion rings

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 04 Nov 2026 23:30:20 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d48e88e023634e12530bf9db4a2e85d022b93db

commit 9d48e88e023634e12530bf9db4a2e85d022b93db
Author:     Tim Hostetler <thostet@google.com>
AuthorDate: 2026-11-04 23:25:00 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-04 23:25:44 +0000

    gve: Page-align DQO descriptor and completion rings
    
    Currently, gve_rx_alloc_ring_dqo() and gve_tx_alloc_ring_dqo() request
    CACHE_LINE_SIZE alignment when allocating DMA memory for the DQO TX/RX
    descriptor and completion rings. The device requires stronger alignment
    than cache line alignment, which was incidentally being met due to how
    the kernel allocates memory. Explicitly meet this requirement by
    requesting page aligned memory.
    
    Signed-off-by: Tim Hostetler <thostet@google.com>
    
    Reviewed by:    markj, Jasper Tran O'Leary <jtranoleary@google.com>
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D61211
---
 sys/dev/gve/gve_rx_dqo.c | 4 ++--
 sys/dev/gve/gve_tx_dqo.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/dev/gve/gve_rx_dqo.c b/sys/dev/gve/gve_rx_dqo.c
index cf914913da09..0d1c0eb149db 100644
--- a/sys/dev/gve/gve_rx_dqo.c
+++ b/sys/dev/gve/gve_rx_dqo.c
@@ -103,7 +103,7 @@ gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i)
 
 	err = gve_dma_alloc_coherent(priv,
 	    sizeof(struct gve_rx_desc_dqo) * priv->rx_desc_cnt,
-	    CACHE_LINE_SIZE, &rx->desc_ring_mem);
+	    PAGE_SIZE, &rx->desc_ring_mem);
 	if (err != 0) {
 		device_printf(priv->dev,
 		    "Failed to alloc desc ring for rx ring %d", i);
@@ -114,7 +114,7 @@ gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i)
 
 	err = gve_dma_alloc_coherent(priv,
 	    sizeof(struct gve_rx_compl_desc_dqo) * priv->rx_desc_cnt,
-	    CACHE_LINE_SIZE, &rx->dqo.compl_ring_mem);
+	    PAGE_SIZE, &rx->dqo.compl_ring_mem);
 	if (err != 0) {
 		device_printf(priv->dev,
 		    "Failed to alloc compl ring for rx ring %d", i);
diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c
index 0561092105fa..95490eb1de4c 100644
--- a/sys/dev/gve/gve_tx_dqo.c
+++ b/sys/dev/gve/gve_tx_dqo.c
@@ -173,7 +173,7 @@ gve_tx_alloc_ring_dqo(struct gve_priv *priv, int i)
 	/* Descriptor ring */
 	err = gve_dma_alloc_coherent(priv,
 	    sizeof(union gve_tx_desc_dqo) * priv->tx_desc_cnt,
-	    CACHE_LINE_SIZE, &tx->desc_ring_mem);
+	    PAGE_SIZE, &tx->desc_ring_mem);
 	if (err != 0) {
 		device_printf(priv->dev,
 		    "Failed to alloc desc ring for tx ring %d", i);
@@ -184,7 +184,7 @@ gve_tx_alloc_ring_dqo(struct gve_priv *priv, int i)
 	/* Completion ring */
 	err = gve_dma_alloc_coherent(priv,
 	    sizeof(struct gve_tx_compl_desc_dqo) * priv->tx_desc_cnt,
-	    CACHE_LINE_SIZE, &tx->dqo.compl_ring_mem);
+	    PAGE_SIZE, &tx->dqo.compl_ring_mem);
 	if (err != 0) {
 		device_printf(priv->dev,
 		    "Failed to alloc compl ring for tx ring %d", i);