From: Rusty Russell Date: Mon, 19 Nov 2007 16:20:43 +0000 (-0500) Subject: virtio: fix net driver loop case where we fail to restart X-Git-Tag: v2.6.24-rc4~103^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8329d98e480250ef5f5a083f9c3af50510b5e65d;p=linux-2.6 virtio: fix net driver loop case where we fail to restart skb is only NULL the first time around: it's more correct to test for being under-budget. Signed-off-by: Rusty Russell --- diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index d74e6f4aa2..5413dbf3d4 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -198,8 +198,8 @@ again: if (vi->num < vi->max / 2) try_fill_recv(vi); - /* All done? */ - if (!skb) { + /* Out of packets? */ + if (received < budget) { netif_rx_complete(vi->dev, napi); if (unlikely(!vi->rvq->vq_ops->restart(vi->rvq)) && netif_rx_reschedule(vi->dev, napi))