🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21540

[PATCH net-next v3 0/5] net: rnpgbe: Add basic management and statistics

#21540
From: Dong Yibo
Date: Tue, 24 Nov 2026 06:04
86 lines
12136 bytes
This patch series adds basic management and statistics support to the
RNPGBE driver.

The series introduces:
- Basic ethtool driver and link information
- Link settings reporting for copper, fibre and backplane ports
- Copper autonegotiation, speed/duplex and MDI/MDI-X configuration
- Primary MAC address changes
- Hardware and per-queue statistics

These changes allow users to inspect and configure the adapter and
monitor interface and queue statistics.

RX accounting follows the documented definitions of the two interfaces.
rtnl_link_stats64 includes good packets received by the host, including
those subsequently dropped by the driver. Netdev queue statistics count
packets successfully passed to the networking stack.

For example, an skb allocation failure increments rtnl RX packets/bytes
and rx_dropped, but does not increment queue RX packets/bytes. The
pkt_byte_sum selftest compares these totals directly, so its equality
check cannot hold after such a drop.

Native tests using the driver's RX and statistics functions verified
both accounting paths and reproduced this difference. The extracted
pkt_byte_sum function rejected the resulting counter values as expected.

Tested on N210 and N500 copper ports with firmware 1.1.8.0,
using an external module in a VM running Linux 7.3-rc6.
W=1 builds and Sparse checks passed.

The unmodified stats.py selftest reports four passes, three skips and
one failure per device. The failure occurs because the driver does not
support the channel configuration query required by
procfs_downup_hammer.

Additional tests passed for link configuration, MDI-X, MAC address
changes, queue statistics, multicast counters and concurrent statistics
reads during interface down/up cycles.

LLM assisted with development, testing and code review.

---
Changelog:
v2 -> v3:
[patch 2/5]
1. Remove TP from the advertising bitmap; retain it in supported
   and continue reporting PORT_TP.
2. Document the firmware capability requirements for default link
   configuration.
[patch 3/5]
1. Document firmware acknowledgement and timeout semantics for
   PHY_LINK_SET, including that a timed-out request is not applied
   later.

Links:
v1: https://lore.kernel.org/netdev/FB722C2F25FE9005+20261106112420.43050-1-dong100@mucse.com/
v2: https://lore.kernel.org/netdev/BD205A7832D36E7D+20261116030917.1329989-1-dong100@mucse.com/
---

Dong Yibo (5):
  net: rnpgbe: Add basic ethtool support
  net: rnpgbe: Report link settings through ethtool
  net: rnpgbe: Support copper link configuration
  net: rnpgbe: Allow changing the primary MAC address
  net: rnpgbe: Add hardware and queue statistics

 drivers/net/ethernet/mucse/rnpgbe/Makefile    |   2 +
 drivers/net/ethernet/mucse/rnpgbe/rnpgbe.h    |  24 ++
 .../net/ethernet/mucse/rnpgbe/rnpgbe_chip.c   |  57 +++-
 .../ethernet/mucse/rnpgbe/rnpgbe_ethtool.c    | 254 ++++++++++++++++++
 drivers/net/ethernet/mucse/rnpgbe/rnpgbe_hw.h |   3 +
 .../net/ethernet/mucse/rnpgbe/rnpgbe_lib.c    |  28 +-
 .../net/ethernet/mucse/rnpgbe/rnpgbe_main.c   |  21 +-
 .../net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.c |  42 ++-
 .../net/ethernet/mucse/rnpgbe/rnpgbe_mbx_fw.h |  26 ++
 .../net/ethernet/mucse/rnpgbe/rnpgbe_stats.c  | 241 +++++++++++++++++
 .../net/ethernet/mucse/rnpgbe/rnpgbe_stats.h  |  37 +++
 11 files changed, 725 insertions(+), 10 deletions(-)
 create mode 100644 drivers/net/ethernet/mucse/rnpgbe/rnpgbe_ethtool.c
 create mode 100644 drivers/net/ethernet/mucse/rnpgbe/rnpgbe_stats.c
 create mode 100644 drivers/net/ethernet/mucse/rnpgbe/rnpgbe_stats.h

