Article View: linux.kernel.netdev
Article #22329Re: [PATCH net-next v3 5/5] net: rnpgbe: Add hardware and queue statistics
From: netdev-bot+sashiko
Date: Wed, 25 Nov 2026 06:36
Date: Wed, 25 Nov 2026 06:36
121 lines
12477 bytes
12477 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] After this patch the driver reports two RX totals that
disagree.
--
net: rnpgbe: Add hardware and queue statistics
This commit adds hardware RX CRC-error and multicast counters to
ndo_get_stats64, accumulated from the service task. It also reports
per-queue RX/TX packet and byte counters through netdev queue stats, and
exposes per-queue TX DMA mapping failures through ethtool statistics.
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_lib.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_lib.c
> index b7b0c45a0f664..fe320c4f389ba 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_lib.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_lib.c
[ ... ]
> @@ -615,6 +620,8 @@ static int rnpgbe_clean_rx_irq(struct mucse_q_vector *q_vector,
>
> /* probably a little skewed due to removing CRC */
> total_rx_bytes += skb->len;
> + delivered_bytes += skb->len;
> + delivered_packets++;
> rnpgbe_process_skb_fields(rx_ring, skb);
> rx_desc->wb.cmd = 0;
> napi_gro_receive(&q_vector->napi, skb);
> @@ -626,6 +633,8 @@ static int rnpgbe_clean_rx_irq(struct mucse_q_vector *q_vector,
> u64_stats_update_begin(&rx_ring->stats->syncp);
> rx_ring->stats->packets += total_rx_packets;
> rx_ring->stats->bytes += total_rx_bytes;
> + rx_ring->stats->delivered_packets += delivered_packets;
> + rx_ring->stats->delivered_bytes += delivered_bytes;
> rx_ring->stats->length_errors += total_rx_length_errors;
> atomic64_add(total_rx_dropped, &rx_ring->stats->dropped);
> u64_stats_update_end(&rx_ring->stats->syncp);
[ ... ]
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_stats.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_stats.c
> new file mode 100644
> index 0000000000000..efd2284fd93af
> --- /dev/null
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_stats.c
[ ... ]
> +static void rnpgbe_get_queue_stats_rx(struct net_device *netdev, int idx,
> + struct netdev_queue_stats_rx *stats)
> +{
> + struct mucse *mucse = netdev_priv(netdev);
> + const struct mucse_queue_stats *queue;
> + unsigned int start;
> +
> + queue = &mucse->rx_stats[idx];
> + do {
> + start = u64_stats_fetch_begin(&queue->syncp);
> + stats->packets = queue->delivered_packets;
> + stats->bytes = queue->delivered_bytes;
> + } while (u64_stats_fetch_retry(&queue->syncp, start));
[Severity: Medium]
Can this leave the qstat RX totals permanently out of step with the rtnl
RX totals?
rnpgbe_get_stats64() adds rx_stats[i].packets and rx_stats[i].bytes into
rx_packets and rx_bytes. In rnpgbe_clean_rx_irq(), the driver-drop paths
increase those counters but leave delivered_packets and delivered_bytes
alone. One example is the skb == NULL path at EOP:
if (!skb) {
atomic64_inc(&rx_ring->stats->skb_alloc_failures);
...
total_rx_bytes += size;
total_rx_packets++;
total_rx_dropped++;
The MUCSE_RX_DROP_RESOURCE EOP path and the rnpgbe_cleanup_headers()
failure path with size >= ETH_HLEN behave the same way.
This callback reports only delivered_* as qstat rx-packets and rx-bytes.
rnpgbe_get_base_stats() uses the same callback through
netdev_stat_queue_sum() for the inactive queues. So after the first
driver RX drop, the rtnl totals stay higher than the qstat totals. An
skb allocation failure under memory pressure is enough to cause that
drop. Nothing resets these counters, so the gap never closes.
The generic selftest expects the two sets of totals to match:
tools/testing/selftests/drivers/net/stats.py:pkt_byte_sum()
# Compare stats, rtnl stats and qstats must match,
...
if stat_cmp(rtstat, qstat) > 0:
raise KsftFailEx("Qstats are lower, fetched later")
The commit message says the split is intentional. Even so, could both
interfaces report the same packet and byte counters? One option is to
use packets and bytes here. Another is to keep driver drops out of the
rtnl rx_packets and rx_bytes totals.
> + stats->alloc_fail = atomic64_read(&queue->page_alloc_failures) +
> + atomic64_read(&queue->skb_alloc_failures);
> +}
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/6C54E9FB2E95869E%2B20261124060436.410989-1-dong100%40mucse.com
Technical Details
Message-ID:
<179558856602.3135.7505371780005583025@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371071-linux-kernel-netdev=dewy.ruReferences:
<DB48C65C5764A9FD+20261124060623.411536-1-dong100@mucse.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371071-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 5/5] net: rnpgbe: Add hardware and queue statistics Date: Wed, 25 Nov 2026 06:36:06 +0000 Organization: Usenet Network Message-ID: <179558856602.3135.7505371780005583025@kernel.org> References: <DB48C65C5764A9FD+20261124060623.411536-1-dong100@mucse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="133924"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:fB1HiNOHWHePqZd+ZFsx8c0htOU= sha256:SZ7/63O4MEEwBZo9bq2i0DHJn//FMlQeQIuwZkCQ5rY= sha1:7AWvaWicC6wRxwx3/jKgv0ilPAQ= sha256:UtUjN6RxDjxRTM0eKNn3wiLzscvadmkdNX6LSpN9Yrg= 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 3F0E4125E3F; Wed, 25 Nov 2026 09:36:28 +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 dUGBQ1Zq8N97; Wed, 25 Nov 2026 09:36:24 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-371071-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 490D0125E40; Wed, 25 Nov 2026 09:36:15 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 353BB2F420; Wed, 25 Nov 2026 06:36:14 +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=1795588573; b=m3QLNw/Lu52qgoiXYAz8HQ8sBKhRRvjSzSSiZd2efrtmkDDK3dybC60gEKl8U/6x18oi 3PPW3Q9FwN8BTDBNoLOZ0Kgm/xb9hWwEhHjMVfE9lnPtXdmcZ8cyRAIbZ6qf8H47Li3gb O43HCY9rR/Z6youyzWsTKOND/2RT7PWiUfk5b2IrY5J61Q1oLTZQZDJJPPCR7GHNbrHhK LylMQYw707vH5BnaCgjI6+j4d6zhTGaQMJxr4jFywL2hxdpOV7MR0qP4VrPTGlyH7UvKt 0kCw5Mz0g7vW03xVkblCTIZuK2vY/jPCSr/qHIdJinPJBme13pyTtPA5fiY82M1HUfw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795588573; 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=ZYLJZ6q+uI9UPksDd4iVcjy9aW9Y3HRmtIfdwK4ESxI=; b=SzAZKOLSIulN614i6ogB5qKb71XmTLB3JuiWVkc1IeZJxJAsmPeTwwpv4CRzKOtfjAyY Biw7u+ZZbxvL/ZCMqXqaFP23Fki6j6gq0AUH//xBwZBBg2P12g3ANmmlWhEEchBVBCjZo OeJLrnx2nkagbhvWQ62Hrp4O4+D6ISRuGiPlNM9457bIuWeDghJb2FyklPe9eQsfiqNmb nrAW4Wo+IJePM7EAcDNUR9MZOaLtXMt8CC7R6U1gC8bwKEiURLJCtx9NANA0syaBpUAVw 7DYkAs1RJ/wuDm3FZd0DcKfvsx8SzdRUrQ5lF98brbMog0auerVAqVBQa3HqBmb65EA== 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=Erf5VTqp; 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 76954606A31E; Wed, 25 Nov 2026 06:36:13 +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=Erf5VTqp 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=1795588567; b=iaNftEoucbcXoBM/oJdQru0MgxZGL+b95/m+UOgqjNQ6OpcVfLm7esXTmW1v713He5W3 L0G1fPFK6s8iaobobBXnvbGF6hVX+BvutON0/pi98ydUmt3h4zB1amJFQ2WIswH9RhWbR 2W+s4RdnY4mulkzFLfFjjOVlKQyTgXycJhfxeEkzb+GBgoUgDo2OT5dHlAGeskiQYBQaT eQ/Zf7AbFlvOxybDnRyBzCbB36yW3aW9SYTlq/L7QyaFvp1tSUs53Hldb0FqvZ/Uclz1g suKdhwdvcas2EGQeRij5ADQpoHcIGZfYZFEzvO5M/CLVhsD36Dm8b13T4cPITIT4FKg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795588567; 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=ZYLJZ6q+uI9UPksDd4iVcjy9aW9Y3HRmtIfdwK4ESxI=; b=XNXpvF2AmCWUEzPi6ylau+3xAWq9bXMJSJY5saM2pv/QlTeG0/zBCx/CHBCQ1mURxscE gAFI/ae2q9RTeYAF9BIMq06egvBDfiM0mF1xtJy3X0TKwWAmOk/E3TNbx5tZYPZHnUXdl phBZTILDoWdC1gqIMZmZp+b4LFfQxOMxdEXRS7lgTi3iJHboRYDrhVf+mbDJYrLssgYzW jHFaVaF9A0CflaMa6dPaiVTWqctoED5xXfDiWskl54GY9twGN4tB0vKJ3B1fQ1csTcYE+ nJNOlRu2OfxY4yic2VHoXugJnuRRH4WC6wBhjseJpsBYsISSPuUuIDSsku3vtWGhPBw== 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=Erf5VTqp; 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 98A27606A33C; Wed, 25 Nov 2026 06:36:07 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A65E1F00ACF; Wed, 25 Nov 2026 06:36:06 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795588566; bh=ZYLJZ6q+uI9UPksDd4iVcjy9aW9Y3HRmtIfdwK4ESxI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Erf5VTqpoqaVrI6hJ90XfSP4/P/gDGaLqOGN3CknZ2RFhCOwu8LhSm5fyPMYZsjpC crAad+KIQUZofKFZD74471SgplmJ+Mml43usYfHVEG5Vfs0Nc8IN2zbZT5afhIUn4E jbKe1UQ34/L49tPaedo72v843Hcrx6Vk2h2Pq+vC+n356iWp+6mFer3eqECL/c6LMD cUcrr59/rqDR99Ajonw5wwjQYbJzuhscMsvjT+4rHvhkEX7b7JAXlCpVhqop3d+TOc fl+bpA6NU/7uPSOrVY+/W7dxDAjrSBiYz9VL17Y9AsUcsswkd2/BLR5C7k783qcsxl cGJQyCPNtqiRQ== X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, yaojun@mucse.com X-In-Reply-To: <DB48C65C5764A9FD+20261124060623.411536-1-dong100@mucse.com> X-sashiko-severity: Medium 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