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] [day] [month] [year] [list]
Message-ID: <YlBtgF9vH5uJwmKY@lore-desk>
Date:   Fri, 8 Apr 2022 19:14:40 +0200
From:   Lorenzo Bianconi <lorenzo.bianconi@...hat.com>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     Lorenzo Bianconi <lorenzo@...nel.org>, netdev@...r.kernel.org,
        davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
        thomas.petazzoni@...tlin.com, ilias.apalodimas@...aro.org,
        jbrouer@...hat.com, jdamato@...tly.com
Subject: Re: [PATCH v2 net-next 1/2] net: page_pool: introduce ethtool stats

On Apr 08, Andrew Lunn wrote:
> > +u8 *page_pool_ethtool_stats_get_strings(u8 *data)
> > +{
> > +	static const char stats[PP_ETHTOOL_STATS_MAX][ETH_GSTRING_LEN] = {
> > +		"rx_pp_alloc_fast",
> > +		"rx_pp_alloc_slow",
> > +		"rx_pp_alloc_slow_ho",
> > +		"rx_pp_alloc_empty",
> > +		"rx_pp_alloc_refill",
> > +		"rx_pp_alloc_waive",
> > +		"rx_pp_recycle_cached",
> > +		"rx_pp_recycle_cache_full",
> > +		"rx_pp_recycle_ring",
> > +		"rx_pp_recycle_ring_full",
> > +		"rx_pp_recycle_released_ref",
> > +	};
> > +	int i;
> > +
> > +	for (i = 0; i < PP_ETHTOOL_STATS_MAX; i++) {
> 
> I suggest you move this stats array out of the function, and then you
> can use ARRAY_SIZE(stats) instead of PP_ETHTOOL_STATS_MAX. That is a
> pretty common patters for ethtool statistics.

ack, I will fix it.

Regards,
Lorenzo

> 
>        Andrew
> 

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