net: Replace u64_stats_fetch_begin_bh to u64_stats_fetch_begin_irq
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 14 Mar 2014 04:26:42 +0000 (21:26 -0700)
committerDanny Wood <danwood76@gmail.com>
Thu, 15 Jul 2021 09:45:33 +0000 (10:45 +0100)
Replace the bh safe variant with the hard irq safe variant.

We need a hard irq safe variant to deal with netpoll transmitting
packets from hard irq context, and we need it in most if not all of
the places using the bh safe variant.

Except on 32bit uni-processor the code is exactly the same so don't
bother with a bh variant, just have a hard irq safe variant that
everyone can use.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: I53e4597523d89796b22b0112f02a6ee1a2f6d256

35 files changed:
block/blk-cgroup.h
drivers/net/dummy.c
drivers/net/ethernet/broadcom/b44.c
drivers/net/ethernet/emulex/benet/be_ethtool.c
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/intel/igb/igb_ethtool.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/marvell/sky2.c
drivers/net/ethernet/neterion/vxge/vxge-main.c
drivers/net/ethernet/nvidia/forcedeth.c
drivers/net/ethernet/realtek/8139too.c
drivers/net/ethernet/realtek/r8169.c
drivers/net/ethernet/tile/tilepro.c
drivers/net/ethernet/via/via-rhine.c
drivers/net/ifb.c
drivers/net/loopback.c
drivers/net/macvlan.c
drivers/net/team/team.c
drivers/net/team/team_mode_loadbalance.c
drivers/net/veth.c
drivers/net/virtio_net.c
drivers/net/xen-netfront.c
include/linux/u64_stats_sync.h
net/8021q/vlan_dev.c
net/bridge/br_device.c
net/ipv4/af_inet.c
net/ipv4/ip_tunnel.c
net/ipv6/ip6_tunnel.c
net/netfilter/ipvs/ip_vs_ctl.c
net/openvswitch/datapath.c
net/openvswitch/vport.c

index 749afadfbb3310bf5a4c45d1d8edb42370b6bd39..8ac9a27c32db3776f5ec7a30334284a9db0cdb23 100644 (file)
@@ -399,9 +399,9 @@ static inline uint64_t blkg_stat_read(struct blkg_stat *stat)
        uint64_t v;
 
        do {
-               start = u64_stats_fetch_begin_bh(&stat->syncp);
+               start = u64_stats_fetch_begin_irq(&stat->syncp);
                v = stat->cnt;
-       } while (u64_stats_fetch_retry_bh(&stat->syncp, start));
+       } while (u64_stats_fetch_retry_irq(&stat->syncp, start));
 
        return v;
 }
@@ -467,9 +467,9 @@ static inline struct blkg_rwstat blkg_rwstat_read(struct blkg_rwstat *rwstat)
        struct blkg_rwstat tmp;
 
        do {
-               start = u64_stats_fetch_begin_bh(&rwstat->syncp);
+               start = u64_stats_fetch_begin_irq(&rwstat->syncp);
                tmp = *rwstat;
-       } while (u64_stats_fetch_retry_bh(&rwstat->syncp, start));
+       } while (u64_stats_fetch_retry_irq(&rwstat->syncp, start));
 
        return tmp;
 }
index bd8f84b0b894ebfe616a85b365598347d648200f..f240f0968b7d5d75919c0491904a41dc585ba237 100644 (file)
@@ -63,10 +63,10 @@ static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev,
 
                dstats = per_cpu_ptr(dev->dstats, i);
                do {
-                       start = u64_stats_fetch_begin_bh(&dstats->syncp);
+                       start = u64_stats_fetch_begin_irq(&dstats->syncp);
                        tbytes = dstats->tx_bytes;
                        tpackets = dstats->tx_packets;
-               } while (u64_stats_fetch_retry_bh(&dstats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&dstats->syncp, start));
                stats->tx_bytes += tbytes;
                stats->tx_packets += tpackets;
        }
index 9b017d9c58e94e5ab671aeda2cfcc969cc561c6e..2bde0b45f67706866ec40b9ed25db690b611b565 100644 (file)
@@ -1644,7 +1644,7 @@ static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev,
        unsigned int start;
 
        do {
-               start = u64_stats_fetch_begin_bh(&hwstat->syncp);
+               start = u64_stats_fetch_begin_irq(&hwstat->syncp);
 
                /* Convert HW stats into rtnl_link_stats64 stats. */
                nstat->rx_packets = hwstat->rx_pkts;
@@ -1678,7 +1678,7 @@ static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev,
                /* Carrier lost counter seems to be broken for some devices */
                nstat->tx_carrier_errors = hwstat->tx_carrier_lost;
 #endif
-       } while (u64_stats_fetch_retry_bh(&hwstat->syncp, start));
+       } while (u64_stats_fetch_retry_irq(&hwstat->syncp, start));
 
        return nstat;
 }
