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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1299102762.4277.4.camel@localhost>
Date:	Wed, 02 Mar 2011 21:52:42 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	dykmanj@...ux.vnet.ibm.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 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.

> +	}
> +}
> +
> +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.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
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