Skip to content

Commit

Permalink
vhost-net: restart tx poll on sk_sndbuf full
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sridhar Samudrala authored and Michael S. Tsirkin committed Feb 28, 2010
1 parent d6db3f5 commit 39286fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/vhost/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 39286fa

Please sign in to comment.