From nobody Sat Oct 4 14:16:59 2025 Received: from baidu.com (mx24.baidu.com [111.206.215.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFA352951A0; Fri, 15 Aug 2025 01:58:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.206.215.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755223112; cv=none; b=rDo6StjOF9wn7ikfrSgTM79DYwaraDt5UTU4FAu5ySXSIwdp/acB80T4GPa9LTRdUKzIGIIYZoSiuxKrMLNjuk+b65xDsWThPDNvVA32TSNOI0uhWDoMjopuCncpW6pQx74JEGZAx+eXSLfnPrRTWuMEjpOn8RAsI4+5uk5iaag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755223112; c=relaxed/simple; bh=Hq7PmO/kPSl7BVcZCHFImQ6aYZBnb/NFt/FZT31ElCA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=IoZTFkYYFp67U+MNtAToTxRPzeUPbcbEVa5fvjd/uo3kHz9KuDp61MSqsYVgZifsp/cBDMeOBnQzBfzAf6oacpc03+cuHHqB8fcR//b3cDExTvk9LA8sivnNgLTXM95+c3Q/L/XBPxzDG39Xu3gPqUnyNfEqJ6V3Ic1yGANnXbg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com; spf=pass smtp.mailfrom=baidu.com; arc=none smtp.client-ip=111.206.215.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baidu.com From: lirongqing To: , , , , , , , , , , , , , Subject: [PATCH][net-next] eth: nfp: Remove u64_stats_update_begin()/end() for stats fetch Date: Fri, 15 Aug 2025 09:56:19 +0800 Message-ID: <20250815015619.2713-1-lirongqing@baidu.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: bjkjy-exc4.internal.baidu.com (172.31.50.48) To bjkjy-exc3.internal.baidu.com (172.31.50.47) X-FEAS-Client-IP: 172.31.50.47 X-FE-Policy-ID: 52:10:53:SYSTEM Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Li RongQing 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 --- drivers/net/ethernet/netronome/nfp/nfd3/dp.c | 16 ++++------------ drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 16 ++++------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c b/drivers/net/eth= ernet/netronome/nfp/nfd3/dp.c index 08086eb..91a2279 100644 --- a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c +++ b/drivers/net/ethernet/netronome/nfp/nfd3/dp.c @@ -1169,14 +1169,10 @@ int nfp_nfd3_poll(struct napi_struct *napi, int bud= get) =20 if (r_vec->nfp_net->rx_coalesce_adapt_on && r_vec->rx_ring) { struct dim_sample dim_sample =3D {}; - unsigned int start; u64 pkts, bytes; =20 - do { - start =3D u64_stats_fetch_begin(&r_vec->rx_sync); - pkts =3D r_vec->rx_pkts; - bytes =3D r_vec->rx_bytes; - } while (u64_stats_fetch_retry(&r_vec->rx_sync, start)); + pkts =3D r_vec->rx_pkts; + bytes =3D r_vec->rx_bytes; =20 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 bud= get) =20 if (r_vec->nfp_net->tx_coalesce_adapt_on && r_vec->tx_ring) { struct dim_sample dim_sample =3D {}; - unsigned int start; u64 pkts, bytes; =20 - do { - start =3D u64_stats_fetch_begin(&r_vec->tx_sync); - pkts =3D r_vec->tx_pkts; - bytes =3D r_vec->tx_bytes; - } while (u64_stats_fetch_retry(&r_vec->tx_sync, start)); + pkts =3D r_vec->tx_pkts; + bytes =3D r_vec->tx_bytes; =20 dim_update_sample(r_vec->event_ctr, pkts, bytes, &dim_sample); net_dim(&r_vec->tx_dim, &dim_sample); diff --git a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c b/drivers/net/eth= ernet/netronome/nfp/nfdk/dp.c index ab3cd06..ee0db3d 100644 --- a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c +++ b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c @@ -1279,14 +1279,10 @@ int nfp_nfdk_poll(struct napi_struct *napi, int bud= get) =20 if (r_vec->nfp_net->rx_coalesce_adapt_on && r_vec->rx_ring) { struct dim_sample dim_sample =3D {}; - unsigned int start; u64 pkts, bytes; =20 - do { - start =3D u64_stats_fetch_begin(&r_vec->rx_sync); - pkts =3D r_vec->rx_pkts; - bytes =3D r_vec->rx_bytes; - } while (u64_stats_fetch_retry(&r_vec->rx_sync, start)); + pkts =3D r_vec->rx_pkts; + bytes =3D r_vec->rx_bytes; =20 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 bud= get) =20 if (r_vec->nfp_net->tx_coalesce_adapt_on && r_vec->tx_ring) { struct dim_sample dim_sample =3D {}; - unsigned int start; u64 pkts, bytes; =20 - do { - start =3D u64_stats_fetch_begin(&r_vec->tx_sync); - pkts =3D r_vec->tx_pkts; - bytes =3D r_vec->tx_bytes; - } while (u64_stats_fetch_retry(&r_vec->tx_sync, start)); + pkts =3D r_vec->tx_pkts; + bytes =3D r_vec->tx_bytes; =20 dim_update_sample(r_vec->event_ctr, pkts, bytes, &dim_sample); net_dim(&r_vec->tx_dim, &dim_sample); --=20 2.9.4