Skip to contentSkip to conversation

sky2: turn off Rx checksum on bad hardware

PATCH Applied Stephen Hemminger 2 participants 2 messages Mar 8, 2007 – Mar 9, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sky2: turn off Rx checksum on bad hardware

On Yukon FE, occasional hardware receive checksum errors are seen. An early indication of the problem is single bit differences in the two checksum engines. Use this as a detection mechanism to turn off Rx checksumming.

---
 drivers/net/sky2.c |   24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
drivers/net/sky2.c +21 -3
@@ -2165,9 +2165,27 @@
 			/* fall through */
 #endif
 		case OP_RXCHKS:
-			skb = sky2->rx_ring[sky2->rx_next].skb;
-			skb->ip_summed = CHECKSUM_COMPLETE;
-			skb->csum = status & 0xffff;
+			if (!sky2->rx_csum)
+				break;
+
+			/* Both checksum counters are programmed to start at
+			 * the same offset, so unless there is a problem they
+			 * should match. This failure is an early indication that
+			 * hardware receive checksumming won't work.
+			 */
+			if (likely(status >> 16 == (status & 0xffff))) {
+				skb = sky2->rx_ring[sky2->rx_next].skb;
+				skb->ip_summed = CHECKSUM_COMPLETE;
+				skb->csum = status & 0xffff;
+			} else {
+				printk(KERN_NOTICE PFX "%s: hardware receive "
+				       "checksum problem (status = %#x)\n",
+				       dev->name, status);
+				sky2->rx_csum = 0;
+				sky2_write32(sky2->hw,
+					     Q_ADDR(rxqaddr[le->link], Q_CSR),
+					     BMU_DIS_RX_CHKSUM);
+			}
 			break;
 
 		case OP_TXINDEXLE:
Applied
#1 lore raw
Quoted 10 lines · Stephen Hemminger

On Yukon FE, occasional hardware receive checksum errors are seen. An early indication of the problem is single bit differences in the two checksum engines. Use this as a detection mechanism to turn off Rx checksumming.

---
 drivers/net/sky2.c |   24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

applied