Subject: Re: [PATCH net-next v6 05/11] net: ti: prueth: Adds ethtool support for ICSSM PRUETH Driver

From: Jakub Kicinski <[email-masked]>
Date: Thu, 24 Apr 2025 19:17:41 -0700

On Wed, 23 Apr 2025 12:53:50 +0530 Parvathi Pudi wrote:
> From: Roger Quadros <[email-masked]>
> 
> Changes for enabling ethtool support for the newly added PRU Ethernet
> interfaces. Extends the support for statistics collection from PRU internal
> memory and displays it in the user space. Along with statistics,
> enable/disable of features, configuring link speed etc.are now supported.
> 
> The firmware running on PRU maintains statistics in internal data memory.
> When requested ethtool collects all the statistics for the specified
> interface and displays it in the user space.
> 
> Makefile is updated to include ethtool support into PRUETH driver.

drivers/net/ethernet/ti/icssm/icssm_prueth.h:229: warning: Function parameter or struct member 'stormprev_counter_bc' not described in 'port_statistics'
drivers/net/ethernet/ti/icssm/icssm_prueth.h:229: warning: Function parameter or struct member 'stormprev_counter_mc' not described in 'port_statistics'
drivers/net/ethernet/ti/icssm/icssm_prueth.h:229: warning: Function parameter or struct member 'stormprev_counter_uc' not described in 'port_statistics'
drivers/net/ethernet/ti/icssm/icssm_prueth.h:229: warning: Function parameter or struct member 'cs_error' not described in 'port_statistics'
drivers/net/ethernet/ti/icssm/icssm_prueth.h:229: warning: Excess struct member 'stormprev_counter' description in 'port_statistics'

> +static const struct {
> +	char string[ETH_GSTRING_LEN];
> +	u32 offset;
> +} prueth_ethtool_stats[] = {
> +	{"txBcast", PRUETH_STAT_OFFSET(tx_bcast)},
> +	{"txMcast", PRUETH_STAT_OFFSET(tx_mcast)},
> +	{"txUcast", PRUETH_STAT_OFFSET(tx_ucast)},
> +	{"txOctets", PRUETH_STAT_OFFSET(tx_octets)},
> +	{"rxBcast", PRUETH_STAT_OFFSET(rx_bcast)},
> +	{"rxMcast", PRUETH_STAT_OFFSET(rx_mcast)},
> +	{"rxUcast", PRUETH_STAT_OFFSET(rx_ucast)},
> +	{"rxOctets", PRUETH_STAT_OFFSET(rx_octets)},
> +
> +	{"tx64byte", PRUETH_STAT_OFFSET(tx64byte)},
> +	{"tx65_127byte", PRUETH_STAT_OFFSET(tx65_127byte)},
> +	{"tx128_255byte", PRUETH_STAT_OFFSET(tx128_255byte)},
> +	{"tx256_511byte", PRUETH_STAT_OFFSET(tx256_511byte)},
> +	{"tx512_1023byte", PRUETH_STAT_OFFSET(tx512_1023byte)},
> +	{"tx1024byte", PRUETH_STAT_OFFSET(tx1024byte)},
> +	{"rx64byte", PRUETH_STAT_OFFSET(rx64byte)},
> +	{"rx65_127byte", PRUETH_STAT_OFFSET(rx65_127byte)},
> +	{"rx128_255byte", PRUETH_STAT_OFFSET(rx128_255byte)},
> +	{"rx256_511byte", PRUETH_STAT_OFFSET(rx256_511byte)},
> +	{"rx512_1023byte", PRUETH_STAT_OFFSET(rx512_1023byte)},
> +	{"rx1024byte", PRUETH_STAT_OFFSET(rx1024byte)},
> +
> +	{"lateColl", PRUETH_STAT_OFFSET(late_coll)},
> +	{"singleColl", PRUETH_STAT_OFFSET(single_coll)},
> +	{"multiColl", PRUETH_STAT_OFFSET(multi_coll)},
> +	{"excessColl", PRUETH_STAT_OFFSET(excess_coll)},

Do not dump into ethtool -S what's reported via standard stats.