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: <YlA7yQ0NZi94ob/Q@lunn.ch>
Date:   Fri, 8 Apr 2022 15:42:33 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Lorenzo Bianconi <lorenzo@...nel.org>
Cc:     netdev@...r.kernel.org, lorenzo.bianconi@...hat.com,
        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 2/2] net: mvneta: add support for
 page_pool_get_stats

> @@ -4732,9 +4732,13 @@ static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset,
>  	if (sset == ETH_SS_STATS) {
>  		int i;
>  
> -		for (i = 0; i < ARRAY_SIZE(mvneta_statistics); i++)
> -			memcpy(data + i * ETH_GSTRING_LEN,
> -			       mvneta_statistics[i].name, ETH_GSTRING_LEN);
> +		for (i = 0; i < ARRAY_SIZE(mvneta_statistics); i++) {
> +			memcpy(data, mvneta_statistics[i].name,
> +			       ETH_GSTRING_LEN);
> +			data += ETH_GSTRING_LEN;
> +		}

You don't need to touch this loop, you can just do:

> +
> +		page_pool_ethtool_stats_get_strings(data +
				ETH_GSTRING_LEN * ARRAY_SIZE(mvneta_staticstics)));
>  	}
>  }
>  
> @@ -5392,6 +5412,14 @@ static int mvneta_probe(struct platform_device *pdev)
>  	pp->rxq_def = rxq_def;
>  	pp->indir[0] = rxq_def;
>  
> +	stats_len = ARRAY_SIZE(mvneta_statistics) +
> +		    page_pool_ethtool_stats_get_count();
> +	pp->ethtool_stats = devm_kzalloc(&pdev->dev,
> +					 sizeof(*pp->ethtool_stats) * stats_len,
> +					 GFP_KERNEL);

Why do you do this? The page_pool stats are never stored in
pp->ethtool_stats.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