Message ID | 20241204050724.307544-8-koichiro.den@canonical.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | virtio_net: correct netdev_tx_reset_queue() invocation points | expand |
On Wed, Dec 4, 2024 at 1:08 PM Koichiro Den <koichiro.den@canonical.com> wrote: > > 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> Thanks
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 5eaa7a2884d5..177705a56812 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -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;
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> --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)