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

From: Dong Yibo

Date: Tue Nov 24 2026 - 01:05:56 EST


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@xxxxxxxxx/
v2: https://lore.kernel.org/netdev/BD205A7832D36E7D+20261116030917.1329989-1-dong100@xxxxxxxxx/
---

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