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]
Date:   Thu, 7 Apr 2022 20:30:02 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Lorenzo Bianconi <lorenzo@...nel.org>
Cc:     netdev@...r.kernel.org, lorenzo.bianconi@...hat.com,
        davem@...emloft.net, pabeni@...hat.com,
        thomas.petazzoni@...tlin.com, ilias.apalodimas@...aro.org,
        jbrouer@...hat.com, andrew@...n.ch, jdamato@...tly.com
Subject: Re: [RFC net-next 1/2] net: page_pool: introduce ethtool stats

On Thu,  7 Apr 2022 18:55:04 +0200 Lorenzo Bianconi wrote:
> +void page_pool_ethtool_stats_get_strings(u8 *data)

This needs to return the pointer to after the used area, so drivers can
append more stats. Or make data double pointer and update it before
returning.

> +{
> +	static const struct {
> +		u8 type;
> +		char name[ETH_GSTRING_LEN];
> +	} stats[PP_ETHTOOL_STATS_MAX] = {
> +		{
> +			.type = PP_ETHTOOL_ALLOC_FAST,

Why enumerate the type? It's not used.

> +			.name = "rx_pp_alloc_fast"
> +		}, {
> +			.type = PP_ETHTOOL_ALLOC_SLOW,
> +			.name = "rx_pp_alloc_slow"
> +		}, {
> +			.type = PP_ETHTOOL_ALLOC_SLOW_HIGH_ORDER,
> +			.name = "rx_pp_alloc_slow_ho"
> +		}, {
> +			.type = PP_ETHTOOL_ALLOC_EMPTY,
> +			.name = "rx_pp_alloc_empty"
> +		}, {
> +			.type = PP_ETHTOOL_ALLOC_REFILL,
> +			.name = "rx_pp_alloc_refill"
> +		}, {
> +			.type = PP_ETHTOOL_ALLOC_WAIVE,
> +			.name = "rx_pp_alloc_waive"
> +		}, {
> +			.type = PP_ETHTOOL_RECYCLE_CACHED,
> +			.name = "rx_pp_recycle_cached"
> +		}, {
> +			.type = PP_ETHTOOL_RECYCLE_CACHE_FULL,
> +			.name = "rx_pp_recycle_cache_full"
> +		}, {
> +			.type = PP_ETHTOOL_RECYCLE_RING,
> +			.name = "rx_pp_recycle_ring"
> +		}, {
> +			.type = PP_ETHTOOL_RECYCLE_RING_FULL,
> +			.name = "rx_pp_recycle_ring_full"
> +		}, {
> +			.type = PP_ETHTOOL_RECYCLE_RELEASED_REF,
> +			.name = "rx_pp_recycle_released_ref"
> +		},
> +	};
> +	int i;
> +
> +	for (i = 0; i < PP_ETHTOOL_STATS_MAX; i++) {
> +		memcpy(data, stats[i].name, ETH_GSTRING_LEN);
> +		data += ETH_GSTRING_LEN;
> +	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