@@ -2011,12 +2011,12 @@ static void b44_get_ethtool_stats(struct net_device *dev,
        do {
                data_src = &hwstat->tx_good_octets;
                data_dst = data;
-               start = u64_stats_fetch_begin_bh(&hwstat->syncp);
+               start = u64_stats_fetch_begin_irq(&hwstat->syncp);
 
                for (i = 0; i < ARRAY_SIZE(b44_gstrings); i++)
                        *data_dst++ = *data_src++;
 
-       } while (u64_stats_fetch_retry_bh(&hwstat->syncp, start));
+       } while (u64_stats_fetch_retry_irq(&hwstat->syncp, start));
 }
 
 static void b44_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
index 3d4461adb3b4194eef3fe2dca339650665dac97b..1c1709ea0e9c6e4c00dd4f882b914ad6dc6e8999 100644 (file)
@@ -351,10 +351,10 @@ be_get_ethtool_stats(struct net_device *netdev,
                struct be_rx_stats *stats = rx_stats(rxo);
 
                do {
-                       start = u64_stats_fetch_begin_bh(&stats->sync);
+                       start = u64_stats_fetch_begin_irq(&stats->sync);
                        data[base] = stats->rx_bytes;
                        data[base + 1] = stats->rx_pkts;
-               } while (u64_stats_fetch_retry_bh(&stats->sync, start));
+               } while (u64_stats_fetch_retry_irq(&stats->sync, start));
 
                for (i = 2; i < ETHTOOL_RXSTATS_NUM; i++) {
                        p = (u8 *)stats + et_rx_stats[i].offset;
@@ -367,19 +367,19 @@ be_get_ethtool_stats(struct net_device *netdev,
                struct be_tx_stats *stats = tx_stats(txo);
 
                do {
-                       start = u64_stats_fetch_begin_bh(&stats->sync_compl);
+                       start = u64_stats_fetch_begin_irq(&stats->sync_compl);
                        data[base] = stats->tx_compl;
-               } while (u64_stats_fetch_retry_bh(&stats->sync_compl, start));
+               } while (u64_stats_fetch_retry_irq(&stats->sync_compl, start));
 
                do {
-                       start = u64_stats_fetch_begin_bh(&stats->sync);
+                       start = u64_stats_fetch_begin_irq(&stats->sync);
                        for (i = 1; i < ETHTOOL_TXSTATS_NUM; i++) {
                                p = (u8 *)stats + et_tx_stats[i].offset;
                                data[base + i] =
                                        (et_tx_stats[i].size == sizeof(u64)) ?
                                                *(u64 *)p : *(u32 *)p;
                        }
-               } while (u64_stats_fetch_retry_bh(&stats->sync, start));
+               } while (u64_stats_fetch_retry_irq(&stats->sync, start));
                base += ETHTOOL_TXSTATS_NUM;
        }
 }
index a2729129f4c347843cd172741e71c1cd6cc85b4d..b7f7610d0ef782a92c3032f66d0962c07acbb654 100644 (file)
@@ -524,10 +524,10 @@ static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev,
        for_all_rx_queues(adapter, rxo, i) {
                const struct be_rx_stats *rx_stats = rx_stats(rxo);
                do {
-                       start = u64_stats_fetch_begin_bh(&rx_stats->sync);
+                       start = u64_stats_fetch_begin_irq(&rx_stats->sync);
                        pkts = rx_stats(rxo)->rx_pkts;
                        bytes = rx_stats(rxo)->rx_bytes;
-               } while (u64_stats_fetch_retry_bh(&rx_stats->sync, start));
+               } while (u64_stats_fetch_retry_irq(&rx_stats->sync, start));
                stats->rx_packets += pkts;
                stats->rx_bytes += bytes;
                stats->multicast += rx_stats(rxo)->rx_mcast_pkts;
@@ -538,10 +538,10 @@ static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev,
        for_all_tx_queues(adapter, txo, i) {
                const struct be_tx_stats *tx_stats = tx_stats(txo);
                do {
-                       start = u64_stats_fetch_begin_bh(&tx_stats->sync);
+                       start = u64_stats_fetch_begin_irq(&tx_stats->sync);
                        pkts = tx_stats(txo)->tx_pkts;
                        bytes = tx_stats(txo)->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&tx_stats->sync, start));
+               } while (u64_stats_fetch_retry_irq(&tx_stats->sync, start));
                stats->tx_packets += pkts;
                stats->tx_bytes += bytes;
        }
@@ -1295,9 +1295,9 @@ static void be_eqd_update(struct be_adapter *adapter, struct be_eq_obj *eqo)
                return;
 
        do {
-               start = u64_stats_fetch_begin_bh(&stats->sync);
+               start = u64_stats_fetch_begin_irq(&stats->sync);
                pkts = stats->rx_pkts;
-       } while (u64_stats_fetch_retry_bh(&stats->sync, start));
+       } while (u64_stats_fetch_retry_irq(&stats->sync, start));
 
        stats->rx_pps = (unsigned long)(pkts - stats->rx_pkts_prev) / (delta / HZ);
        stats->rx_pkts_prev = pkts;
index 7876240fa74e27c16e759168ed662750aae4c66a..b8a25c396be6bdcfd77bd6cedbae5296e78ec4ef 100644 (file)
@@ -2248,15 +2248,15 @@ static void igb_get_ethtool_stats(struct net_device *netdev,
 
                ring = adapter->tx_ring[j];
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->tx_syncp);
+                       start = u64_stats_fetch_begin_irq(&ring->tx_syncp);
                        data[i]   = ring->tx_stats.packets;
                        data[i+1] = ring->tx_stats.bytes;
                        data[i+2] = ring->tx_stats.restart_queue;
