From 39286fa41a8b2c6a9c1f656a7b3c3efca95bc1b9 Mon Sep 17 00:00:00 2001 From: Sridhar Samudrala Date: Sun, 28 Feb 2010 19:39:16 +0200 Subject: [PATCH] vhost-net: restart tx poll on sk_sndbuf full guest to remote communication with vhost net sometimes stops until guest driver is restarted. This happens when we get guest kick precisely when the backend send queue is full, as a result handle_tx() returns without polling backend. This patch fixes this by restarting tx poll on this condition. Signed-off-by: Sridhar Samudrala Signed-off-by: Michael S. Tsirkin Tested-by: Tom Lendacky --- drivers/vhost/net.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 91a324cc2298..ad37da2b6cb5 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -114,8 +114,12 @@ static void handle_tx(struct vhost_net *net) return; wmem = atomic_read(&sock->sk->sk_wmem_alloc); - if (wmem >= sock->sk->sk_sndbuf) + if (wmem >= sock->sk->sk_sndbuf) { + mutex_lock(&vq->mutex); + tx_poll_start(net, sock); + mutex_unlock(&vq->mutex); return; + } use_mm(net->dev.mm); mutex_lock(&vq->mutex); -- GitLab