Re: [PATCH net-next] gve: support unreadable netmem

From: Simon Horman
Date: Thu Jul 24 2025 - 07:57:37 EST


On Wed, Jul 23, 2025 at 10:28:29PM +0000, Harshitha Ramamurthy wrote:

...

> diff --git a/drivers/net/ethernet/google/gve/gve_rx_dqo.c b/drivers/net/ethernet/google/gve/gve_rx_dqo.c

...

> @@ -793,13 +811,19 @@ static int gve_rx_dqo(struct napi_struct *napi, struct gve_rx_ring *rx,
> rx->rx_hsplit_unsplit_pkt += unsplit;
> rx->rx_hsplit_bytes += hdr_len;
> u64_stats_update_end(&rx->statss);
> + } else if (!rx->ctx.skb_head && rx->dqo.page_pool &&
> + netmem_is_net_iov(buf_state->page_info.netmem)) {
> + /* when header split is disabled, the header went to the packet
> + * buffer. If the packet buffer is a net_iov, those can't be
> + * easily mapped into the kernel space to access the header
> + * required to process the packet.
> + */
> + gve_free_buffer(rx, buf_state);
> + return -EFAULT;

nit: I think it would be nice to consistently handle error paths
in this function using goto error.

> }
>
> /* Sync the portion of dma buffer for CPU to read. */
> - dma_sync_single_range_for_cpu(&priv->pdev->dev, buf_state->addr,
> - buf_state->page_info.page_offset +
> - buf_state->page_info.pad,
> - buf_len, DMA_FROM_DEVICE);
> + gve_dma_sync(priv, rx, buf_state, buf_len);
>
> /* Append to current skb if one exists. */
> if (rx->ctx.skb_head) {