Re: [PATCH net-next v4 9/9] net: dsa: lan9645x: add port statistics

Jakub Kicinski
2026-05-06T01:48:15Z

On Tue, 5 May 2026 18:46:18 -0700 Jakub Kicinski wrote:
> > +static const struct lan9645x_ethtool_stat lan9645x_port_ethtool_stats[] = {
> > + { "rx_cat_drop", SCNT_RX_CAT_DROP },
> > + { "rx_red_prio_0", SCNT_RX_RED_PRIO_0 },
>
> Per Documentation/networking/statistics.rst and the netdev stats hierarchy,
> counters that have a standard uAPI must not be duplicated in ethtool -S.
>
> The rx_cat_drop counter is summed into stats->rx_dropped in
> lan9645x_stats_get_stats64():
>
> stats->rx_dropped = c[SCNT_RX_LONG] +
> c[SCNT_DR_LOCAL] +
> c[SCNT_DR_TAIL] +
> c[SCNT_RX_CAT_DROP] +
> ...
>
> Since rtnl_link_stats64.rx_dropped is reachable via "ip -s link show",
> does exposing rx_cat_drop here duplicate a value already covered by the
> standard uAPI?
>
> [ ... ]
>
> > + { "tx_drop", SCNT_TX_DROP },
>
> Similarly, tx_drop feeds stats->tx_dropped:
>
> stats->tx_dropped = c[SCNT_TX_DROP] + c[SCNT_TX_AGED];
>
> Should tx_drop be dropped from the ethtool -S list for the same reason?

Ignore this part, I need to update the AI prompts..