From: Koichiro Den <koichiro.den@canonical.com>
To: virtualization@lists.linux.dev
Cc: mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com,
eperezma@redhat.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
jiri@resnulli.us, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH net v4 6/6] virtio_net: ensure netdev_tx_reset_queue is called on bind xsk for tx
Date: Fri, 6 Dec 2024 10:10:47 +0900 [thread overview]
Message-ID: <20241206011047.923923-7-koichiro.den@canonical.com> (raw)
In-Reply-To: <20241206011047.923923-1-koichiro.den@canonical.com>
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(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 5cf4b2b20431..7646ddd9bef7 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;
--
2.43.0
next prev parent reply other threads:[~2024-12-06 1:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 1:10 [PATCH net v4 0/6] virtio_net: correct netdev_tx_reset_queue() invocation points Koichiro Den
2024-12-06 1:10 ` [PATCH net v4 1/6] virtio_net: correct netdev_tx_reset_queue() invocation point Koichiro Den
2024-12-10 10:20 ` Paolo Abeni
2024-12-06 1:10 ` [PATCH net v4 2/6] virtio_net: replace vq2rxq with vq2txq where appropriate Koichiro Den
2024-12-06 1:10 ` [PATCH net v4 3/6] virtio_ring: add a func argument 'recycle_done' to virtqueue_resize() Koichiro Den
2024-12-06 1:10 ` [PATCH net v4 4/6] virtio_net: ensure netdev_tx_reset_queue is called on tx ring resize Koichiro Den
2024-12-06 1:10 ` [PATCH net v4 5/6] virtio_ring: add a func argument 'recycle_done' to virtqueue_reset() Koichiro Den
2024-12-06 1:10 ` Koichiro Den [this message]
2024-12-09 2:45 ` [PATCH net v4 0/6] virtio_net: correct netdev_tx_reset_queue() invocation points Jason Wang
2024-12-10 1:27 ` Xuan Zhuo
2024-12-10 10:40 ` patchwork-bot+netdevbpf
2024-12-11 5:49 ` Lei Yang
2024-12-12 7:05 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241206011047.923923-7-koichiro.den@canonical.com \
--to=koichiro.den@canonical.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®