]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
virtio_net: ensure netdev_tx_reset_queue is called on bind xsk for tx
authorKoichiro Den <koichiro.den@canonical.com>
Fri, 6 Dec 2024 01:10:47 +0000 (10:10 +0900)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Dec 2024 10:22:21 +0000 (11:22 +0100)
virtnet_sq_bind_xsk_pool() flushes tx skbs and then resets tx queue, so
DQL counters need to be reset when flushing has actually occurred, Add
virtnet_sq_free_unused_buf_done() as a callback for virtqueue_resize()
to handle this.

Fixes: 21a4e3ce6dc7 ("virtio_net: xsk: bind/unbind xsk for tx")
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/virtio_net.c

index 5cf4b2b204311e284f3c1bd29afd7f816add99ef..7646ddd9bef70cf2a0833c7db7c0491884fb7ab5 100644 (file)
@@ -5740,7 +5740,8 @@ static int virtnet_sq_bind_xsk_pool(struct virtnet_info *vi,
 
        virtnet_tx_pause(vi, sq);
 
-       err = virtqueue_reset(sq->vq, virtnet_sq_free_unused_buf, NULL);
+       err = virtqueue_reset(sq->vq, virtnet_sq_free_unused_buf,
+                             virtnet_sq_free_unused_buf_done);
        if (err) {
                netdev_err(vi->dev, "reset tx fail: tx queue index: %d err: %d\n", qindex, err);
                pool = NULL;