On Tue, Aug 4, 2026 at 5:22 PM Xiong Weimin <[email protected]> wrote:
>
> virtnet_xsk_pool_enable() maps the shared AF_XDP transmit header with
> the send virtqueue, and the disable path unmaps it with the same queue.
> Use sq->vq on the setup error path as well so the DMA unmap matches the
> mapping side.
>
> Signed-off-by: Xiong Weimin <[email protected]>
Fixes: 21a4e3ce6dc7 ("virtio_net: xsk: bind/unbind xsk for tx")
Reviewed-by: Jason Xing <[email protected]>
Nice catch! Thanks for your work!
> ---
> drivers/net/virtio_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 6160aa8ba..a6f90f579 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -5959,7 +5959,7 @@ static int virtnet_xsk_pool_enable(struct net_device
> *dev,
> err_rq:
> xsk_pool_dma_unmap(pool, 0);
> err_xsk_map:
> - virtqueue_unmap_single_attrs(rq->vq, hdr_dma, vi->hdr_len,
> + virtqueue_unmap_single_attrs(sq->vq, hdr_dma, vi->hdr_len,
> DMA_TO_DEVICE, 0);
> err_free_buffs:
> kvfree(rq->xsk_buffs);
> --
> 2.43.0
>
>