-- 
2.50.1
Technical Details
Message-ID: <6C54E9FB2E95869E+20261124060436.410989-1-dong100@mucse.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370030-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370030-linux-kernel-netdev=dewy.ru
From: dong100@mucse.com (Dong Yibo)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v3 0/5] net: rnpgbe: Add basic management and statistics
Date: Tue, 24 Nov 2026 14:04:35 +0800
Organization: Usenet Network
Message-ID: <6C54E9FB2E95869E+20261124060436.410989-1-dong100@mucse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4066106"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:NoQ6tvLSPqHTh/mNYm7b3TzQM2c= sha256:awxI4woPFvKxEtutquzn+LVG2q2tuN1enFYTpSooAQw=
	sha1:53BxTYTZSL3FNPhvHW7BCpzYLNk= sha256:GS3RxbFlDJTQqpmSEhFsEbpVVOX/pq238/YbI281kAA=
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 A7915125DD0; Tue, 24 Nov 2026 09:06:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 7vHVdEtGaOXa;
	Tue, 24 Nov 2026 09:06:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370030-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mucse.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 7D394125DCC; Tue, 24 Nov 2026 09:06:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id C150526C13; Tue, 24 Nov 2026 06:05:59 +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=1795500359;
	b=mGl/OccJ9/EVOt8yhKhI4HY5drmEMjoQucgplY3mj5vEMWlX4mXFk5wFnPtUu72pM0C8
	 KEiOOJz6THzdKRst8j4xf/0qqCezh26wYTM+zdTyUZGzuJ2P4dfAJ2NzI2DRx+RkrDeYd
	 7Sr8y8j3f1+D6UJm++y7U+wkAvmsmRAN2p7q+YbqExayg7glY9HvIFkvLgBMLM5nHVo0k
	 bFN/8UdIWhLiBTScyxMKgLtlUu72erPTzr5LZvRFpi9bNMdTCyQL/7feXPVRfV9H7X484
	 C4GXYnVnMlD9WtICTGz4iUUKEVdKc5GYuag/CerXe8Wi8LSOPxnV2EThllQbuR7prZA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795500359;
	h=X-Original-To:Received:DMARC-Filter:X-QQ-mid:X-QQ-Originating-IP:
	 Received:X-QQ-SSF:X-QQ-GoodBg:X-BIZMAIL-ID:EX-QQ-RecipientCnt:From:To:
	 Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Transfer-Encoding:X-QQ-SENDSIZE:Feedback-ID:
	 X-QQ-XMAILINFO:X-QQ-XMRINFO:X-QQ-RECHKSPAM;
	bh=7tUtK96Vrc3ToBMYKBQfCF+TszVqJi2Mz9lx8dTS9vI=;
	b=XxllTmWVR85nfuL9stmXi6E3N8vrvVLQStQ0EHJ8oWxYGkFieLU3I1FcdYV14pYftRHh
	 1e/5exb71OSFD5u4EwDh7bU1NK388Knjc4JwJuZoEshq70BxsjsPVAZCA2Ub/j5kzSunO
	 8J3V+aQN8OSNKPQAiycWZtc+YSLXufIpF1Ull3+Ln0aE97GKsDNAmnZYBwPIETYA+Obxv
	 9mx4+N4UKpelCNOFH1KZOaxcYu+OhXpuVzpjPnQhXb46gOwqt0TONmhrj89dru9Q0fmEx
	 89/1GgYji7nnP1F0gj5dNYmRsLbOamuoaS5r4gQkRmoozyK49PfbPPmpxynk58gOGfg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=mucse.com;
	spf=pass smtp.mailfrom=mucse.com;
	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 A31EB606A331;
	Tue, 24 Nov 2026 06:05:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=54.204.34.130
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795500354;
	b=O5e61nodqOszTza1FIOcEyMwPIOTKb4f1A1JnXIwiqJUhTggTDPsXWEu/Z2y2KBr2Pdd
	 0/5AM9Btq/VCdjTKYi2Q/XdGp5lXRwQ0Znz5ktZE5/odYUpZv842+gmOE61rbuOVAnw/8
	 Wj4l2ZfQCs8PST4jMWQB8JA33nHL0Z432ESnjgzHOrkVZ+hGzu90GIYZ8nIlffXP1qruD
	 xjy1Blg4TaeCGssPiJFc4q5qwzcCL3P6jRApri9DlGGrTKzlVJGYNFvn4krN8rvR7oJSL
	 J+80rBaEeb7cifWfY/bapbCvJ9CW/DxeGPfPpjbTiEblFcrkvXhzeJa2Zu0Bs82fViA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795500354;
	h=DMARC-Filter:X-QQ-mid:X-QQ-Originating-IP:Received:X-QQ-SSF:
	 X-QQ-GoodBg:X-BIZMAIL-ID:EX-QQ-RecipientCnt:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding:
	 X-QQ-SENDSIZE:Feedback-ID:X-QQ-XMAILINFO:X-QQ-XMRINFO:X-QQ-RECHKSPAM;
	bh=7tUtK96Vrc3ToBMYKBQfCF+TszVqJi2Mz9lx8dTS9vI=;
	b=RO/hfU5SkfFCYqDOQ72gfpWNSt9u2jD4xtCu3RDlTzq2X/vDS39I8zgvTmPb3D5NywSQ
	 fkLMnhN0jvNjo37eDsSB+GMJRSL1XR36JlpNJ9Kz+Y6Be0/x0LvcD+pGsHmuUV3iC0V+z
	 YqeIL34lm4U2DVcRRPSQOaTIUvh6pX6ViftGnoLG0t67ND77uK6VmO6TEz95dVr5X2IwL
	 VqtXw/H0b6mH5xMSPuHiR/2Bwmx3U9GGuF7tyl2QqdGa0OfgX3cQ8vUmAUqearBQBiLxI
	 0L4YoiXgjNqEkCHnUIPjLCu9Dub9mquVs7TN+FGYqfXWbHJINxDyopQzUgoAO3HlIIQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=mucse.com;
	spf=pass smtp.mailfrom=mucse.com;
	arc=none smtp.remote-ip=54.204.34.130
