diff options
author | Sridhar Samudrala <samudrala@us.ibm.com> | 2010-02-28 12:39:16 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-02-28 12:50:33 -0500 |
commit | 39286fa41a8b2c6a9c1f656a7b3c3efca95bc1b9 (patch) | |
tree | 1639935ff004a1ba9452314bd8921f81058bb29a /drivers/vhost | |
parent | d6db3f5c11dc7ed5712d5d5682aa34025ee5248e (diff) |
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 <samudrala@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Tom Lendacky <toml@us.ibm.com>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/net.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) | |||
114 | return; | 114 | return; |
115 | 115 | ||
116 | wmem = atomic_read(&sock->sk->sk_wmem_alloc); | 116 | wmem = atomic_read(&sock->sk->sk_wmem_alloc); |
117 | if (wmem >= sock->sk->sk_sndbuf) | 117 | if (wmem >= sock->sk->sk_sndbuf) { |
118 | mutex_lock(&vq->mutex); | ||
119 | tx_poll_start(net, sock); | ||
120 | mutex_unlock(&vq->mutex); | ||
118 | return; | 121 | return; |
122 | } | ||
119 | 123 | ||
120 | use_mm(net->dev.mm); | 124 | use_mm(net->dev.mm); |
121 | mutex_lock(&vq->mutex); | 125 | mutex_lock(&vq->mutex); |