netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] vhost: Restart tx poll when socket send queue is full
@ 2010-02-18 20:59 Sridhar Samudrala
  2010-02-18 22:30 ` Michael S. Tsirkin
  2010-02-23 10:24 ` Michael S. Tsirkin
  0 siblings, 2 replies; 8+ messages in thread
From: Sridhar Samudrala @ 2010-02-18 20:59 UTC (permalink / raw)
  To: Michael S. Tsirkin, David Miller; +Cc: netdev

When running guest to remote host TCP stream test using vhost-net
via tap/macvtap, i am seeing network transmit hangs. This happens
when handle_tx() returns because of the socket send queue full 
condition.
This patch fixes this by restarting tx poll when hitting this
condition.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 91a324c..82d4bbe 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -113,12 +113,16 @@ static void handle_tx(struct vhost_net *net)
 	if (!sock)
 		return;
 
-	wmem = atomic_read(&sock->sk->sk_wmem_alloc);
-	if (wmem >= sock->sk->sk_sndbuf)
-		return;
-
 	use_mm(net->dev.mm);
 	mutex_lock(&vq->mutex);
+
+	wmem = atomic_read(&sock->sk->sk_wmem_alloc);
+	if (wmem >= sock->sk->sk_sndbuf) {
+		tx_poll_start(net, sock);
+		set_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
+		goto unlock;
+	}
+
 	vhost_disable_notify(vq);
 
 	if (wmem < sock->sk->sk_sndbuf * 2)
@@ -178,6 +182,7 @@ static void handle_tx(struct vhost_net *net)
 		}
 	}
 
+unlock:
 	mutex_unlock(&vq->mutex);
 	unuse_mm(net->dev.mm);
 }



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-01 18:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-18 20:59 [PATCH net-next-2.6] vhost: Restart tx poll when socket send queue is full Sridhar Samudrala
2010-02-18 22:30 ` Michael S. Tsirkin
2010-02-19  2:00   ` Sridhar Samudrala
2010-02-19 14:42     ` Michael S. Tsirkin
2010-02-19 21:19       ` Sridhar Samudrala
2010-02-23 10:24 ` Michael S. Tsirkin
2010-02-23 17:31   ` Sridhar Samudrala
2010-02-26  3:09     ` Shirley Ma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).