X-Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7FE3606A322;
	Tue, 24 Nov 2026 06:05:49 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E7FE3606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mucse.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mucse.com
X-QQ-mid: zesmtpgz6t1795500281tbf84aae7
X-QQ-Originating-IP: HubCRq5QX3Bt0PI2rOlOoWj9JBSinD7H+UjuhqbUBd8=
X-Received: from nic-Precision-5820-Tower.tail7b ( [203.174.112.180])
	by bizesmtp.qq.com (ESMTP) with 
	id ; Tue, 24 Nov 2026 14:04:38 +0800 (CST)
X-QQ-SSF: 0000000000000000000000000000000
X-QQ-GoodBg: 0
X-BIZMAIL-ID: 7542653238409347261
X-EX-QQ-RecipientCnt: 10
X-Cc: linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org,
	dong100@mucse.com,
	yaojun@mucse.com
X-Mailer: git-send-email 2.50.1
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
X-QQ-SENDSIZE: 520
X-Feedback-ID: zesmtpgz:mucse.com:qybglogicsvrgz:qybglogicsvrgz3a-1
X-QQ-XMAILINFO: MXNHCNOZe6MOQH7q8x16Kld/oRFRgyMX0S2BPfh4mZu7PUJE4Bzrns/+
	zsXRes/fu3tcYo0QddtVpEdcVK5WDyUvkRkKcPap8Pf7jVLDEonP+TKKCagvWX/pIWJ2OWO
	vNZee5QUqeoELoNzxMjWLUMGKTi5xVXbaLqVGfPdeYrlmgfXf69CiuTk1Mb1FDqxhDfRXZY
	bN5/TGIWMOlrqcVhseqxghqpL+BMfKpROYkCjq54dVIMO78feMq0dsYuCycspBqiUn2EL9+
	QAVW8As3U94Sd5jxPdDpkl+TmOi7X5BdjJPL6tjkxtuuGn/UbyQVI51iV9u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