-               } while (u64_stats_fetch_retry_bh(&ring->tx_syncp, start));
+               } while (u64_stats_fetch_retry_irq(&ring->tx_syncp, start));
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->tx_syncp2);
+                       start = u64_stats_fetch_begin_irq(&ring->tx_syncp2);
                        restart2  = ring->tx_stats.restart_queue2;
-               } while (u64_stats_fetch_retry_bh(&ring->tx_syncp2, start));
+               } while (u64_stats_fetch_retry_irq(&ring->tx_syncp2, start));
                data[i+2] += restart2;
 
                i += IGB_TX_QUEUE_STATS_LEN;
@@ -2264,13 +2264,13 @@ static void igb_get_ethtool_stats(struct net_device *netdev,
        for (j = 0; j < adapter->num_rx_queues; j++) {
                ring = adapter->rx_ring[j];
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->rx_syncp);
+                       start = u64_stats_fetch_begin_irq(&ring->rx_syncp);
                        data[i]   = ring->rx_stats.packets;
                        data[i+1] = ring->rx_stats.bytes;
                        data[i+2] = ring->rx_stats.drops;
                        data[i+3] = ring->rx_stats.csum_err;
                        data[i+4] = ring->rx_stats.alloc_failed;
-               } while (u64_stats_fetch_retry_bh(&ring->rx_syncp, start));
+               } while (u64_stats_fetch_retry_irq(&ring->rx_syncp, start));
                i += IGB_RX_QUEUE_STATS_LEN;
        }
        spin_unlock(&adapter->stats64_lock);
index b17a590aee699b6605d452e028068a7744c78167..854e5723b3a0944f49b1a9642034925646456d89 100644 (file)
@@ -4880,10 +4880,10 @@ void igb_update_stats(struct igb_adapter *adapter,
                }
 
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->rx_syncp);
+                       start = u64_stats_fetch_begin_irq(&ring->rx_syncp);
                        _bytes = ring->rx_stats.bytes;
                        _packets = ring->rx_stats.packets;
-               } while (u64_stats_fetch_retry_bh(&ring->rx_syncp, start));
+               } while (u64_stats_fetch_retry_irq(&ring->rx_syncp, start));
                bytes += _bytes;
                packets += _packets;
        }
@@ -4896,10 +4896,10 @@ void igb_update_stats(struct igb_adapter *adapter,
        for (i = 0; i < adapter->num_tx_queues; i++) {
                struct igb_ring *ring = adapter->tx_ring[i];
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->tx_syncp);
+                       start = u64_stats_fetch_begin_irq(&ring->tx_syncp);
                        _bytes = ring->tx_stats.bytes;
                        _packets = ring->tx_stats.packets;
-               } while (u64_stats_fetch_retry_bh(&ring->tx_syncp, start));
+               } while (u64_stats_fetch_retry_irq(&ring->tx_syncp, start));
                bytes += _bytes;
                packets += _packets;
        }
index d3754722adb4097ffdf168df442fe867859171bf..b1060aab70bc53397adeac6f0b72443c37617aa5 100644 (file)
@@ -1058,10 +1058,10 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
                }
 
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->syncp);
+                       start = u64_stats_fetch_begin_irq(&ring->syncp);
                        data[i]   = ring->stats.packets;
                        data[i+1] = ring->stats.bytes;
-               } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&ring->syncp, start));
                i += 2;
        }
        for (j = 0; j < IXGBE_NUM_RX_QUEUES; j++) {
@@ -1074,10 +1074,10 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
                }
 
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->syncp);
+                       start = u64_stats_fetch_begin_irq(&ring->syncp);
                        data[i]   = ring->stats.packets;
                        data[i+1] = ring->stats.bytes;
-               } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&ring->syncp, start));
                i += 2;
        }
 
index c590802671b1dfb7cab1df42df18b78c2372ceb3..7559fd7d2d25e15200d0b7872e033e9ce4edd388 100644 (file)
@@ -6785,10 +6785,10 @@ static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
 
                if (ring) {
                        do {
-                               start = u64_stats_fetch_begin_bh(&ring->syncp);
+                               start = u64_stats_fetch_begin_irq(&ring->syncp);
                                packets = ring->stats.packets;
                                bytes   = ring->stats.bytes;
-                       } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
+                       } while (u64_stats_fetch_retry_irq(&ring->syncp, start));
                        stats->rx_packets += packets;
                        stats->rx_bytes   += bytes;
                }
@@ -6801,10 +6801,10 @@ static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
 
                if (ring) {
                        do {
-                               start = u64_stats_fetch_begin_bh(&ring->syncp);
+                               start = u64_stats_fetch_begin_irq(&ring->syncp);
                                packets = ring->stats.packets;
                                bytes   = ring->stats.bytes;
-                       } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
+                       } while (u64_stats_fetch_retry_irq(&ring->syncp, start));
                        stats->tx_packets += packets;
                        stats->tx_bytes   += bytes;
                }
