From: ack@localhost.localdomain Date: Fri, 4 Aug 2006 15:07:58 +0000 (+0100) Subject: [NET] front: Check for received packets in network_open0 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15732^2~50 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=092b64b838ed9b5dc0f7daea671d500501a419ae;p=xen.git [NET] front: Check for received packets in network_open0 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 --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 7644b09b86..6bad0c4909 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -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;