aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r--drivers/net/xen-netfront.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index e30d80033cbc..057b05700f8b 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -658,7 +658,7 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
658 658
659 drop: 659 drop:
660 dev->stats.tx_dropped++; 660 dev->stats.tx_dropped++;
661 dev_kfree_skb(skb); 661 dev_kfree_skb_any(skb);
662 return NETDEV_TX_OK; 662 return NETDEV_TX_OK;
663} 663}
664 664
@@ -1060,13 +1060,13 @@ static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev,
1060 unsigned int start; 1060 unsigned int start;
1061 1061
1062 do { 1062 do {
1063 start = u64_stats_fetch_begin_bh(&stats->syncp); 1063 start = u64_stats_fetch_begin_irq(&stats->syncp);
1064 1064
1065 rx_packets = stats->rx_packets; 1065 rx_packets = stats->rx_packets;
1066 tx_packets = stats->tx_packets; 1066 tx_packets = stats->tx_packets;
1067 rx_bytes = stats->rx_bytes; 1067 rx_bytes = stats->rx_bytes;
1068 tx_bytes = stats->tx_bytes; 1068 tx_bytes = stats->tx_bytes;
1069 } while (u64_stats_fetch_retry_bh(&stats->syncp, start)); 1069 } while (u64_stats_fetch_retry_irq(&stats->syncp, start));
1070 1070
1071 tot->rx_packets += rx_packets; 1071 tot->rx_packets += rx_packets;
1072 tot->tx_packets += tx_packets; 1072 tot->tx_packets += tx_packets;
@@ -1282,16 +1282,10 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
1282 np->rx_refill_timer.function = rx_refill_timeout; 1282 np->rx_refill_timer.function = rx_refill_timeout;
1283 1283
1284 err = -ENOMEM; 1284 err = -ENOMEM;
1285 np->stats = alloc_percpu(struct netfront_stats); 1285 np->stats = netdev_alloc_pcpu_stats(struct netfront_stats);
1286 if (np->stats == NULL) 1286 if (np->stats == NULL)
1287 goto exit; 1287 goto exit;
1288 1288
1289 for_each_possible_cpu(i) {
1290 struct netfront_stats *xen_nf_stats;
1291 xen_nf_stats = per_cpu_ptr(np->stats, i);
1292 u64_stats_init(&xen_nf_stats->syncp);
1293 }
1294
1295 /* Initialise tx_skbs as a free chain containing every entry. */ 1289 /* Initialise tx_skbs as a free chain containing every entry. */
1296 np->tx_skb_freelist = 0; 1290 np->tx_skb_freelist = 0;
1297 for (i = 0; i < NET_TX_RING_SIZE; i++) { 1291 for (i = 0; i < NET_TX_RING_SIZE; i++) {