index 1f5166ad6bb514ade1ee4fd906c1e47385bf5b6a..c2bc86ab8db2171f1d45773552802ac41a55a73e 100644 (file)
@@ -3259,10 +3259,10 @@ static struct rtnl_link_stats64 *ixgbevf_get_stats(struct net_device *netdev,
        for (i = 0; i < adapter->num_rx_queues; i++) {
                ring = &adapter->rx_ring[i];
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->syncp);
+                       start = u64_stats_fetch_begin_irq(&ring->syncp);
                        bytes = ring->total_bytes;
                        packets = ring->total_packets;
-               } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&ring->syncp, start));
                stats->rx_bytes += bytes;
                stats->rx_packets += packets;
        }
@@ -3270,10 +3270,10 @@ static struct rtnl_link_stats64 *ixgbevf_get_stats(struct net_device *netdev,
        for (i = 0; i < adapter->num_tx_queues; i++) {
                ring = &adapter->tx_ring[i];
                do {
-                       start = u64_stats_fetch_begin_bh(&ring->syncp);
+                       start = u64_stats_fetch_begin_irq(&ring->syncp);
                        bytes = ring->total_bytes;
                        packets = ring->total_packets;
-               } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&ring->syncp, start));
                stats->tx_bytes += bytes;
                stats->tx_packets += packets;
        }
index 230781cddad892d6d07c1ad08ddf25a26b22f281..e5e2bd4a10785a4974cf64d51f69819f294ff297 100644 (file)
@@ -472,12 +472,12 @@ struct rtnl_link_stats64 *mvneta_get_stats64(struct net_device *dev,
 
                cpu_stats = per_cpu_ptr(pp->stats, cpu);
                do {
-                       start = u64_stats_fetch_begin_bh(&cpu_stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
                        rx_packets = cpu_stats->rx_packets;
                        rx_bytes   = cpu_stats->rx_bytes;
                        tx_packets = cpu_stats->tx_packets;
                        tx_bytes   = cpu_stats->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&cpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start));
 
                stats->rx_packets += rx_packets;
                stats->rx_bytes   += rx_bytes;
index 093cb077aede350b130bd4f1d6b13c7e5e75b79a..3853ebafcb1f368391cd2848b8c76ae77954ff95 100644 (file)
@@ -3906,19 +3906,19 @@ static struct rtnl_link_stats64 *sky2_get_stats(struct net_device *dev,
        u64 _bytes, _packets;
 
        do {
-               start = u64_stats_fetch_begin_bh(&sky2->rx_stats.syncp);
+               start = u64_stats_fetch_begin_irq(&sky2->rx_stats.syncp);
                _bytes = sky2->rx_stats.bytes;
                _packets = sky2->rx_stats.packets;
-       } while (u64_stats_fetch_retry_bh(&sky2->rx_stats.syncp, start));
+       } while (u64_stats_fetch_retry_irq(&sky2->rx_stats.syncp, start));
 
        stats->rx_packets = _packets;
        stats->rx_bytes = _bytes;
 
        do {
-               start = u64_stats_fetch_begin_bh(&sky2->tx_stats.syncp);
+               start = u64_stats_fetch_begin_irq(&sky2->tx_stats.syncp);
                _bytes = sky2->tx_stats.bytes;
                _packets = sky2->tx_stats.packets;
-       } while (u64_stats_fetch_retry_bh(&sky2->tx_stats.syncp, start));
+       } while (u64_stats_fetch_retry_irq(&sky2->tx_stats.syncp, start));
 
        stats->tx_packets = _packets;
        stats->tx_bytes = _bytes;
index 709f85729e6a9c793fa20f76d3407fd8dd8906a8..69220b6201865ec8e5895b8eed97bd0bf0a95e02 100644 (file)
@@ -3135,12 +3135,12 @@ vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
                u64 packets, bytes, multicast;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&rxstats->syncp);
+                       start = u64_stats_fetch_begin_irq(&rxstats->syncp);
 
                        packets   = rxstats->rx_frms;
                        multicast = rxstats->rx_mcast;
                        bytes     = rxstats->rx_bytes;
-               } while (u64_stats_fetch_retry_bh(&rxstats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&rxstats->syncp, start));
 
                net_stats->rx_packets += packets;
                net_stats->rx_bytes += bytes;
@@ -3150,11 +3150,11 @@ vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
                net_stats->rx_dropped += rxstats->rx_dropped;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&txstats->syncp);
+                       start = u64_stats_fetch_begin_irq(&txstats->syncp);
 
                        packets = txstats->tx_frms;
                        bytes   = txstats->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&txstats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&txstats->syncp, start));
 
                net_stats->tx_packets += packets;
                net_stats->tx_bytes += bytes;
index 2219b05f91b9ac625fadbd408fe4f125aba5f6d2..128fd85e96166725e6647343c31625e798df6076 100644 (file)
@@ -1755,19 +1755,19 @@ nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage)
 
        /* software stats */
        do {
-               syncp_start = u64_stats_fetch_begin_bh(&np->swstats_rx_syncp);
+               syncp_start = u64_stats_fetch_begin_irq(&np->swstats_rx_syncp);
                storage->rx_packets       = np->stat_rx_packets;
                storage->rx_bytes         = np->stat_rx_bytes;
                storage->rx_dropped       = np->stat_rx_dropped;
                storage->rx_missed_errors = np->stat_rx_missed_errors;
-       } while (u64_stats_fetch_retry_bh(&np->swstats_rx_syncp, syncp_start));
+       } while (u64_stats_fetch_retry_irq(&np->swstats_rx_syncp, syncp_start));
 
        do {
-               syncp_start = u64_stats_fetch_begin_bh(&np->swstats_tx_syncp);
+               syncp_start = u64_stats_fetch_begin_irq(&np->swstats_tx_syncp);
                storage->tx_packets = np->stat_tx_packets;
                storage->tx_bytes   = np->stat_tx_bytes;
                storage->tx_dropped = np->stat_tx_dropped;
-       } while (u64_stats_fetch_retry_bh(&np->swstats_tx_syncp, syncp_start));
+       } while (u64_stats_fetch_retry_irq(&np->swstats_tx_syncp, syncp_start));
 
        /* If the nic supports hw counters then retrieve latest values */
        if (np->driver_data & DEV_HAS_STATISTICS_V123) {
index 7caa4fb770d3fc992a6d9f0983d9b5a614eb7f0c..35db9a0f4f8e1a9cc0e2a88cd3ca8dcc639d2cc1 100644 (file)
@@ -2523,16 +2523,16 @@ rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
        netdev_stats_to_stats64(stats, &dev->stats);
 
        do {
-               start = u64_stats_fetch_begin_bh(&tp->rx_stats.syncp);
+               start = u64_stats_fetch_begin_irq(&tp->rx_stats.syncp);
                stats->rx_packets = tp->rx_stats.packets;
                stats->rx_bytes = tp->rx_stats.bytes;
-       } while (u64_stats_fetch_retry_bh(&tp->rx_stats.syncp, start));
+       } while (u64_stats_fetch_retry_irq(&tp->rx_stats.syncp, start));
 
        do {
-               start = u64_stats_fetch_begin_bh(&tp->tx_stats.syncp);
+               start = u64_stats_fetch_begin_irq(&tp->tx_stats.syncp);
                stats->tx_packets = tp->tx_stats.packets;
                stats->tx_bytes = tp->tx_stats.bytes;
-       } while (u64_stats_fetch_retry_bh(&tp->tx_stats.syncp, start));
+       } while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start));
 
        return stats;
 }
index 2183c618914843d30ef2dd7bcbfebcc529c8ddf4..b1cd989fd675a7ecdcb08c6e1abad1c06a412cfe 100644 (file)
@@ -6522,17 +6522,17 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
                rtl8169_rx_missed(dev, ioaddr);
 
        do {
-               start = u64_stats_fetch_begin_bh(&tp->rx_stats.syncp);
+               start = u64_stats_fetch_begin_irq(&tp->rx_stats.syncp);
                stats->rx_packets = tp->rx_stats.packets;
                stats->rx_bytes = tp->rx_stats.bytes;
-       } while (u64_stats_fetch_retry_bh(&tp->rx_stats.syncp, start));
+       } while (u64_stats_fetch_retry_irq(&tp->rx_stats.syncp, start));
 
 
        do {
-               start = u64_stats_fetch_begin_bh(&tp->tx_stats.syncp);
+               start = u64_stats_fetch_begin_irq(&tp->tx_stats.syncp);
                stats->tx_packets = tp->tx_stats.packets;
                stats->tx_bytes = tp->tx_stats.bytes;
-       } while (u64_stats_fetch_retry_bh(&tp->tx_stats.syncp, start));
+       } while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start));
 
        stats->rx_dropped       = dev->stats.rx_dropped;
        stats->tx_dropped       = dev->stats.tx_dropped;
index 731a063adaefe5d751bc208dff74b9f19272b838..039661da926918f7807597d5f938858e732fe7f0 100644 (file)
@@ -2159,14 +2159,14 @@ static struct rtnl_link_stats64 *tile_net_get_stats64(struct net_device *dev,
                cpu_stats = &priv->cpu[i]->stats;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&cpu_stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
                        trx_packets = cpu_stats->rx_packets;
                        ttx_packets = cpu_stats->tx_packets;
                        trx_bytes   = cpu_stats->rx_bytes;
                        ttx_bytes   = cpu_stats->tx_bytes;
                        trx_errors  = cpu_stats->rx_errors;
                        trx_dropped = cpu_stats->rx_dropped;
-               } while (u64_stats_fetch_retry_bh(&cpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start));
 
                rx_packets += trx_packets;
                tx_packets += ttx_packets;
index 9ea57eb66aa41569df09b12a649e54b6879ca60c..9f218fa63c5043f994b815cd599407c0cc62e54a 100644 (file)
@@ -2055,16 +2055,16 @@ rhine_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
        netdev_stats_to_stats64(stats, &dev->stats);
 
        do {
-               start = u64_stats_fetch_begin_bh(&rp->rx_stats.syncp);
+               start = u64_stats_fetch_begin_irq(&rp->rx_stats.syncp);
                stats->rx_packets = rp->rx_stats.packets;
                stats->rx_bytes = rp->rx_stats.bytes;
-       } while (u64_stats_fetch_retry_bh(&rp->rx_stats.syncp, start));
+       } while (u64_stats_fetch_retry_irq(&rp->rx_stats.syncp, start));
 
        do {
-               start = u64_stats_fetch_begin_bh(&rp->tx_stats.syncp);
+               start = u64_stats_fetch_begin_irq(&rp->tx_stats.syncp);
                stats->tx_packets = rp->tx_stats.packets;
                stats->tx_bytes = rp->tx_stats.bytes;
-       } while (u64_stats_fetch_retry_bh(&rp->tx_stats.syncp, start));
+       } while (u64_stats_fetch_retry_irq(&rp->tx_stats.syncp, start));
 
        return stats;
 }
index c14d39bf32d06a6f8d1b42a29b36dcd84b25c8f6..1da36764b1a431f6fc05cccca50a051c08a418f9 100644 (file)
@@ -136,18 +136,18 @@ static struct rtnl_link_stats64 *ifb_stats64(struct net_device *dev,
        unsigned int start;
 
        do {
-               start = u64_stats_fetch_begin_bh(&dp->rsync);
+               start = u64_stats_fetch_begin_irq(&dp->rsync);
                stats->rx_packets = dp->rx_packets;
                stats->rx_bytes = dp->rx_bytes;
-       } while (u64_stats_fetch_retry_bh(&dp->rsync, start));
+       } while (u64_stats_fetch_retry_irq(&dp->rsync, start));
 
        do {
-               start = u64_stats_fetch_begin_bh(&dp->tsync);
+               start = u64_stats_fetch_begin_irq(&dp->tsync);
 
                stats->tx_packets = dp->tx_packets;
                stats->tx_bytes = dp->tx_bytes;
 
-       } while (u64_stats_fetch_retry_bh(&dp->tsync, start));
+       } while (u64_stats_fetch_retry_irq(&dp->tsync, start));
 
        stats->rx_dropped = dev->stats.rx_dropped;
        stats->tx_dropped = dev->stats.tx_dropped;
index d7e0c5a60b4cafceb2572e175a782bc15e590585..14f9e3c7a45cc01e763beb3e895519f842335292 100644 (file)
@@ -112,10 +112,10 @@ static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,
 
                lb_stats = per_cpu_ptr(dev->lstats, i);
                do {
-                       start = u64_stats_fetch_begin_bh(&lb_stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&lb_stats->syncp);
                        tbytes = lb_stats->bytes;
                        tpackets = lb_stats->packets;
-               } while (u64_stats_fetch_retry_bh(&lb_stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&lb_stats->syncp, start));
                bytes   += tbytes;
                packets += tpackets;
        }
index 299af98d7b69060f1632bca92f6857b9208ee5f4..baa597fde02468b4be7c73c9b42df829d001bda9 100644 (file)
@@ -548,13 +548,13 @@ static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev,
                for_each_possible_cpu(i) {
                        p = per_cpu_ptr(vlan->pcpu_stats, i);
                        do {
-                               start = u64_stats_fetch_begin_bh(&p->syncp);
+                               start = u64_stats_fetch_begin_irq(&p->syncp);
                                rx_packets      = p->rx_packets;
                                rx_bytes        = p->rx_bytes;
                                rx_multicast    = p->rx_multicast;
                                tx_packets      = p->tx_packets;
                                tx_bytes        = p->tx_bytes;
-                       } while (u64_stats_fetch_retry_bh(&p->syncp, start));
+                       } while (u64_stats_fetch_retry_irq(&p->syncp, start));
 
                        stats->rx_packets       += rx_packets;
                        stats->rx_bytes         += rx_bytes;
index c168f334f928ffa64a3d4ed22ea3f2120855ee0f..a51abbd117fa016dfa2cdbc1b6213c03ecdd81b7 100644 (file)
@@ -1584,13 +1584,13 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
        for_each_possible_cpu(i) {
                p = per_cpu_ptr(team->pcpu_stats, i);
                do {
-                       start = u64_stats_fetch_begin_bh(&p->syncp);
+                       start = u64_stats_fetch_begin_irq(&p->syncp);
                        rx_packets      = p->rx_packets;
                        rx_bytes        = p->rx_bytes;
                        rx_multicast    = p->rx_multicast;
                        tx_packets      = p->tx_packets;
                        tx_bytes        = p->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&p->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&p->syncp, start));
 
                stats->rx_packets       += rx_packets;
                stats->rx_bytes         += rx_bytes;
index cd874ccb8b23ebbc4491c626c8402482eab12a9f..370d3cac7562482f2e7363021f27ca1c50715b13 100644 (file)
@@ -433,9 +433,9 @@ static void __lb_one_cpu_stats_add(struct lb_stats *acc_stats,
        struct lb_stats tmp;
 
        do {
-               start = u64_stats_fetch_begin_bh(syncp);
+               start = u64_stats_fetch_begin_irq(syncp);
                tmp.tx_bytes = cpu_stats->tx_bytes;
-       } while (u64_stats_fetch_retry_bh(syncp, start));
+       } while (u64_stats_fetch_retry_irq(syncp, start));
        acc_stats->tx_bytes += tmp.tx_bytes;
 }
 
