lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Feb 2010 12:59:11 -0800
From:	Sridhar Samudrala <sri@...ibm.com>
To:	"Michael S. Tsirkin" <mst@...hat.com>,
	David Miller <davem@...emloft.net>
Cc:	netdev <netdev@...r.kernel.org>
Subject: [PATCH net-next-2.6] vhost: Restart tx poll when socket send queue
 is full

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@...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);
 }


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