Article View: linux.kernel.netdev
Article #17189Re: [PATCH net-next v03 2/4] hinic3: Avoid concurrent updates on 32-bit systems.
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 13:51
Date: Mon, 16 Nov 2026 13:51
105 lines
12057 bytes
12057 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message and Fixes: tag describe a bug this driver can
never hit.
- [Low] The patch drops `csum_errors` from `rx_errors` in
hinic3_get_stats64() (`errors = rxq_stats->other_errors;`).
--
hinic3: Avoid concurrent updates on 32-bit systems.
This commit reworks the u64_stats reader loops in hinic3_get_stats64().
Per-queue values are now assigned inside the fetch/retry loop and added
into rtnl_link_stats64 outside it. The patch also drops csum_errors from
rx_errors, removes the NULL checks on nic_dev->txqs and nic_dev->rxqs, and
removes the zeroing of the local counters before each loop.
> hinic3: Avoid concurrent updates on 32-bit systems.
>
> Within the while loop of hinic3_get_stats64(), the counters between
> u64_stats_fetch_retry and u64_stats_fetch_begin are incremented by +=.
> This operation will cause repeated counting of the counters on a 32-bit
> system. Therefore, change += to + and the counters are incremented
> out side the wile loop.
[Severity: Low]
Can this driver be built on a 32-bit kernel? The Kconfig in
drivers/net/ethernet/huawei/hinic3/ has:
depends on PCI_MSI && 64BIT
When BITS_PER_LONG == 64, include/linux/u64_stats_sync.h defines:
static inline bool __u64_stats_fetch_retry(const struct u64_stats_sync *syncp,
unsigned int start)
{
return false;
}
So the old loop body ran exactly once per queue. The += into locals that
started at zero already gave correct totals in every configuration that
can be built.
The subject says "Avoid concurrent updates". However, the patch only
changes the reader side and does not change how updates are serialized.
This patch carries "Fixes: f47872bed40f" and will be picked up for
stable. Would it be better described as a cleanup of the reader idiom,
without the Fixes: tag?
> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c b/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c
> index da73811641a9d..d1fd91d97ccfc 100644
> --- a/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c
> +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c
> @@ -791,49 +791,35 @@ static void hinic3_get_stats64(struct net_device *netdev,
[ ... ]
> rxq = &nic_dev->rxqs[i];
> rxq_stats = &rxq->rxq_stats;
> do {
> start = u64_stats_fetch_begin(&rxq_stats->syncp);
> - bytes += rxq_stats->bytes;
> - packets += rxq_stats->packets;
> - errors += rxq_stats->csum_errors +
> - rxq_stats->other_errors;
> - dropped += rxq_stats->dropped;
> + bytes = rxq_stats->bytes;
> + packets = rxq_stats->packets;
> + errors = rxq_stats->other_errors;
[Severity: Low]
The commit message says:
csum_errors and other_errors are not the same things. csum_errors will
go to csum_bad in netdev netlink qstats.
Where is csum_errors reported as csum_bad? I could not find a netdev
queue stats implementation (stat_ops, get_queue_stats_rx or csum_bad)
anywhere under drivers/net/ethernet/huawei/hinic3/. It is not in this
patch, and it is not added later in the series.
After this change, the only remaining reference to csum_errors is the
reset in hinic3_rxq_clean_stats():
rxq_stats->csum_errors = 0;
rxq_stats->other_errors = 0;
Neither counter is incremented anywhere today, so rx_errors does not
change in practice. Once the datapath starts incrementing csum_errors,
would those counts then be missing from every uAPI?
This rx_errors change is unrelated to the retry loop change. Could it be
split into its own patch, or sent together with the qstats support it
refers to?
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794467919.git.gongfan1%40huawei.com
Technical Details
Message-ID:
<179483706251.3136.3766644106019912452@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364363-linux-kernel-netdev=dewy.ruReferences:
<6e3be192de613fb537fc2050ce28e1bd71346e35.1794467919.git.gongfan1@huawei.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364363-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v03 2/4] hinic3: Avoid concurrent updates on 32-bit systems. Date: Mon, 16 Nov 2026 13:51:02 +0000 Organization: Usenet Network Message-ID: <179483706251.3136.3766644106019912452@kernel.org> References: <6e3be192de613fb537fc2050ce28e1bd71346e35.1794467919.git.gongfan1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2076675"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:oIgTl09lsWx/zgIRajjgbrihQ04= sha256:kbyGsiJMmRxW2+Ufu6jqIH8Y23eZrtZkiHcwJnDoPP8= sha1:mH07f6WqO+sqleqZxKmfCCGLG0k= sha256:y7rp3ML+JMCFM5D5cgVClaBnum2m+f0SxDnf0zCbN0c= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 337DE114C38; Mon, 16 Nov 2026 16:52:10 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h33RGtzsjpTc; Mon, 16 Nov 2026 16:52:06 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-364363-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 464D0114C35; Mon, 16 Nov 2026 16:51:58 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 2D3B127E09; Mon, 16 Nov 2026 13:51:53 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794837070; b=wJ2Xe49l/c1vyf7N1qaHXha4IyLH5EXUWiDZpA/9odN3zlPcm/cbybWQfMfYqu+H9NBu EXhGObfXRPmuAocf1qHHUAuZ/4e2E5xeQ+4Gbmv9orS9qP5bbo3XyDJLN5/HjVdoMTT11 nv2CxQX9Eru4F64AXEsgGTG9Ne5qHnX51CY6kPVTYcfxfKRDiNm7Ok5ZYbfZTkLbX3/mB TG3xBocXQWsUWIRBr4BqLiDvGPBcvlzjs0o3sXrm/oI0rRUv1CO+RCNYNtznunQNiA4hL Krdh/4wS4t+Pjcp3/HKjKmTCsLYprmANLYD1Eoui+4YWCa38zd1mChtA8+wf/IpilhQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794837070; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=KG1MGo/DVuw8aITbp4BPPajePR4Ohrcz/mqxJPeMWfU=; b=ir5te2avHScEPaU+nC7dlJJfIXskDythc9ROVjzm90mB5hSIoOpNRYC8qPB8MKOtW1pV BFJVcPO1cHeg2OQLr0RayviadMJpf0v02VxchUbuxYjx/ze9zSi2+V48u4isX1gCM34Hx X1JMy5QIS2k/Y9VTaEUbH6yVYN7jA5cHYEtF6HrgwXJD0/T2k1xuKL0PxzP72mXF3CcAp BBVsaZCuFpWMHVgbWWtL5kKTF04ubzu5z1x0x6wXRx2NUq6XhaMPxAKzuGOLKr2/xC5ZN fNcw/GBV8nmfj6r7PmB+JZWBCPz5crAKK4iXI99SaZUXLEoaLc56o96+7A317/jsqjQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SneNHsiK; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 701C3608593F; Mon, 16 Nov 2026 13:51:10 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SneNHsiK X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794837064; b=uBPv/MxTBdeWVs+9xLdfCND7cuh7VqEn4S27f1Ti2gJRFqwvUrDbPWJNtKtTkGu9dNLt WXImsqLgmPitUGT+Pc/5MSXp3eNJnGwQ8iSRvyYvnBBqkLhP28MtVuitQYPGo1gGTJdbR 8yVkPY4Xa55T7NInpUV0qJvW3LxHu7gSiTTIhE0XCodFEQLmzfNaWFbg368cEvUshcM6g O5ZtQFipiMMrl4eg6OVTK9SkiAK7ogLCaIsE3n2toI6sfpTeWv3wQGefxh41lEX2MYdN9 LIS5Sy74tnak7IgAMYv6bFa7HPRtfAt59Vw4pLb83iJVY2kYblzDxaMfbKDfzC4i62w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794837064; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=KG1MGo/DVuw8aITbp4BPPajePR4Ohrcz/mqxJPeMWfU=; b=r8xrMJygW25FfN1L3TLpkrbv7It/9KwJKTvY67hg1VMBrees7y4owjr1WeoE3xZO5XAr fLKAMvg9f1qouU9QmdjOGXLbjYqQP0SIh04JR+0Wb2/aLAHy6a13CXON2ulS3QCgrrleb Cl0HGhWEv2qgASr6M/hmbRhAqAG1cspzi/bkjMuDpcHIzo26THx+SGUTqbGbAIMO1+4Dh I/K90UECuqq5c+PiTReY2NFGVx09alhWxxb5RHPpZYTI5BsuJmFHA0uZjWGyYw6NIaxUf Hw/RBB6iu9ruf/UbD5Is9NIdOWK9lGEMaf4cxmoeTsp3BO5fX1yRDwV31iSM7d4LKOg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SneNHsiK; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EA03608590E; Mon, 16 Nov 2026 13:51:04 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id F26001F000C8; Mon, 16 Nov 2026 13:51:02 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794837064; bh=KG1MGo/DVuw8aITbp4BPPajePR4Ohrcz/mqxJPeMWfU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=SneNHsiKDy+0YZv7oPb8vmoTrIlVZQMg0EPXkHKbvPvyiljrq/LUHd9BUnYFgCZrn 6ddf8sG01zboffWEVIUq8NsK8kJD8ef9dgvazigOCFFqhRcDOnDjlurIjzVg+4KV/y XEiJlJ1ugUbPB9sYgse2rzHuxyVSWEjI1v/5B5S/XgVAWM1odRu4MyzAM6lrFmKJT0 SJ3lMRh0kmnKc2dJOpcN2WhBAfUDQ6DdHC2vyejpj1TpgrbQWyZoaT8rX+o7iddmGQ EOZ+oGkY2i3ztqt2hLnst5KZNeENXRsIi0Y/wkG6QIkOoVf+HXkotg2O1pjkt+IWRS NWpMMyng5ea+g== X-Cc: wudi234@huawei.com, tengpeisen@huawei.com, netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, andrew+netdev@lunn.ch, ioana.ciornei@nxp.com, maxime.chevallier@bootlin.com, mohsin.bashr@gmail.com, dimitri.daskalakis1@gmail.com, hramamurthy@google.com, larysa.zaremba@intel.com, vadim.fedorenko@linux.dev, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, zhoushuai28@huawei.com, wulike1@huawei.com X-In-Reply-To: <6e3be192de613fb537fc2050ce28e1bd71346e35.1794467919.git.gongfan1@huawei.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list