]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
eth: nfp: Remove u64_stats_update_begin()/end() for stats fetch
authorLi RongQing <lirongqing@baidu.com>
Fri, 15 Aug 2025 01:56:19 +0000 (09:56 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Aug 2025 00:30:01 +0000 (17:30 -0700)
This place is fetching the stats, u64_stats_update_begin()/end()
should not be used, and the fetcher of stats is in the same
context as the updater of the stats, so don't need any protection

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20250815015619.2713-1-lirongqing@baidu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/netronome/nfp/nfd3/dp.c
drivers/net/ethernet/netronome/nfp/nfdk/dp.c

index 08086eb76996f7fe42a64367c946c850d32d07dd..91a227929a5ffd97b250620a56941a94101f6b44 100644 (file)
@@ -1169,14 +1169,10 @@ int nfp_nfd3_poll(struct napi_struct *napi, int budget)
 
        if (r_vec->nfp_net->rx_coalesce_adapt_on && r_vec->rx_ring) {
                struct dim_sample dim_sample = {};
-               unsigned int start;
                u64 pkts, bytes;
 
-               do {
-                       start = u64_stats_fetch_begin(&r_vec->rx_sync);
-                       pkts = r_vec->rx_pkts;
-                       bytes = r_vec->rx_bytes;
-               } while (u64_stats_fetch_retry(&r_vec->rx_sync, start));
+               pkts = r_vec->rx_pkts;
+               bytes = r_vec->rx_bytes;
 
                dim_update_sample(r_vec->event_ctr, pkts, bytes, &dim_sample);
                net_dim(&r_vec->rx_dim, &dim_sample);
@@ -1184,14 +1180,10 @@ int nfp_nfd3_poll(struct napi_struct *napi, int budget)
 
        if (r_vec->nfp_net->tx_coalesce_adapt_on && r_vec->tx_ring) {
                struct dim_sample dim_sample = {};
-               unsigned int start;
                u64 pkts, bytes;
 
-               do {
-                       start = u64_stats_fetch_begin(&r_vec->tx_sync);
-                       pkts = r_vec->tx_pkts;
-                       bytes = r_vec->tx_bytes;
-               } while (u64_stats_fetch_retry(&r_vec->tx_sync, start));
+               pkts = r_vec->tx_pkts;
+               bytes = r_vec->tx_bytes;
 
                dim_update_sample(r_vec->event_ctr, pkts, bytes, &dim_sample);
                net_dim(&r_vec->tx_dim, &dim_sample);
index ab3cd06ed63ed06eb04c88bea5eea610061e7366..ee0db3d5fd66be7f0943a334e750a729e2c93b17 100644 (file)
@@ -1279,14 +1279,10 @@ int nfp_nfdk_poll(struct napi_struct *napi, int budget)
 
        if (r_vec->nfp_net->rx_coalesce_adapt_on && r_vec->rx_ring) {
                struct dim_sample dim_sample = {};
-               unsigned int start;
                u64 pkts, bytes;
 
-               do {
-                       start = u64_stats_fetch_begin(&r_vec->rx_sync);
-                       pkts = r_vec->rx_pkts;
-                       bytes = r_vec->rx_bytes;
-               } while (u64_stats_fetch_retry(&r_vec->rx_sync, start));
+               pkts = r_vec->rx_pkts;
+               bytes = r_vec->rx_bytes;
 
                dim_update_sample(r_vec->event_ctr, pkts, bytes, &dim_sample);
                net_dim(&r_vec->rx_dim, &dim_sample);
@@ -1294,14 +1290,10 @@ int nfp_nfdk_poll(struct napi_struct *napi, int budget)
 
        if (r_vec->nfp_net->tx_coalesce_adapt_on && r_vec->tx_ring) {
                struct dim_sample dim_sample = {};
-               unsigned int start;
                u64 pkts, bytes;
 
-               do {
-                       start = u64_stats_fetch_begin(&r_vec->tx_sync);
-                       pkts = r_vec->tx_pkts;
-                       bytes = r_vec->tx_bytes;
-               } while (u64_stats_fetch_retry(&r_vec->tx_sync, start));
+               pkts = r_vec->tx_pkts;
+               bytes = r_vec->tx_bytes;
 
                dim_update_sample(r_vec->event_ctr, pkts, bytes, &dim_sample);
                net_dim(&r_vec->tx_dim, &dim_sample);