* [PATCH] sky2: turn off Rx checksum on bad hardware
@ 2007-03-08 20:42 Stephen Hemminger
2007-03-09 16:52 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2007-03-08 20:42 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
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.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
drivers/net/sky2.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
--- sky2-dev.orig/drivers/net/sky2.c 2007-03-05 16:49:31.000000000 -0800
+++ sky2-dev/drivers/net/sky2.c 2007-03-05 16:49:45.000000000 -0800
@@ -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:
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] sky2: turn off Rx checksum on bad hardware
2007-03-08 20:42 [PATCH] sky2: turn off Rx checksum on bad hardware Stephen Hemminger
@ 2007-03-09 16:52 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-03-09 16:52 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
Stephen Hemminger wrote:
> 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.
>
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
>
> ---
> drivers/net/sky2.c | 24 +++++++++++++++++++++---
> 1 file changed, 21 insertions(+), 3 deletions(-)
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-09 16:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-08 20:42 [PATCH] sky2: turn off Rx checksum on bad hardware Stephen Hemminger
2007-03-09 16:52 ` Jeff Garzik
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).