]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/net/xen-netfront.c
xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4).
[mirror_ubuntu-bionic-kernel.git] / drivers / net / xen-netfront.c
index dd1011e55cb598096ef7c2ad64981a2572b760d7..2ab82fe75edeeb6192c5088408082c8f0318e10f 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++) {
@@ -2108,7 +2115,7 @@ static int __init netif_init(void)
        if (!xen_domain())
                return -ENODEV;
 
-       if (xen_hvm_domain() && !xen_platform_pci_unplug)
+       if (!xen_has_pv_nic_devices())
                return -ENODEV;
 
        pr_info("Initialising Xen virtual ethernet driver\n");