lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zoj_1JWfd_3Yu71t@lore-desk>
Date: Sat, 6 Jul 2024 10:27:00 +0200
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Simon Horman <horms@...nel.org>
Cc: netdev@...r.kernel.org, nbd@....name, lorenzo.bianconi83@...il.com,
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, conor@...nel.org,
	linux-arm-kernel@...ts.infradead.org, robh+dt@...nel.org,
	krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
	devicetree@...r.kernel.org, catalin.marinas@....com,
	will@...nel.org, upstream@...oha.com,
	angelogioacchino.delregno@...labora.com,
	benjamin.larsson@...exis.eu, rkannoth@...vell.com,
	sgoutham@...vell.com, andrew@...n.ch, arnd@...db.de
Subject: Re: [PATCH v5 net-next 2/2] net: airoha: Introduce ethernet support
 for EN7581 SoC

> On Thu, Jul 04, 2024 at 10:08:11AM +0200, Lorenzo Bianconi wrote:
> > Add airoha_eth driver in order to introduce ethernet support for
> > Airoha EN7581 SoC available on EN7581 development board (en7581-evb).
> > en7581-evb networking architecture is composed by airoha_eth as mac
> > controller (cpu port) and a mt7530 dsa based switch.
> > EN7581 mac controller is mainly composed by Frame Engine (FE) and
> > QoS-DMA (QDMA) modules. FE is used for traffic offloading (just basic
> > functionalities are supported now) while QDMA is used for DMA operation
> > and QOS functionalities between mac layer and the dsa switch (hw QoS is
> > not available yet and it will be added in the future).
> > Currently only hw lan features are available, hw wan will be added with
> > subsequent patches.
> > 
> > Tested-by: Benjamin Larsson <benjamin.larsson@...exis.eu>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> 
> ...
> 
> > +static const char * const airoha_ethtool_stats_name[] = {
> > +	"tx_eth_pkt_cnt",
> > +	"tx_eth_byte_cnt",
> > +	"tx_ok_pkt_cnt",
> > +	"tx_ok_byte_cnt",
> > +	"tx_eth_drop_cnt",
> > +	"tx_eth_bc_cnt",
> > +	"tx_eth_mc_cnt",
> > +	"tx_eth_lt64_cnt",
> > +	"tx_eth_eq64_cnt",
> > +	"tx_eth_65_127_cnt",
> > +	"tx_eth_128_255_cnt",
> > +	"tx_eth_256_511_cnt",
> > +	"tx_eth_512_1023_cnt",
> > +	"tx_eth_1024_1518_cnt",
> > +	"tx_eth_gt1518_cnt",
> > +	"rx_eth_pkt_cnt",
> > +	"rx_eth_byte_cnt",
> > +	"rx_ok_pkt_cnt",
> > +	"rx_ok_byte_cnt",
> > +	"rx_eth_drop_cnt",
> > +	"rx_eth_bc_cnt",
> > +	"rx_eth_mc_cnt",
> > +	"rx_eth_crc_drop_cnt",
> > +	"rx_eth_frag_cnt",
> > +	"rx_eth_jabber_cnt",
> > +	"rx_eth_lt64_cnt",
> > +	"rx_eth_eq64_cnt",
> > +	"rx_eth_65_127_cnt",
> > +	"rx_eth_128_255_cnt",
> > +	"rx_eth_256_511_cnt",
> > +	"rx_eth_512_1023_cnt",
> > +	"rx_eth_1024_1518_cnt",
> > +	"rx_eth_gt1518_cnt",
> > +};
> 
> Hi Lorenzo,
> 
> Sorry for not noticing this earlier.

Hi Simon,

no worries :)

> It seems to me that some of the stats above could
> use standard stats, which is preferred.

Please correct me if I am wrong but it seems quite a common approach to have
same stats in both .ndo_get_stats64() and .get_ethtool_stats():
- https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/mediatek/mtk_eth_soc.c#L212
- https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/marvell/mvneta.c#L435
- https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/intel/i40e/i40e_ethtool.c#L243
- https://github.com/torvalds/linux/blob/master/net/mac80211/ethtool.c#L52
- ...

Do you mean I should just report common stats (e.g. tx_packets or tx_bytes) in
.ndo_get_stats64()? Or it is fine to just add .ndo_get_stats64() callback (not
supported at the moment)?

> 
> Basically, my understanding is that one should:
> 1. Implement .ndo_get_stats64
>    (that seems relevant here)
> 2. As appropriate implement ethtool_stats non-extended stats operations
>    (perhaps not relevant here)

Can you please provide me a pointer for it?

Regards,
Lorenzo

> 3. Then implement get_ethtool_stats for what is left over
> 
> ...

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