Commit:     a48bd8f67003c342e147309a331f656a5e75a5e4
Parent:     e70f2f1bb8c8cf08ba0d836466f77eea27dd3474
Author:     Rusty Russell <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 23:50:07 2008 -0500
Committer:  Rusty Russell <[EMAIL PROTECTED]>
CommitDate: Mon Feb 4 23:50:07 2008 +1100

    virtio: flush buffers on open
    Fix bug found by Christian Borntraeger: if the other side fills all
    the registered network buffers before we enable NAPI, we will never
    get an interrupt.  The simplest fix is to process the input queue once
    on open.
    Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
 drivers/net/virtio_net.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index be5688f..bd4d26a 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -283,6 +283,13 @@ static int virtnet_open(struct net_device *dev)
        struct virtnet_info *vi = netdev_priv(dev);
+       /* If all buffers were filled by other side before we napi_enabled, we
+        * won't get another interrupt, so process any outstanding packets
+        * now.  virtnet_poll wants re-enable the queue, so we disable here. */
+       vi->rvq->vq_ops->disable_cb(vi->rvq);
+       netif_rx_schedule(vi->dev, &vi->napi);
        return 0;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to