netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Auke Kok <auke-jan.h.kok@intel.com>
To: jeff@garzik.org
Cc: akpm@osdl.org, netdev@vger.kernel.org, linas@austin.ibm.com,
	jesse.brandeburg@intel.com, john.ronciak@intel.com
Subject: Re: [patch 4/8] e1000: prevent statistics from getting garbled during reset
Date: Fri, 09 Jun 2006 11:28:07 -0700	[thread overview]
Message-ID: <4489BDB7.8000606@intel.com> (raw)
In-Reply-To: <200606090519.k595JiOL032023@shell0.pdx.osdl.net>

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]


Ack,

Jeff, please pull this patch from:

    git://lost.foo-projects.org/~ahkok/git/netdev-2.6 upstream

which is against netdev-2.6#upstream cac925a4aab1b7233d3beb591f53498816058a08

Cheers,

Auke


---

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Acked-by: Auke Kok <auke-jan.h.kok@intel.com>

---
  e1000_main.c |    8 +++++++-
  1 files changed, 7 insertions(+), 1 deletion(-)


akpm@osdl.org wrote:
> From: Linas Vepstas <linas@austin.ibm.com>
> 
> If a PCI bus error/fault triggers a PCI bus reset, attempts to get the
> ethernet packet count statistics from the hardware will fail, returning
> garbage data upstream.  This patch skips statistics data collection if the
> PCI device is not on the bus.
[snip]


[-- Attachment #2: e1000_prevent_garbled_stats_during_reset_linas.patch --]
[-- Type: text/x-patch, Size: 1276 bytes --]

e1000: prevent statistics from garbling during bus resets

If a PCI bus error/fault triggers a PCI bus reset, attempts to get
the ethernet packet count statistics from the hardware will fail,
returning garbage data upstream.  This patch skips statistics data
collection if the PCI device is not on the bus.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Acked-by: Auke Kok <auke-jan.h.kok@intel.com>

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 56c7492..a373ccb 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3045,14 +3045,20 @@ void
 e1000_update_stats(struct e1000_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
+	struct pci_dev *pdev = adapter->pdev;
 	unsigned long flags;
 	uint16_t phy_tmp;
 
 #define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
 
-	/* Prevent stats update while adapter is being reset */
+	/*
+	 * Prevent stats update while adapter is being reset, or if the pci
+	 * connection is down.
+	 */
 	if (adapter->link_speed == 0)
 		return;
+	if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+		return;
 
 	spin_lock_irqsave(&adapter->stats_lock, flags);
 

      reply	other threads:[~2006-06-09 20:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-09  5:19 [patch 4/8] e1000: prevent statistics from getting garbled during reset akpm
2006-06-09 18:28 ` Auke Kok [this message]

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=4489BDB7.8000606@intel.com \
    --to=auke-jan.h.kok@intel.com \
    --cc=akpm@osdl.org \
    --cc=jeff@garzik.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=john.ronciak@intel.com \
    --cc=linas@austin.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).