[PATCH net-next] be2net: Ignore spurious UE indication from NIC

Subsystems: emulex 10gbps nic be2, be3-r, lancer, skyhawk-r driver (be2net), networking drivers, the rest

STALE5061d

4 messages, 2 authors, 2012-09-26 · open the first message on its own page

[PATCH net-next] be2net: Ignore spurious UE indication from NIC

From: Ajit Khaparde <hidden>
Date: 2012-09-21 16:36:22

Ignore spurious UE indication seen on some platforms.
Consider the error as un-recoverable only when the bits
stay high during second sampling.

Signed-off-by: Ajit Khaparde <redacted>
---
 drivers/net/ethernet/emulex/benet/be.h      |    2 ++
 drivers/net/ethernet/emulex/benet/be_main.c |   18 +++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 5b622993..3d4a7bc 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -401,6 +401,8 @@ struct be_adapter {
 	bool eeh_error;
 	bool fw_timeout;
 	bool hw_error;
+	u32 ue_lo;
+	u32 ue_hi;
 
 	u32 port_num;
 	bool promiscuous;
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 84379f4..e970f77 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2105,6 +2105,7 @@ void be_detect_error(struct be_adapter *adapter)
 	u32 ue_lo = 0, ue_hi = 0, ue_lo_mask = 0, ue_hi_mask = 0;
 	u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
 	u32 i;
+	struct device *dev = &adapter->pdev->dev;
 
 	if (be_crit_error(adapter))
 		return;
@@ -2129,13 +2130,22 @@ void be_detect_error(struct be_adapter *adapter)
 
 		ue_lo = (ue_lo & ~ue_lo_mask);
 		ue_hi = (ue_hi & ~ue_hi_mask);
+		if (ue_lo != adapter->ue_lo || ue_hi != adapter->ue_hi) {
+			dev_err(dev, "UE read: 0x%x/0x%x\n", ue_lo, ue_hi);
+			goto done;
+		}
+	}
+
+	if (ue_lo == 0xffffffff || ue_hi == 0xffffffff) {
+		adapter->eeh_error = true;
+		dev_err(dev, "PCI slot disconnected\n");
+		goto done;
 	}
 
 	if (ue_lo || ue_hi ||
 		sliport_status & SLIPORT_STATUS_ERR_MASK) {
 		adapter->hw_error = true;
-		dev_err(&adapter->pdev->dev,
-			"Error detected in the card\n");
+		dev_err(dev, "UE detected\n");
 	}
 
 	if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
@@ -2162,7 +2172,9 @@ void be_detect_error(struct be_adapter *adapter)
 				"UE: %s bit set\n", ue_status_hi_desc[i]);
 		}
 	}
-
+done:
+	adapter->ue_lo = ue_lo;
+	adapter->ue_hi = ue_hi;
 }
 
 static void be_msix_disable(struct be_adapter *adapter)
-- 
1.7.9.5

Re: [PATCH net-next] be2net: Ignore spurious UE indication from NIC

From: David Miller <davem@davemloft.net>
Date: 2012-09-21 19:04:15

From: Ajit Khaparde <redacted>
Date: Fri, 21 Sep 2012 11:36:20 -0500
Ignore spurious UE indication seen on some platforms.
Consider the error as un-recoverable only when the bits
stay high during second sampling.

Signed-off-by: Ajit Khaparde <redacted>
Treating uncorrectable errors as spurious seems like an invitation
for hard to track down data corruption to me.

You'll need to come up with a more sophisticated test for
spurious other than "happens more than once" before I'm willing
to subject the entire world to this kind of potential problem.

RE: [PATCH net-next] be2net: Ignore spurious UE indication from NIC

From: Khaparde, Ajit <hidden>
Date: 2012-09-26 22:35:16

From: David Miller [davem@davemloft.net]
Sent: Friday, September 21, 2012 2:04 PM
To: Khaparde, Ajit
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] be2net: Ignore spurious UE indication from NIC

From: Ajit Khaparde <redacted>
Date: Fri, 21 Sep 2012 11:36:20 -0500
quoted
Ignore spurious UE indication seen on some platforms.
Consider the error as un-recoverable only when the bits
stay high during second sampling.

Signed-off-by: Ajit Khaparde <redacted>
Treating uncorrectable errors as spurious seems like an invitation
for hard to track down data corruption to me.

You'll need to come up with a more sophisticated test for
spurious other than "happens more than once" before I'm willing
to subject the entire world to this kind of potential problem.
If the UE is real, then the hardware will stop responding to requests.
The hardware block goes offline automatically and no traffic will flow.
After this the hardware will generate a register dump, which can be
retrived using ethtool.

A spurious UE or a data corruption will not generate this dump.

The detection logic is merely to inform the user about the failure
and also avoid any further access to the NIC. This will also prevent
the driver unload from having to timeout on each access to the hardware
which could take a long time to complete.

Please let me know if this is enough to differentiate the scenarios.

Thanks
-Ajit

Re: [PATCH net-next] be2net: Ignore spurious UE indication from NIC

From: David Miller <davem@davemloft.net>
Date: 2012-09-26 23:33:09

From: "Khaparde, Ajit" <redacted>
Date: Wed, 26 Sep 2012 22:35:14 +0000
quoted
From: David Miller [davem@davemloft.net]
Sent: Friday, September 21, 2012 2:04 PM
To: Khaparde, Ajit
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] be2net: Ignore spurious UE indication from NIC

From: Ajit Khaparde <redacted>
Date: Fri, 21 Sep 2012 11:36:20 -0500
quoted
Ignore spurious UE indication seen on some platforms.
Consider the error as un-recoverable only when the bits
stay high during second sampling.

Signed-off-by: Ajit Khaparde <redacted>
Treating uncorrectable errors as spurious seems like an invitation
for hard to track down data corruption to me.

You'll need to come up with a more sophisticated test for
spurious other than "happens more than once" before I'm willing
to subject the entire world to this kind of potential problem.
If the UE is real, then the hardware will stop responding to requests.
The hardware block goes offline automatically and no traffic will flow.
After this the hardware will generate a register dump, which can be
retrived using ethtool.

A spurious UE or a data corruption will not generate this dump.

The detection logic is merely to inform the user about the failure
and also avoid any further access to the NIC.
So it sounds more like the UE test should be removed completely
since you cannot rely upon it, and if a real UE happens the hardware
will stop and you will already report the problem when the hardware
block goes offline.

Furthermore, it also implies that you can test if the hardware block
is offline to validate the UE indication.

All of which says irrefutably that your patch is still the wrong way
to do this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help