mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
vhost-net: flush batched before enabling notifications
commite430451613upstream. Commit8c2e6b26ff("vhost/net: Defer TX queue re-enable until after sendmsg") tries to defer the notification enabling by moving the logic out of the loop after the vhost_tx_batch() when nothing new is spotted. This caused unexpected side effects as the new logic is reused for several other error conditions. A previous patch reverted8c2e6b26ff. Now, bring the performance back up by flushing batched buffers before enabling notifications. Reported-by: Jon Kohler <jon@nutanix.com> Cc: stable@vger.kernel.org Fixes:8c2e6b26ff("vhost/net: Defer TX queue re-enable until after sendmsg") Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20250917063045.2042-3-jasowang@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7de587f87f
commit
a63e7dcf6a
@@ -774,6 +774,11 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock)
|
||||
break;
|
||||
/* Nothing new? Wait for eventfd to tell us they refilled. */
|
||||
if (head == vq->num) {
|
||||
/* Flush batched packets to handle pending RX
|
||||
* work (if busyloop_intr is set) and to avoid
|
||||
* unnecessary virtqueue kicks.
|
||||
*/
|
||||
vhost_tx_batch(net, nvq, sock, &msg);
|
||||
if (unlikely(busyloop_intr)) {
|
||||
vhost_poll_queue(&vq->poll);
|
||||
} else if (unlikely(vhost_enable_notify(&net->dev,
|
||||
|
||||
Reference in New Issue
Block a user