[NET] front: Check for received packets in network_open0
authorack@localhost.localdomain <ack@localhost.localdomain>
Fri, 4 Aug 2006 15:07:58 +0000 (16:07 +0100)
committerack@localhost.localdomain <ack@localhost.localdomain>
Fri, 4 Aug 2006 15:07:58 +0000 (16:07 +0100)
Because the backend brings up the interface long before the frontend
has booted up, it is possible that by the time we get here we already
have packets queued up for processing.

If we don't process them here, we may delay them more than what is
necessary.  Worse yet, it is possible to miss the notification
interrupt from the backend in such a way that we never get another
one until we bring the interface down and up.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c

index 7644b09b86b9f745cf76c417bd568047668d2bfc..6bad0c4909703db36e9e94a80889b6e54da8d7bd 100644 (file)
@@ -497,6 +497,9 @@ static int network_open(struct net_device *dev)
        network_alloc_rx_buffers(dev);
        np->rx.sring->rsp_event = np->rx.rsp_cons + 1;
 
+       if (RING_HAS_UNCONSUMED_RESPONSES(&np->rx))
+               netif_rx_schedule(dev);
+
        netif_start_queue(dev);
 
        return 0;