aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/team/team.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/team/team.c')
-rw-r--r--drivers/net/team/team.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index c8624a8235ab..2b1a1d61072c 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1540,16 +1540,10 @@ static int team_init(struct net_device *dev)
1540 mutex_init(&team->lock); 1540 mutex_init(&team->lock);
1541 team_set_no_mode(team); 1541 team_set_no_mode(team);
1542 1542
1543 team->pcpu_stats = alloc_percpu(struct team_pcpu_stats); 1543 team->pcpu_stats = netdev_alloc_pcpu_stats(struct team_pcpu_stats);
1544 if (!team->pcpu_stats) 1544 if (!team->pcpu_stats)
1545 return -ENOMEM; 1545 return -ENOMEM;
1546 1546
1547 for_each_possible_cpu(i) {
1548 struct team_pcpu_stats *team_stats;
1549 team_stats = per_cpu_ptr(team->pcpu_stats, i);
1550 u64_stats_init(&team_stats->syncp);
1551 }
1552
1553 for (i = 0; i < TEAM_PORT_HASHENTRIES; i++) 1547 for (i = 0; i < TEAM_PORT_HASHENTRIES; i++)
1554 INIT_HLIST_HEAD(&team->en_port_hlist[i]); 1548 INIT_HLIST_HEAD(&team->en_port_hlist[i]);
1555 INIT_LIST_HEAD(&team->port_list); 1549 INIT_LIST_HEAD(&team->port_list);
@@ -1767,13 +1761,13 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1767 for_each_possible_cpu(i) { 1761 for_each_possible_cpu(i) {
1768 p = per_cpu_ptr(team->pcpu_stats, i); 1762 p = per_cpu_ptr(team->pcpu_stats, i);
1769 do { 1763 do {
1770 start = u64_stats_fetch_begin_bh(&p->syncp); 1764 start = u64_stats_fetch_begin_irq(&p->syncp);
1771 rx_packets = p->rx_packets; 1765 rx_packets = p->rx_packets;
1772 rx_bytes = p->rx_bytes; 1766 rx_bytes = p->rx_bytes;
1773 rx_multicast = p->rx_multicast; 1767 rx_multicast = p->rx_multicast;
1774 tx_packets = p->tx_packets; 1768 tx_packets = p->tx_packets;
1775 tx_bytes = p->tx_bytes; 1769 tx_bytes = p->tx_bytes;
1776 } while (u64_stats_fetch_retry_bh(&p->syncp, start)); 1770 } while (u64_stats_fetch_retry_irq(&p->syncp, start));
1777 1771
1778 stats->rx_packets += rx_packets; 1772 stats->rx_packets += rx_packets;
1779 stats->rx_bytes += rx_bytes; 1773 stats->rx_bytes += rx_bytes;