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: <1388686985.9947.22.camel@bwh-desktop.uk.level5networks.com>
Date:	Thu, 2 Jan 2014 18:23:05 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Sabrina Dubroca <sd@...asysnail.net>
CC:	<davem@...emloft.net>, <johannes@...solutions.net>,
	<netdev@...r.kernel.org>
Subject: Re: [PATCH 5/5] alx: add stats to ethtool

On Thu, 2014-01-02 at 12:01 +0000, Ben Hutchings wrote:
> On Thu, 2014-01-02 at 00:40 +0100, Sabrina Dubroca wrote:
> > Signed-off-by: Sabrina Dubroca <sd@...asysnail.net>
> > ---
> >  drivers/net/ethernet/atheros/alx/ethtool.c | 95 ++++++++++++++++++++++++++++++
> >  1 file changed, 95 insertions(+)
> > 
> > diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c
> > index 45b3650..259056f 100644
> > --- a/drivers/net/ethernet/atheros/alx/ethtool.c
> > +++ b/drivers/net/ethernet/atheros/alx/ethtool.c
> [...]
> > +static void alx_get_ethtool_stats(struct net_device *netdev,
> > +				  struct ethtool_stats *estats, u64 *data)
> > +{
> > +	struct alx_priv *alx = netdev_priv(netdev);
> > +	struct alx_hw *hw = &alx->hw;
> > +
> > +	spin_lock(&alx->stats_lock);
> > +
> > +	__alx_update_hw_stats(hw);
> > +	memcpy(data, &hw->stats, sizeof(hw->stats));
> 
> This definitely doesn't work if the members of hw->stats are typed as
> unsigned long...
[...]

Also it would be a good idea to assert the sizes match here:

	BUILD_BUG_ON(sizeof(hw->stats) != ALX_NUM_STATS * sizeof(u64));

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
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