Re: [v3, net-next 10/12] bng_en: Add initial support for ethtool stats display

From: Bhargava Chenna Marreddy

Date: Fri Nov 28 2025 - 13:29:52 EST


On Fri, Nov 28, 2025 at 8:43 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Thu, 27 Nov 2025 01:19:29 +0530 Bhargava Marreddy wrote:
> > +static const char * const bnge_ring_rx_stats_str[] = {
> > + "rx_ucast_packets",
> > + "rx_mcast_packets",
> > + "rx_bcast_packets",
> > + "rx_discards",
> > + "rx_errors",
> > + "rx_ucast_bytes",
> > + "rx_mcast_bytes",
> > + "rx_bcast_bytes",
> > +};
> > +
> > +static const char * const bnge_ring_tx_stats_str[] = {
> > + "tx_ucast_packets",
> > + "tx_mcast_packets",
> > + "tx_bcast_packets",
> > + "tx_errors",
> > + "tx_discards",
> > + "tx_ucast_bytes",
> > + "tx_mcast_bytes",
> > + "tx_bcast_bytes",
> > +};
> > +
> > +static const char * const bnge_ring_tpa_stats_str[] = {
> > + "tpa_packets",
> > + "tpa_bytes",
> > + "tpa_events",
> > + "tpa_aborts",
> > +};
> > +
> > +static const char * const bnge_ring_tpa2_stats_str[] = {
> > + "rx_tpa_eligible_pkt",
> > + "rx_tpa_eligible_bytes",
> > + "rx_tpa_pkt",
> > + "rx_tpa_bytes",
> > + "rx_tpa_errors",
> > + "rx_tpa_events",
> > +};
> > +
> > +static const char * const bnge_rx_sw_stats_str[] = {
> > + "rx_l4_csum_errors",
> > + "rx_resets",
> > + "rx_buf_errors",
> > +};
>
> We do not allow duplicating standard stats in ethtool -S any more.

There are several hw counters ring-level, function-level, port-level
etc. which we
currently expose via ethtool exactly as is.
For the standard stats (via .ndo_get_stats64), we usually add
individual ring-level
and port-level counters.

Same stat string we see on both ethtool and standard will be populated
with different counters.

For Ex:
In the case of ethtool, rx_errors = ctx_hw_stats->rx_error_pkts;
# ethtool -S eno12399np0 | grep rx_errors
[0]: rx_errors: 0
[1]: rx_errors: 0

In the case of standard, rx_errors = (rx_false_carrier_frames + rx_jbr_frames);
# cat /sys/devices/pci0000:21/0000:21:01.0/0000:22:00.1/net/eno12409np1/statistics/rx_errors
0

Do you think ethtool and standard stats should have different
stat‑strings rather than matching?

Thanks,
Bhargava Marreddy

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature