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: <20130619115542.767eaee4@samsung-9>
Date:	Wed, 19 Jun 2013 11:55:42 -0700
From:	Stephen Hemminger <stephen@...workplumber.org>
To:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc:	davem@...emloft.net, Jesse Brandeburg <jesse.brandeburg@...el.com>,
	netdev@...r.kernel.org, gospo@...hat.com, sassmann@...hat.com,
	Shannon Nelson <shannon.nelson@...el.com>,
	PJ Waskiewicz <peter.p.waskiewicz.jr@...el.com>,
	e1000-devel@...ts.sourceforge.net
Subject: Re: [net-next 1/8] i40e: main driver core

On Thu, 13 Jun 2013 20:55:15 -0700
Jeff Kirsher <jeffrey.t.kirsher@...el.com> wrote:

> +
> +char i40e_driver_name[] = "i40e";

Obviously const

+/* 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)



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