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: <FC41C24E35F18A40888AACA1A36F3E4168533F7C@FMSMSX102.amr.corp.intel.com>
Date:	Thu, 20 Jun 2013 20:50:53 +0000
From:	"Nelson, Shannon" <shannon.nelson@...el.com>
To:	Stephen Hemminger <stephen@...workplumber.org>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>
CC:	"davem@...emloft.net" <davem@...emloft.net>,
	"Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"gospo@...hat.com" <gospo@...hat.com>,
	"sassmann@...hat.com" <sassmann@...hat.com>,
	"Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@...el.com>,
	"e1000-devel@...ts.sourceforge.net" 
	<e1000-devel@...ts.sourceforge.net>
Subject: RE: [net-next 1/8] i40e: main driver core

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@...workplumber.org]
> Sent: Wednesday, June 19, 2013 11:56 AM
> 
> On Thu, 13 Jun 2013 20:55:15 -0700
> Jeff Kirsher <jeffrey.t.kirsher@...el.com> wrote:
> 
> > +
> > +char i40e_driver_name[] = "i40e";
> 
> Obviously const

Yep.
 
> +/* Helper macros for reading the stats registers
> + *
> + * Since the device stats are not reset at PFReset, they likely will
> not
> + * be zeroed when the driver starts.  We'll save the first values read
> + * and use them as offsets to be subtracted from the raw values in
> order
> + * to report stats that count from zero.
> + */
> +#define I40E_STAT_UPDATE48(hireg, loreg, offset_loaded, offset, stat)
> \
> +do {
> \
> +	u64 new_data;                                                     \
> +	new_data = rd64(hw, (loreg));                                     \
> +	if (!(offset_loaded))                                             \
> +		(offset) = new_data;                                      \
> +	if (likely(new_data >= (offset)))                                 \
> +		(stat) = new_data - (offset);                             \
> +	else                                                              \
> +		(stat) = (new_data + ((u64)1 << 48)) - (offset);          \
> +	(stat) &= 0xFFFFFFFFFFFFULL;                                      \
> +} while (0)
> 
> Macro's suck, this could just as well be a function
> or maybe a macro that calls function (and go ahead and do string
> manipulation)

Yep - thanks.

sln


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