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:	Wed, 02 Mar 2011 17:28:42 -0500
From:	Jim Dykman <dykmanj@...ux.vnet.ibm.com>
To:	Ben Hutchings <bhutchings@...arflare.com>
CC:	netdev@...r.kernel.org,
	Piyush Chaudhary <piyushc@...ux.vnet.ibm.com>,
	Fu-Chung Chang <fcchang@...ux.vnet.ibm.com>,
	"William S. Cadden" <wscadden@...ux.vnet.ibm.com>,
	"Wen C. Chen" <winstonc@...ux.vnet.ibm.com>,
	Scot Sakolish <sakolish@...ux.vnet.ibm.com>,
	Jian Xiao <jian@...ux.vnet.ibm.com>,
	"Carol L. Soto" <clsoto@...ux.vnet.ibm.com>,
	"Sarah J. Sheppard" <sjsheppa@...ux.vnet.ibm.com>
Subject: Re: [PATCH 27/27] HFI: hf ethtool support

On 3/2/2011 4:52 PM, Ben Hutchings wrote:
> On Wed, 2011-03-02 at 16:10 -0500, dykmanj@...ux.vnet.ibm.com wrote:
> [...]
>> +static int hf_get_sset_count(struct net_device *netdev, int sset)
>> +{
>> +	switch (sset) {
>> +	case ETH_SS_STATS:
>> +		return ARRAY_SIZE(hf_ethtool_stats_keys);
>> +	default:
>> +		return -EOPNOTSUPP;
> 
> The error code should be -EINVAL, I think.

ok

> 
>> +	}
>> +}
>> +
>> +static void hf_get_ethtool_stats(struct net_device *netdev,
>> +		struct ethtool_stats *stats, u64 *data)
>> +{
>> +	struct hf_net	*net = netdev_priv(netdev);
>> +	struct hf_if	*net_if = &(net->hfif);
>> +
>> +	memcpy(data, &(net_if->eth_stats), sizeof(struct hf_ethtool_stats));
> [...]
> 
> This may result in word tearing, particularly if this driver can be
> built for a 32-bit system.  Since the stats appear to be updated
> asynchronously in the data path, you may have to declare them as
> unsigned long and then extend them to 64-bit in hf_get_ethtool_stats().
> 
> Ben.
> 

It is 64-bit only, but we forgot to mention that in Kconfig.

Thanks.

Jim Dykman

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