* sky2: hw checksum failures
@ 2006-09-05 0:36 Benjamin Herrenschmidt
2006-09-05 3:34 ` Stephen Hemminger
0 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2006-09-05 0:36 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David S. Miller
Hi Stephen !
So I now have the driver working with the patches I gave you. However,
when I set it up with a 100bT link and transfer a huge file from another
machine (about 10MB/sec throughput), I get a few of these in dmesg
eth2: hw csum failure.
Call Trace:
[C00000000FFEF8D0] [C00000000000F460] .show_stack+0x6c/0x1a0
(unreliable)
[C00000000FFEF970] [C000000000365E48] .netdev_rx_csum_fault+0x4c/0x68
[C00000000FFEFA00] [C000000000362DB8] .__skb_checksum_complete+0x60/0x90
[C00000000FFEFA90] [C0000000003A8A48] .tcp_v4_rcv+0x1a0/0xc18
[C00000000FFEFB60] [C000000000386A54] .ip_local_deliver+0x20c/0x33c
[C00000000FFEFBF0] [C0000000003870D0] .ip_rcv+0x54c/0x5c0
[C00000000FFEFC90] [C000000000369E8C] .netif_receive_skb+0x2a8/0x2e8
[C00000000FFEFD30] [D00000000010E99C] .sky2_poll+0x6e8/0x9dc [sky2]
[C00000000FFEFE40] [C00000000036696C] .net_rx_action+0xb4/0x1b8
[C00000000FFEFEF0] [C000000000048404] .__do_softirq+0xa8/0x168
[C00000000FFEFF90] [C00000000001E3F8] .call_do_softirq+0x14/0x24
[C00000000FFAB9F0] [C00000000000C1F0] .do_softirq+0x78/0xa0
[C00000000FFABA80] [C000000000047F9C] .irq_exit+0x5c/0x74
[C00000000FFABB00] [C00000000000C154] .do_IRQ+0x160/0x184
[C00000000FFABB90] [C0000000000041EC] hardware_interrupt_entry+0xc/0x10
--- Exception: 501 at .cpu_idle+0xd4/0x12c
In fact, the dmesg trace is interesting:
benh@grosgo:~/kernels/linux-work$ dmesg | grep failure
eth2: hw csum failure.
eth2: hw csum failure.
eth2: hw csum failure.
eth2: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
eth2: hw csum failure.
eth2: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
<unknown>: hw csum failure.
(That's what I get for about 600MB transfered).
The other side is a sungem, I haven't yet had a chance to test with
something else, in case it's actually a problem there, though.
Any idea ? I'll do some tests with some other chips at the other end
(will try 1000bT too) later.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sky2: hw checksum failures
2006-09-05 0:36 sky2: hw checksum failures Benjamin Herrenschmidt
@ 2006-09-05 3:34 ` Stephen Hemminger
2006-09-05 3:42 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2006-09-05 3:34 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: netdev, David S. Miller
Unneeded byte swap was occurring.
--- linux-2.6.orig/drivers/net/sky2.c
+++ linux-2.6/drivers/net/sky2.c
@@ -2001,7 +2001,7 @@ static int sky2_status_intr(struct sky2_
case OP_RXCHKS:
skb = sky2->rx_ring[sky2->rx_next].skb;
skb->ip_summed = CHECKSUM_HW;
- skb->csum = le16_to_cpu(status);
+ skb->csum = status;
break;
case OP_TXINDEXLE:
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sky2: hw checksum failures
2006-09-05 3:34 ` Stephen Hemminger
@ 2006-09-05 3:42 ` Benjamin Herrenschmidt
2006-09-05 3:56 ` Stephen Hemminger
0 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2006-09-05 3:42 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David S. Miller
On Mon, 2006-09-04 at 20:34 -0700, Stephen Hemminger wrote:
> Unneeded byte swap was occurring.
>
> --- linux-2.6.orig/drivers/net/sky2.c
> +++ linux-2.6/drivers/net/sky2.c
> @@ -2001,7 +2001,7 @@ static int sky2_status_intr(struct sky2_
> case OP_RXCHKS:
> skb = sky2->rx_ring[sky2->rx_next].skb;
> skb->ip_summed = CHECKSUM_HW;
> - skb->csum = le16_to_cpu(status);
> + skb->csum = status;
> break;
>
> case OP_TXINDEXLE:
I've removed it in my paches (have you seen the other patches I sent for
this driver ?), though I'm pre-swapping status and lenght now before the
switch/case so there might still be an issue there. I'll have a look.
Thanks,
Ben.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sky2: hw checksum failures
2006-09-05 3:42 ` Benjamin Herrenschmidt
@ 2006-09-05 3:56 ` Stephen Hemminger
2006-09-05 4:45 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2006-09-05 3:56 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: netdev, David S. Miller
On Tue, 05 Sep 2006 13:42:38 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> On Mon, 2006-09-04 at 20:34 -0700, Stephen Hemminger wrote:
> > Unneeded byte swap was occurring.
> >
> > --- linux-2.6.orig/drivers/net/sky2.c
> > +++ linux-2.6/drivers/net/sky2.c
> > @@ -2001,7 +2001,7 @@ static int sky2_status_intr(struct sky2_
> > case OP_RXCHKS:
> > skb = sky2->rx_ring[sky2->rx_next].skb;
> > skb->ip_summed = CHECKSUM_HW;
> > - skb->csum = le16_to_cpu(status);
> > + skb->csum = status;
> > break;
> >
> > case OP_TXINDEXLE:
>
> I've removed it in my paches (have you seen the other patches I sent for
> this driver ?), though I'm pre-swapping status and lenght now before the
> switch/case so there might still be an issue there. I'll have a look.
The other tack would be to leave the "reverse in hw" flag on and take out all the existing
swap calls but then you have to add an ifdef to re-order all the structures for tx_le, rx_le, status_le.
That is what the vendor (GPL) version of sk98lin does.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sky2: hw checksum failures
2006-09-05 3:56 ` Stephen Hemminger
@ 2006-09-05 4:45 ` Benjamin Herrenschmidt
2006-09-05 15:00 ` Stephen Hemminger
0 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2006-09-05 4:45 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David S. Miller
On Mon, 2006-09-04 at 20:56 -0700, Stephen Hemminger wrote:
> On Tue, 05 Sep 2006 13:42:38 +1000
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > On Mon, 2006-09-04 at 20:34 -0700, Stephen Hemminger wrote:
> > > Unneeded byte swap was occurring.
> > >
> > > --- linux-2.6.orig/drivers/net/sky2.c
> > > +++ linux-2.6/drivers/net/sky2.c
> > > @@ -2001,7 +2001,7 @@ static int sky2_status_intr(struct sky2_
> > > case OP_RXCHKS:
> > > skb = sky2->rx_ring[sky2->rx_next].skb;
> > > skb->ip_summed = CHECKSUM_HW;
> > > - skb->csum = le16_to_cpu(status);
> > > + skb->csum = status;
> > > break;
> > >
> > > case OP_TXINDEXLE:
> >
> > I've removed it in my paches (have you seen the other patches I sent for
> > this driver ?), though I'm pre-swapping status and lenght now before the
> > switch/case so there might still be an issue there. I'll have a look.
>
> The other tack would be to leave the "reverse in hw" flag on and take out all the existing
> swap calls but then you have to add an ifdef to re-order all the structures for tx_le, rx_le, status_le.
> That is what the vendor (GPL) version of sk98lin does.
I prefer keeping the HW swap out of the way for now... that way, I know
the card will react exactly like in an x86, and I avoid those ugly
ifdef's. At least on powerpc, there is no cost in doing swap in software
(well, pretty much no cost).
Which means that if it worked on x86 with le16_to_cpu, it should work on
powerpc... The main difference here however is that you called
le16_to_cpu (which is basically a nop) on a 32 bits field, while I
called le32_to_cpu() on it. But both should lead to the same ... (x86
will do a swapped 16 bits load of the 2 first bytes, while ppc will do a
load of 4 bytes and swap that, thus ending up with the first 2 bytes
swapped in the low order of the result). I'll dump the values and have a
look to be sure. Another possibility would be a problem with the bits
telling the chip where to calculate the checksum.
Ben.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sky2: hw checksum failures
2006-09-05 4:45 ` Benjamin Herrenschmidt
@ 2006-09-05 15:00 ` Stephen Hemminger
2006-09-05 21:12 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2006-09-05 15:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: netdev, David S. Miller
Benjamin Herrenschmidt wrote:
> On Mon, 2006-09-04 at 20:56 -0700, Stephen Hemminger wrote:
>
>> On Tue, 05 Sep 2006 13:42:38 +1000
>> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>>
>>
>>> On Mon, 2006-09-04 at 20:34 -0700, Stephen Hemminger wrote:
>>>
>>>> Unneeded byte swap was occurring.
>>>>
>>>> --- linux-2.6.orig/drivers/net/sky2.c
>>>> +++ linux-2.6/drivers/net/sky2.c
>>>> @@ -2001,7 +2001,7 @@ static int sky2_status_intr(struct sky2_
>>>> case OP_RXCHKS:
>>>> skb = sky2->rx_ring[sky2->rx_next].skb;
>>>> skb->ip_summed = CHECKSUM_HW;
>>>> - skb->csum = le16_to_cpu(status);
>>>> + skb->csum = status;
>>>> break;
>>>>
>>>> case OP_TXINDEXLE:
>>>>
>>> I've removed it in my paches (have you seen the other patches I sent for
>>> this driver ?), though I'm pre-swapping status and lenght now before the
>>> switch/case so there might still be an issue there. I'll have a look.
>>>
>> The other tack would be to leave the "reverse in hw" flag on and take out all the existing
>> swap calls but then you have to add an ifdef to re-order all the structures for tx_le, rx_le, status_le.
>> That is what the vendor (GPL) version of sk98lin does.
>>
>
> I prefer keeping the HW swap out of the way for now... that way, I know
> the card will react exactly like in an x86, and I avoid those ugly
> ifdef's. At least on powerpc, there is no cost in doing swap in software
> (well, pretty much no cost).
>
> Which means that if it worked on x86 with le16_to_cpu, it should work on
> powerpc... The main difference here however is that you called
> le16_to_cpu (which is basically a nop) on a 32 bits field, while I
> called le32_to_cpu() on it. But both should lead to the same ... (x86
> will do a swapped 16 bits load of the 2 first bytes, while ppc will do a
> load of 4 bytes and swap that, thus ending up with the first 2 bytes
> swapped in the low order of the result). I'll dump the values and have a
> look to be sure. Another possibility would be a problem with the bits
> telling the chip where to calculate the checksum.
>
Hardware only computes 16 bit checksum.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sky2: hw checksum failures
2006-09-05 15:00 ` Stephen Hemminger
@ 2006-09-05 21:12 ` Benjamin Herrenschmidt
2006-09-05 21:31 ` Stephen Hemminger
0 siblings, 1 reply; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2006-09-05 21:12 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David S. Miller
> > Which means that if it worked on x86 with le16_to_cpu, it should work on
> > powerpc... The main difference here however is that you called
> > le16_to_cpu (which is basically a nop) on a 32 bits field, while I
> > called le32_to_cpu() on it. But both should lead to the same ... (x86
> > will do a swapped 16 bits load of the 2 first bytes, while ppc will do a
> > load of 4 bytes and swap that, thus ending up with the first 2 bytes
> > swapped in the low order of the result). I'll dump the values and have a
> > look to be sure. Another possibility would be a problem with the bits
> > telling the chip where to calculate the checksum.
> >
> Hardware only computes 16 bit checksum.
Oh I know that, but calling 16 bits swapping macros on a 32 bits field
is a bit dodgy... might work in this case, I'll verify, but you may end
up with the wrong half of the 32 bits word being used :)
Ben.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sky2: hw checksum failures
2006-09-05 21:12 ` Benjamin Herrenschmidt
@ 2006-09-05 21:31 ` Stephen Hemminger
2006-09-05 21:56 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2006-09-05 21:31 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: netdev, David S. Miller
On Wed, 06 Sep 2006 07:12:43 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > > Which means that if it worked on x86 with le16_to_cpu, it should work on
> > > powerpc... The main difference here however is that you called
> > > le16_to_cpu (which is basically a nop) on a 32 bits field, while I
> > > called le32_to_cpu() on it. But both should lead to the same ... (x86
> > > will do a swapped 16 bits load of the 2 first bytes, while ppc will do a
> > > load of 4 bytes and swap that, thus ending up with the first 2 bytes
> > > swapped in the low order of the result). I'll dump the values and have a
> > > look to be sure. Another possibility would be a problem with the bits
> > > telling the chip where to calculate the checksum.
> > >
> > Hardware only computes 16 bit checksum.
>
> Oh I know that, but calling 16 bits swapping macros on a 32 bits field
> is a bit dodgy... might work in this case, I'll verify, but you may end
> up with the wrong half of the 32 bits word being used :)
>
> Ben.
>
>
Agreed. Actually the checksum value is same hi/lo because there are
two checksum units and we ask for the same offset on both.
--
Stephen Hemminger <shemminger@osdl.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sky2: hw checksum failures
2006-09-05 21:31 ` Stephen Hemminger
@ 2006-09-05 21:56 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 9+ messages in thread
From: Benjamin Herrenschmidt @ 2006-09-05 21:56 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, David S. Miller
> Agreed. Actually the checksum value is same hi/lo because there are
> two checksum units and we ask for the same offset on both.
Ok, that explains the (HLEN << 16) | HLEN thing when configuring it...
At this point, best is I dig into the actual values and see what's up.
I'll let you know (I don't have the HW at hand right now)
Ben.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-09-05 21:57 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-05 0:36 sky2: hw checksum failures Benjamin Herrenschmidt
2006-09-05 3:34 ` Stephen Hemminger
2006-09-05 3:42 ` Benjamin Herrenschmidt
2006-09-05 3:56 ` Stephen Hemminger
2006-09-05 4:45 ` Benjamin Herrenschmidt
2006-09-05 15:00 ` Stephen Hemminger
2006-09-05 21:12 ` Benjamin Herrenschmidt
2006-09-05 21:31 ` Stephen Hemminger
2006-09-05 21:56 ` Benjamin Herrenschmidt
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).