public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber•org>
To: Jeff Kirsher <jeffrey.t.kirsher@intel•com>
Cc: davem@davemloft•net,
	Jesse Brandeburg <jesse.brandeburg@intel•com>,
	netdev@vger•kernel.org, gospo@redhat•com, sassmann@redhat•com,
	Shannon Nelson <shannon.nelson@intel•com>,
	PJ Waskiewicz <peter.p.waskiewicz.jr@intel•com>,
	e1000-devel@lists•sourceforge.net
Subject: Re: [net-next 1/8] i40e: main driver core
Date: Wed, 19 Jun 2013 11:55:42 -0700	[thread overview]
Message-ID: <20130619115542.767eaee4@samsung-9> (raw)
In-Reply-To: <1371182122-26629-2-git-send-email-jeffrey.t.kirsher@intel.com>

On Thu, 13 Jun 2013 20:55:15 -0700
Jeff Kirsher <jeffrey.t.kirsher@intel•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)

  parent reply	other threads:[~2013-06-19 18:55 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14  3:55 [net-next 0/8][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-06-14  3:55 ` [net-next 1/8] i40e: main driver core Jeff Kirsher
2013-06-14  5:29   ` Joe Perches
2013-06-16 21:34     ` Nelson, Shannon
2013-06-19 18:12   ` Ben Hutchings
2013-06-20  6:41     ` Nelson, Shannon
2013-06-20 19:46     ` Nelson, Shannon
2013-06-20 19:54       ` Ben Hutchings
2013-06-20 20:01         ` Nelson, Shannon
2013-06-20 20:52           ` Peter P Waskiewicz Jr
2013-06-19 18:55   ` Stephen Hemminger [this message]
2013-06-20  6:41     ` Nelson, Shannon
2013-06-20 20:50     ` Nelson, Shannon
2013-06-14  3:55 ` [net-next 2/8] i40e: transmit, receive, and napi Jeff Kirsher
2013-06-14  3:55 ` [net-next 3/8] i40e: driver ethtool core Jeff Kirsher
2013-06-19 18:27   ` Ben Hutchings
2013-06-20 19:47     ` Nelson, Shannon
2013-06-20 19:59       ` Ben Hutchings
2013-06-20 20:04         ` Nelson, Shannon
2013-06-21 15:39           ` Structured ethtool statistic names Ben Hutchings
2013-06-25 20:46             ` Nelson, Shannon
2013-06-19 18:38   ` [net-next 3/8] i40e: driver ethtool core Stephen Hemminger
2013-06-20 20:52     ` Nelson, Shannon
2013-06-19 18:40   ` Stephen Hemminger
2013-06-20 20:53     ` Nelson, Shannon
2013-06-19 18:41   ` Stephen Hemminger
2013-06-20 20:53     ` Nelson, Shannon
2013-06-14  3:55 ` [net-next 4/8] i40e: driver core headers Jeff Kirsher
2013-06-14  3:55 ` [net-next 5/8] i40e: implement virtual device interface Jeff Kirsher
2013-06-14  3:55 ` [net-next 6/8] i40e: init code and hardware support Jeff Kirsher
2013-06-14  3:55 ` [net-next 7/8] i40e: sysfs and debugfs interfaces Jeff Kirsher
2013-06-14  3:55 ` [net-next 8/8] i40e: include i40e in kernel proper Jeff Kirsher
  -- strict thread matches above, loose matches on Subject: below --
2013-09-06  5:43 [net-next 0/8][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-09-06  5:43 ` [net-next 1/8] i40e: main driver core Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130619115542.767eaee4@samsung-9 \
    --to=stephen@networkplumber$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=e1000-devel@lists$(echo .)sourceforge.net \
    --cc=gospo@redhat$(echo .)com \
    --cc=jeffrey.t.kirsher@intel$(echo .)com \
    --cc=jesse.brandeburg@intel$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=peter.p.waskiewicz.jr@intel$(echo .)com \
    --cc=sassmann@redhat$(echo .)com \
    --cc=shannon.nelson@intel$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox