]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: Remove the obsolte u64_stats_fetch_*_irq() users (net).
authorThomas Gleixner <tglx@linutronix.de>
Wed, 26 Oct 2022 13:22:15 +0000 (15:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:12 +0000 (13:26 +0100)
[ Upstream commit d120d1a63b2c484d6175873d8ee736a633f74b70 ]

Now that the 32bit UP oddity is gone and 32bit uses always a sequence
count, there is no need for the fetch_irq() variants anymore.

Convert to the regular interface.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 1dbd8d9a82e3 ("ipvs: use u64_stats_t for the per-cpu counters")
Signed-off-by: Sasha Levin <sashal@kernel.org>
16 files changed:
net/8021q/vlan_dev.c
net/bridge/br_multicast.c
net/bridge/br_vlan.c
net/core/dev.c
net/core/devlink.c
net/core/drop_monitor.c
net/core/gen_stats.c
net/dsa/slave.c
net/ipv4/af_inet.c
net/ipv6/seg6_local.c
net/mac80211/sta_info.c
net/mpls/af_mpls.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/nf_tables_api.c
net/openvswitch/datapath.c
net/openvswitch/flow_table.c

index 035812b0461cc4b403f1a80bfdb9cfd9f44e4b45..ecdb47712d95688ea7324c3d288065aa95c5a14a 100644 (file)
@@ -712,13 +712,13 @@ static void vlan_dev_get_stats64(struct net_device *dev,
 
                p = per_cpu_ptr(vlan_dev_priv(dev)->vlan_pcpu_stats, i);
                do {
-                       start = u64_stats_fetch_begin_irq(&p->syncp);
+                       start = u64_stats_fetch_begin(&p->syncp);
                        rxpackets       = u64_stats_read(&p->rx_packets);
                        rxbytes         = u64_stats_read(&p->rx_bytes);
                        rxmulticast     = u64_stats_read(&p->rx_multicast);
                        txpackets       = u64_stats_read(&p->tx_packets);
                        txbytes         = u64_stats_read(&p->tx_bytes);
-               } while (u64_stats_fetch_retry_irq(&p->syncp, start));
+               } while (u64_stats_fetch_retry(&p->syncp, start));
 
                stats->rx_packets       += rxpackets;
                stats->rx_bytes         += rxbytes;
index db4f2641d1cd1e963de1695ad3e46d1a15761ab6..7e2a9fb5786c9ad782d14e175ae022d158d9887d 100644 (file)
@@ -4899,9 +4899,9 @@ void br_multicast_get_stats(const struct net_bridge *br,
                unsigned int start;
 
                do {
-                       start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
+                       start = u64_stats_fetch_begin(&cpu_stats->syncp);
                        memcpy(&temp, &cpu_stats->mstats, sizeof(temp));
-               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry(&cpu_stats->syncp, start));
 
                mcast_stats_add_dir(tdst.igmp_v1queries, temp.igmp_v1queries);
                mcast_stats_add_dir(tdst.igmp_v2queries, temp.igmp_v2queries);
index 9ffd40b8270c17e4ca3845638ccacb59f7b7ff2b..bc75fa1e4666a6227d5beace3068ed9551d17e95 100644 (file)
@@ -1389,12 +1389,12 @@ void br_vlan_get_stats(const struct net_bridge_vlan *v,
 
                cpu_stats = per_cpu_ptr(v->stats, i);
                do {
-                       start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
+                       start = u64_stats_fetch_begin(&cpu_stats->syncp);
                        rxpackets = u64_stats_read(&cpu_stats->rx_packets);
                        rxbytes = u64_stats_read(&cpu_stats->rx_bytes);
                        txbytes = u64_stats_read(&cpu_stats->tx_bytes);
                        txpackets = u64_stats_read(&cpu_stats->tx_packets);
-               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry(&cpu_stats->syncp, start));
 
                u64_stats_add(&stats->rx_packets, rxpackets);
                u64_stats_add(&stats->rx_bytes, rxbytes);
index 2c14f48d245732a4f2d10fae0dd4e97f1a798e15..d2ab54c9c3ed22a311f7d5e2537ad91bbee317a7 100644 (file)
@@ -10496,12 +10496,12 @@ void dev_fetch_sw_netstats(struct rtnl_link_stats64 *s,
 
                stats = per_cpu_ptr(netstats, cpu);
                do {
-                       start = u64_stats_fetch_begin_irq(&stats->syncp);
+                       start = u64_stats_fetch_begin(&stats->syncp);
                        rx_packets = u64_stats_read(&stats->rx_packets);
                        rx_bytes   = u64_stats_read(&stats->rx_bytes);
                        tx_packets = u64_stats_read(&stats->tx_packets);
                        tx_bytes   = u64_stats_read(&stats->tx_bytes);
-               } while (u64_stats_fetch_retry_irq(&stats->syncp, start));
+               } while (u64_stats_fetch_retry(&stats->syncp, start));
 
                s->rx_packets += rx_packets;
                s->rx_bytes   += rx_bytes;
index b50bcc18b8d9e034f8706bdf1afe6b7aa2c2395d..cfa6a099457ae0bf94a49288849ccc2b6b1f6e47 100644 (file)
@@ -8268,10 +8268,10 @@ static void devlink_trap_stats_read(struct devlink_stats __percpu *trap_stats,
 
                cpu_stats = per_cpu_ptr(trap_stats, i);
                do {
-                       start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
+                       start = u64_stats_fetch_begin(&cpu_stats->syncp);
                        rx_packets = u64_stats_read(&cpu_stats->rx_packets);
                        rx_bytes = u64_stats_read(&cpu_stats->rx_bytes);
-               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry(&cpu_stats->syncp, start));
 
                u64_stats_add(&stats->rx_packets, rx_packets);
                u64_stats_add(&stats->rx_bytes, rx_bytes);
index 75501e1bdd25b3d2c04a512351c817e6a921f718..dfcaf61d972c7627c2d4f702dc7dc004ac6740f6 100644 (file)
@@ -1432,9 +1432,9 @@ static void net_dm_stats_read(struct net_dm_stats *stats)
                u64 dropped;
 
                do {
-                       start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
+                       start = u64_stats_fetch_begin(&cpu_stats->syncp);
                        dropped = u64_stats_read(&cpu_stats->dropped);
-               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry(&cpu_stats->syncp, start));
 
                u64_stats_add(&stats->dropped, dropped);
        }
@@ -1476,9 +1476,9 @@ static void net_dm_hw_stats_read(struct net_dm_stats *stats)
                u64 dropped;
 
                do {
-                       start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
+                       start = u64_stats_fetch_begin(&cpu_stats->syncp);
                        dropped = u64_stats_read(&cpu_stats->dropped);
-               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry(&cpu_stats->syncp, start));
 
                u64_stats_add(&stats->dropped, dropped);
        }
index c8d137ef5980eaf6e1c3ea10417e096bf2a33849..b71ccaec0991461333dbe465ee619bca4a06e75b 100644 (file)
@@ -135,10 +135,10 @@ static void gnet_stats_add_basic_cpu(struct gnet_stats_basic_sync *bstats,
                u64 bytes, packets;
 
                do {
-                       start = u64_stats_fetch_begin_irq(&bcpu->syncp);
+                       start = u64_stats_fetch_begin(&bcpu->syncp);
                        bytes = u64_stats_read(&bcpu->bytes);
                        packets = u64_stats_read(&bcpu->packets);
-               } while (u64_stats_fetch_retry_irq(&bcpu->syncp, start));
+               } while (u64_stats_fetch_retry(&bcpu->syncp, start));
 
                t_bytes += bytes;
                t_packets += packets;
@@ -162,10 +162,10 @@ void gnet_stats_add_basic(struct gnet_stats_basic_sync *bstats,
        }
        do {
                if (running)
-                       start = u64_stats_fetch_begin_irq(&b->syncp);
+                       start = u64_stats_fetch_begin(&b->syncp);
                bytes = u64_stats_read(&b->bytes);
                packets = u64_stats_read(&b->packets);
-       } while (running && u64_stats_fetch_retry_irq(&b->syncp, start));
+       } while (running && u64_stats_fetch_retry(&b->syncp, start));
 
        _bstats_update(bstats, bytes, packets);
 }
@@ -187,10 +187,10 @@ static void gnet_stats_read_basic(u64 *ret_bytes, u64 *ret_packets,
                        u64 bytes, packets;
 
                        do {
-                               start = u64_stats_fetch_begin_irq(&bcpu->syncp);
+                               start = u64_stats_fetch_begin(&bcpu->syncp);
                                bytes = u64_stats_read(&bcpu->bytes);
                                packets = u64_stats_read(&bcpu->packets);
-                       } while (u64_stats_fetch_retry_irq(&bcpu->syncp, start));
+                       } while (u64_stats_fetch_retry(&bcpu->syncp, start));
 
                        t_bytes += bytes;
                        t_packets += packets;
@@ -201,10 +201,10 @@ static void gnet_stats_read_basic(u64 *ret_bytes, u64 *ret_packets,
        }
        do {
                if (running)
-                       start = u64_stats_fetch_begin_irq(&b->syncp);
+                       start = u64_stats_fetch_begin(&b->syncp);
                *ret_bytes = u64_stats_read(&b->bytes);
                *ret_packets = u64_stats_read(&b->packets);
-       } while (running && u64_stats_fetch_retry_irq(&b->syncp, start));
+       } while (running && u64_stats_fetch_retry(&b->syncp, start));
 }
 
 static int
index 1291c2431d440586ec891bb450a7f645dd834461..dcc550b871623805d3fcbbe464db44672577cd33 100644 (file)
@@ -934,12 +934,12 @@ static void dsa_slave_get_ethtool_stats(struct net_device *dev,
 
                s = per_cpu_ptr(dev->tstats, i);
                do {
-                       start = u64_stats_fetch_begin_irq(&s->syncp);
+                       start = u64_stats_fetch_begin(&s->syncp);
                        tx_packets = u64_stats_read(&s->tx_packets);
                        tx_bytes = u64_stats_read(&s->tx_bytes);
                        rx_packets = u64_stats_read(&s->rx_packets);
                        rx_bytes = u64_stats_read(&s->rx_bytes);
-               } while (u64_stats_fetch_retry_irq(&s->syncp, start));
+               } while (u64_stats_fetch_retry(&s->syncp, start));
                data[0] += tx_packets;
                data[1] += tx_bytes;
                data[2] += rx_packets;
index 4c8782df8eefae7f683b2a1d679cb3db3305deae..31f463f46f6edc0ae81d5396222a1845b49ff98f 100644 (file)
@@ -1686,9 +1686,9 @@ u64 snmp_get_cpu_field64(void __percpu *mib, int cpu, int offt,
        bhptr = per_cpu_ptr(mib, cpu);
        syncp = (struct u64_stats_sync *)(bhptr + syncp_offset);
        do {
-               start = u64_stats_fetch_begin_irq(syncp);
+               start = u64_stats_fetch_begin(syncp);
                v = *(((u64 *)bhptr) + offt);
-       } while (u64_stats_fetch_retry_irq(syncp, start));
+       } while (u64_stats_fetch_retry(syncp, start));
 
        return v;
 }
index b7de5e46fdd8f867027bcc31f83da79ed4fad1b9..f84da849819cc7a86bc34b685a2a446b8b85947f 100644 (file)
@@ -1508,13 +1508,13 @@ static int put_nla_counters(struct sk_buff *skb, struct seg6_local_lwt *slwt)
 
                pcounters = per_cpu_ptr(slwt->pcpu_counters, i);
                do {
-                       start = u64_stats_fetch_begin_irq(&pcounters->syncp);
+                       start = u64_stats_fetch_begin(&pcounters->syncp);
 
                        packets = u64_stats_read(&pcounters->packets);
                        bytes = u64_stats_read(&pcounters->bytes);
                        errors = u64_stats_read(&pcounters->errors);
 
-               } while (u64_stats_fetch_retry_irq(&pcounters->syncp, start));
+               } while (u64_stats_fetch_retry(&pcounters->syncp, start));
 
                counters.packets += packets;
                counters.bytes += bytes;
index 9d7b238a67372eecf5660ef3b55d473f1b5cda33..965b9cb2ef3f2fe3ed597d55db467e318a97c579 100644 (file)
@@ -2316,9 +2316,9 @@ static inline u64 sta_get_tidstats_msdu(struct ieee80211_sta_rx_stats *rxstats,
        u64 value;
 
        do {
-               start = u64_stats_fetch_begin_irq(&rxstats->syncp);
+               start = u64_stats_fetch_begin(&rxstats->syncp);
                value = rxstats->msdu[tid];
-       } while (u64_stats_fetch_retry_irq(&rxstats->syncp, start));
+       } while (u64_stats_fetch_retry(&rxstats->syncp, start));
 
        return value;
 }
@@ -2384,9 +2384,9 @@ static inline u64 sta_get_stats_bytes(struct ieee80211_sta_rx_stats *rxstats)
        u64 value;
 
        do {
-               start = u64_stats_fetch_begin_irq(&rxstats->syncp);
+               start = u64_stats_fetch_begin(&rxstats->syncp);
                value = rxstats->bytes;
-       } while (u64_stats_fetch_retry_irq(&rxstats->syncp, start));
+       } while (u64_stats_fetch_retry(&rxstats->syncp, start));
 
        return value;
 }
index b52afe316dc41deac29f4bb1f6eae7c3d4ade90e..35b5f806fdda178d9742572845bf6fb0fca73dbe 100644 (file)
@@ -1079,9 +1079,9 @@ static void mpls_get_stats(struct mpls_dev *mdev,
 
                p = per_cpu_ptr(mdev->stats, i);
                do {
-                       start = u64_stats_fetch_begin_irq(&p->syncp);
+                       start = u64_stats_fetch_begin(&p->syncp);
                        local = p->stats;
-               } while (u64_stats_fetch_retry_irq(&p->syncp, start));
+               } while (u64_stats_fetch_retry(&p->syncp, start));
 
                stats->rx_packets       += local.rx_packets;
                stats->rx_bytes         += local.rx_bytes;
index efab2b06d3732b522b9e5d07982abf0363870fff..5a7349002508e79ab4a53da7cc43e6ae078549e8 100644 (file)
@@ -2296,13 +2296,13 @@ static int ip_vs_stats_percpu_show(struct seq_file *seq, void *v)
                u64 conns, inpkts, outpkts, inbytes, outbytes;
 
                do {
-                       start = u64_stats_fetch_begin_irq(&u->syncp);
+                       start = u64_stats_fetch_begin(&u->syncp);
                        conns = u->cnt.conns;
                        inpkts = u->cnt.inpkts;
                        outpkts = u->cnt.outpkts;
                        inbytes = u->cnt.inbytes;
                        outbytes = u->cnt.outbytes;
-               } while (u64_stats_fetch_retry_irq(&u->syncp, start));
+               } while (u64_stats_fetch_retry(&u->syncp, start));
 
                seq_printf(seq, "%3X %8LX %8LX %8LX %16LX %16LX\n",
                           i, (u64)conns, (u64)inpkts,
index 0a6f3c1e9ab7531fd1eed3961c4123ea4bbd0e3a..7977f0422ecf62e854d8e31de12418df5e419d70 100644 (file)
@@ -1534,10 +1534,10 @@ static int nft_dump_stats(struct sk_buff *skb, struct nft_stats __percpu *stats)
        for_each_possible_cpu(cpu) {
                cpu_stats = per_cpu_ptr(stats, cpu);
                do {
-                       seq = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
+                       seq = u64_stats_fetch_begin(&cpu_stats->syncp);
                        pkts = cpu_stats->pkts;
                        bytes = cpu_stats->bytes;
-               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, seq));
+               } while (u64_stats_fetch_retry(&cpu_stats->syncp, seq));
                total.pkts += pkts;
                total.bytes += bytes;
        }
index 8a22574ed7ad6892342b39ba449061d0e3995f49..ae7d4d03790c425da589035208d637fa8c6f7136 100644 (file)
@@ -715,9 +715,9 @@ static void get_dp_stats(const struct datapath *dp, struct ovs_dp_stats *stats,
                percpu_stats = per_cpu_ptr(dp->stats_percpu, i);
 
                do {
-                       start = u64_stats_fetch_begin_irq(&percpu_stats->syncp);
+                       start = u64_stats_fetch_begin(&percpu_stats->syncp);
                        local_stats = *percpu_stats;
-               } while (u64_stats_fetch_retry_irq(&percpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry(&percpu_stats->syncp, start));
 
                stats->n_hit += local_stats.n_hit;
                stats->n_missed += local_stats.n_missed;
index d4a2db0b229989864fa821f38e7787b13f5c583c..0a0e4c283f02eb3308405950fea7fc185e3f7886 100644 (file)
@@ -205,9 +205,9 @@ static void tbl_mask_array_reset_counters(struct mask_array *ma)
 
                        stats = per_cpu_ptr(ma->masks_usage_stats, cpu);
                        do {
-                               start = u64_stats_fetch_begin_irq(&stats->syncp);
+                               start = u64_stats_fetch_begin(&stats->syncp);
                                counter = stats->usage_cntrs[i];
-                       } while (u64_stats_fetch_retry_irq(&stats->syncp, start));
+                       } while (u64_stats_fetch_retry(&stats->syncp, start));
 
                        ma->masks_usage_zero_cntr[i] += counter;
                }
@@ -1136,10 +1136,9 @@ void ovs_flow_masks_rebalance(struct flow_table *table)
 
                        stats = per_cpu_ptr(ma->masks_usage_stats, cpu);
                        do {
-                               start = u64_stats_fetch_begin_irq(&stats->syncp);
+                               start = u64_stats_fetch_begin(&stats->syncp);
                                counter = stats->usage_cntrs[i];
-                       } while (u64_stats_fetch_retry_irq(&stats->syncp,
-                                                          start));
+                       } while (u64_stats_fetch_retry(&stats->syncp, start));
 
                        masks_and_count[i].counter += counter;
                }