Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[cascardo/linux.git] / drivers / net / xen-netfront.c
index dd1011e..e59acb1 100644 (file)
@@ -277,12 +277,13 @@ static void xennet_alloc_rx_buffers(struct net_device *dev)
                if (!page) {
                        kfree_skb(skb);
 no_skb:
-                       /* Any skbuffs queued for refill? Force them out. */
-                       if (i != 0)
-                               goto refill;
                        /* Could not allocate any skbuffs. Try again later. */
                        mod_timer(&np->rx_refill_timer,
                                  jiffies + (HZ/10));
+
+                       /* Any skbuffs queued for refill? Force them out. */
+                       if (i != 0)
+                               goto refill;
                        break;
                }
 
@@ -1340,6 +1341,12 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
        if (np->stats == NULL)
                goto exit;
 
+       for_each_possible_cpu(i) {
+               struct netfront_stats *xen_nf_stats;
+               xen_nf_stats = per_cpu_ptr(np->stats, i);
+               u64_stats_init(&xen_nf_stats->syncp);
+       }
+
        /* Initialise tx_skbs as a free chain containing every entry. */
        np->tx_skb_freelist = 0;
        for (i = 0; i < NET_TX_RING_SIZE; i++) {