index 689393179757c5be1f2d6adc9c8483ef4505dc9d..d385529c7018284369fc3c8056a4522c13e7f04d 100644 (file)
@@ -149,10 +149,10 @@ static u64 veth_stats_one(struct pcpu_vstats *result, struct net_device *dev)
                unsigned int start;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&stats->syncp);
                        packets = stats->packets;
                        bytes = stats->bytes;
-               } while (u64_stats_fetch_retry_bh(&stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&stats->syncp, start));
                result->packets += packets;
                result->bytes += bytes;
        }
index 415a576c0c2d165a3c8c24cee395bf935786d44b..7b8c1f57b3816666e8b3b7fe7118f23dc9e29b0d 100644 (file)
@@ -894,16 +894,16 @@ static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev,
                u64 tpackets, tbytes, rpackets, rbytes;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&stats->tx_syncp);
+                       start = u64_stats_fetch_begin_irq(&stats->tx_syncp);
                        tpackets = stats->tx_packets;
                        tbytes   = stats->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&stats->tx_syncp, start));
+               } while (u64_stats_fetch_retry_irq(&stats->tx_syncp, start));
 
                do {
-                       start = u64_stats_fetch_begin_bh(&stats->rx_syncp);
+                       start = u64_stats_fetch_begin_irq(&stats->rx_syncp);
                        rpackets = stats->rx_packets;
                        rbytes   = stats->rx_bytes;
-               } while (u64_stats_fetch_retry_bh(&stats->rx_syncp, start));
+               } while (u64_stats_fetch_retry_irq(&stats->rx_syncp, start));
 
                tot->rx_packets += rpackets;
                tot->tx_packets += tpackets;
index 9a2b6fd55cfd0def0295997e86f3ce18ad1dd2b4..17b3388ed36e6afeddc3ab00154414bed737552d 100644 (file)
@@ -1084,13 +1084,13 @@ static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev,
                unsigned int start;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&stats->syncp);
 
                        rx_packets = stats->rx_packets;
                        tx_packets = stats->tx_packets;
                        rx_bytes = stats->rx_bytes;
                        tx_bytes = stats->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&stats->syncp, start));
 
                tot->rx_packets += rx_packets;
                tot->tx_packets += tx_packets;
index 7bfabd20204c150afa40a7249932519c0e770267..4b4439e75f45f8e915f0ffb6b855be5f1113a04f 100644 (file)
@@ -27,8 +27,8 @@
  *    (On UP, there is no seqcount_t protection, a reader allowing interrupts could
  *     read partial values)
  *
- * 7) For softirq uses, readers can use u64_stats_fetch_begin_bh() and
- *    u64_stats_fetch_retry_bh() helpers
+ * 7) For irq and softirq uses, readers can use u64_stats_fetch_begin_irq() and
+ *    u64_stats_fetch_retry_irq() helpers
  *
  * Usage :
  *
@@ -114,31 +114,31 @@ static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp,
 }
 
 /*
- * In case softirq handlers can update u64 counters, readers can use following helpers
+ * In case irq handlers can update u64 counters, readers can use following helpers
  * - SMP 32bit arches use seqcount protection, irq safe.
- * - UP 32bit must disable BH.
+ * - UP 32bit must disable irqs.
  * - 64bit have no problem atomically reading u64 values, irq safe.
  */
-static inline unsigned int u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp)
+static inline unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync *syncp)
 {
 #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
        return read_seqcount_begin(&syncp->seq);
 #else
 #if BITS_PER_LONG==32
-       local_bh_disable();
+       local_irq_disable();
 #endif
        return 0;
 #endif
 }
 
-static inline bool u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp,
+static inline bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp,
                                         unsigned int start)
 {
 #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
        return read_seqcount_retry(&syncp->seq, start);
 #else
 #if BITS_PER_LONG==32
-       local_bh_enable();
+       local_irq_enable();
 #endif
        return false;
 #endif
index 65b84096c51f0d9ec6ffc067a6d1b7f2bee6c71e..55fcc89d05600fc46bf9b8d0d842b12308f799c7 100644 (file)
@@ -741,13 +741,13 @@ static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, st
 
                        p = per_cpu_ptr(vlan_dev_priv(dev)->vlan_pcpu_stats, i);
                        do {
-                               start = u64_stats_fetch_begin_bh(&p->syncp);
+                               start = u64_stats_fetch_begin_irq(&p->syncp);
                                rxpackets       = p->rx_packets;
                                rxbytes         = p->rx_bytes;
                                rxmulticast     = p->rx_multicast;
                                txpackets       = p->tx_packets;
                                txbytes         = p->tx_bytes;
-                       } while (u64_stats_fetch_retry_bh(&p->syncp, start));
+                       } while (u64_stats_fetch_retry_irq(&p->syncp, start));
 
                        stats->rx_packets       += rxpackets;
                        stats->rx_bytes         += rxbytes;
