Skip to content

Commit

Permalink
virtio_net: ensure netdev_tx_reset_queue is called on bind xsk for tx
Browse files Browse the repository at this point in the history
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: 21a4e3c ("virtio_net: xsk: bind/unbind xsk for tx")
Signed-off-by: Koichiro Den <[email protected]>
Acked-by: Jason Wang <[email protected]>
Reviewed-by: Xuan Zhuo <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
lkpdn authored and Paolo Abeni committed Dec 10, 2024
1 parent 8d2da07 commit 76a771e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 76a771e

Please sign in to comment.