diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/vhost/net.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 8d2bcae53a2e..58585ec8699e 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -635,8 +635,13 @@ static int vhost_net_rx_peek_head_len(struct vhost_net *net, struct sock *sk) preempt_enable(); - if (vhost_enable_notify(&net->dev, vq)) + if (!vhost_vq_avail_empty(&net->dev, vq)) vhost_poll_queue(&vq->poll); + else if (unlikely(vhost_enable_notify(&net->dev, vq))) { + vhost_disable_notify(&net->dev, vq); + vhost_poll_queue(&vq->poll); + } + mutex_unlock(&vq->mutex); len = peek_head_len(rvq, sk); |