index 0b99e00652278c6c59dac0190071a2089164ba8b..19e4953b17b371e9e7d3c4c3cda054e05ed3182f 100644 (file)
@@ -140,9 +140,9 @@ static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev,
                const struct br_cpu_netstats *bstats
                        = per_cpu_ptr(br->stats, cpu);
                do {
-                       start = u64_stats_fetch_begin_bh(&bstats->syncp);
+                       start = u64_stats_fetch_begin_irq(&bstats->syncp);
                        memcpy(&tmp, bstats, sizeof(tmp));
-               } while (u64_stats_fetch_retry_bh(&bstats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&bstats->syncp, start));
                sum.tx_bytes   += tmp.tx_bytes;
                sum.tx_packets += tmp.tx_packets;
                sum.rx_bytes   += tmp.rx_bytes;
index 0d54481ba1934a2e5a7730d12f037b4919ea06bd..18291f38da3eae9cfa67829df882ed547e50c6b9 100644 (file)
@@ -1521,9 +1521,9 @@ u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp_offset)
                bhptr = per_cpu_ptr(mib[0], cpu);
                syncp = (struct u64_stats_sync *)(bhptr + syncp_offset);
                do {
-                       start = u64_stats_fetch_begin_bh(syncp);
+                       start = u64_stats_fetch_begin_irq(syncp);
                        v = *(((u64 *) bhptr) + offt);
-               } while (u64_stats_fetch_retry_bh(syncp, start));
+               } while (u64_stats_fetch_retry_irq(syncp, start));
 
                res += v;
        }
index 1dd6ec0d3a78e0211072e29eea446e808bf336ec..d262de78740abd5fb9f3350a00a4e472020260c7 100644 (file)
@@ -80,12 +80,12 @@ struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
                unsigned int start;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&tstats->syncp);
+                       start = u64_stats_fetch_begin_irq(&tstats->syncp);
                        rx_packets = tstats->rx_packets;
                        tx_packets = tstats->tx_packets;
                        rx_bytes = tstats->rx_bytes;
                        tx_bytes = tstats->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&tstats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&tstats->syncp, start));
 
                tot->rx_packets += rx_packets;
                tot->tx_packets += tx_packets;
index e964106c2e33da38b295c88ddac95fd2095a0f0d..efd110cf7701feac5548509ceef5315eb0330071 100644 (file)
@@ -111,12 +111,12 @@ static struct net_device_stats *ip6_get_stats(struct net_device *dev)
                const struct pcpu_tstats *tstats = per_cpu_ptr(dev->tstats, i);
 
                do {
-                       start = u64_stats_fetch_begin_bh(&tstats->syncp);
+                       start = u64_stats_fetch_begin_irq(&tstats->syncp);
                        tmp.rx_packets = tstats->rx_packets;
                        tmp.rx_bytes = tstats->rx_bytes;
                        tmp.tx_packets = tstats->tx_packets;
                        tmp.tx_bytes =  tstats->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&tstats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&tstats->syncp, start));
 
                sum.rx_packets += tmp.rx_packets;
                sum.rx_bytes   += tmp.rx_bytes;
index c046240ea0350d0e3f25f41ea40a625598717d5f..98538b8774a98d5ad31e3352f6e1ef996844d75c 100644 (file)
@@ -2175,10 +2175,10 @@ static int ip_vs_stats_percpu_show(struct seq_file *seq, void *v)
                __u64 inbytes, outbytes;
 
                do {
-                       start = u64_stats_fetch_begin_bh(&u->syncp);
+                       start = u64_stats_fetch_begin_irq(&u->syncp);
                        inbytes = u->ustats.inbytes;
                        outbytes = u->ustats.outbytes;
-               } while (u64_stats_fetch_retry_bh(&u->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&u->syncp, start));
 
                seq_printf(seq, "%3X %8X %8X %8X %16LX %16LX\n",
                           i, u->ustats.conns, u->ustats.inpkts,
index 47b7f796583c5ba1f91a0f82ae280f2192f8fb7c..475ec7f90b193dd491498c033da9d53e436862d0 100644 (file)
@@ -816,9 +816,9 @@ static void get_dp_stats(struct datapath *dp, struct ovs_dp_stats *stats)
                percpu_stats = per_cpu_ptr(dp->stats_percpu, i);
 
                do {
-                       start = u64_stats_fetch_begin_bh(&percpu_stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&percpu_stats->syncp);
                        local_stats = *percpu_stats;
-               } while (u64_stats_fetch_retry_bh(&percpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&percpu_stats->syncp, start));
 
                stats->n_hit += local_stats.n_hit;
                stats->n_missed += local_stats.n_missed;
index be666f956f81016835679cc0164cffdae13521ec..e1bdb30d13d2cac6f14b55c49f1f5eab9f94f5c5 100644 (file)
@@ -275,9 +275,9 @@ void ovs_vport_get_stats(struct vport *vport, struct ovs_vport_stats *stats)
                percpu_stats = per_cpu_ptr(vport->percpu_stats, i);
 
                do {
-                       start = u64_stats_fetch_begin_bh(&percpu_stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&percpu_stats->syncp);
                        local_stats = *percpu_stats;
-               } while (u64_stats_fetch_retry_bh(&percpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&percpu_stats->syncp, start));
 
                stats->rx_bytes         += local_stats.rx_bytes;
                stats->rx_packets       += local_stats.rx_packets;