netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
@ 2008-03-27 10:44 Toralf Förster
  2008-03-27 11:01 ` David Miller
  2008-03-27 12:00 ` Daniel Noe
  0 siblings, 2 replies; 7+ messages in thread
From: Toralf Förster @ 2008-03-27 10:44 UTC (permalink / raw)
  To: netdev

I'm wondering why I have to add this line in my startup scripts : 

$> /usr/sbin/ethtool -K eth0 tx off
to avoid that all outgoing packets have bad check sums (seen with wireshark).

Wouldn't it makes sense to make this behaviour as default ?

My system is a ThinkPad T41:

n22 ~ # uname -a
Linux n22 2.6.24-gentoo-r3 #5 Tue Mar 18 19:26:55 CET 2008 i686 Intel(R) Pentium(R) M processor 1700MHz GenuineIntel GNU/Linux

Pls response to my address too b/c I'm not currently subscribed.

-- 
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
  2008-03-27 10:44 tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) Toralf Förster
@ 2008-03-27 11:01 ` David Miller
  2008-03-27 12:00 ` Daniel Noe
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2008-03-27 11:01 UTC (permalink / raw)
  To: toralf.foerster; +Cc: netdev

From: Toralf Förster <toralf.foerster@gmx.de>
Date: Thu, 27 Mar 2008 11:44:52 +0100

> I'm wondering why I have to add this line in my startup scripts : 
> 
> $> /usr/sbin/ethtool -K eth0 tx off
> to avoid that all outgoing packets have bad check sums (seen with wireshark).
> 
> Wouldn't it makes sense to make this behaviour as default ?

The checksums are computed by the card, so the packets seen by
wireshark simply haven't been checksummed by the card yet.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
  2008-03-27 10:44 tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) Toralf Förster
  2008-03-27 11:01 ` David Miller
@ 2008-03-27 12:00 ` Daniel Noe
  2008-03-27 12:14   ` Toralf Förster
  2008-04-21  3:57   ` Herbert Xu
  1 sibling, 2 replies; 7+ messages in thread
From: Daniel Noe @ 2008-03-27 12:00 UTC (permalink / raw)
  To: Toralf Förster; +Cc: netdev

Toralf Förster wrote:
> I'm wondering why I have to add this line in my startup scripts : 
> 
> $> /usr/sbin/ethtool -K eth0 tx off
> to avoid that all outgoing packets have bad check sums (seen with wireshark).

TCP Checksum offloading defers calculation of the TCP checksums in 
software, instead passing it off to the card which calculates and 
inserts the checksums.  This is done for performance reasons - it 
offloads the CPU and lets the NIC hardware perform the relatively 
mundane task of calculating the checksum (probably also a battery 
improvement in your mobile case).

The problem is Wireshark (and other capture software) sees the outgoing 
packets before they go to the hardware and have the correct checksum 
calculated.  So Wireshark complains about invalid checksums.  There are 
a few solutions:

1) Ignore it.  You know the invalid checksums aren't an issue, just 
ignore them.  The problem is Wireshark by default highlights them in 
bright, bright red...

2) Tell Wireshark not to verify the checksums.  See 
http://wiki.wireshark.org/TCP_Checksum_Verification.  This works if you 
don't really care about the checksums and are looking at other things. 
If you suspect incorrect checksums, you can always turn off checksum 
offloading manually.

3) Use a hub (if you still have one lying around :) or a switch with a 
monitoring port.  That way you have Wireshark running on a neutral third 
system which is not part of the TCP conversation at all and thus will 
see the correct checksums as calculated by the hardware on both ends. 
This is also the only real solution if you want to check that the 
hardware is calculating the checksum correctly.

Number 3 is best, but solution 2 is fine if you don't need to know about 
the checksums.

Hope that helps.

Cheers,
Dan

-- 
                     /--------------- - -  -  -   -   -
                    |  Daniel Noe
                    |  http://isomerica.net/~dpn/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
  2008-03-27 12:00 ` Daniel Noe
@ 2008-03-27 12:14   ` Toralf Förster
  2008-04-21  3:57   ` Herbert Xu
  1 sibling, 0 replies; 7+ messages in thread
From: Toralf Förster @ 2008-03-27 12:14 UTC (permalink / raw)
  To: dpn; +Cc: netdev

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

At Thursday 27 March 2008 13:00:28 Daniel Noe wrote :
> Number 3 is best, but solution 2 is fine if you don't need to know about 
> the checksums.
> 
> Hope that helps.
> 
> Cheers,
> Dan
> 

Oh yes, many thanks Dan. Now I've understood the background of this "issue"
I was aware for a long time w/o a clue why it happens.

-- 
MfG/Sincerely

Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
  2008-03-27 12:00 ` Daniel Noe
  2008-03-27 12:14   ` Toralf Förster
@ 2008-04-21  3:57   ` Herbert Xu
  2008-04-21  4:24     ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2008-04-21  3:57 UTC (permalink / raw)
  To: dpn; +Cc: toralf.foerster, netdev

Daniel Noe <dpn@isomerica.net> wrote:
>
> 2) Tell Wireshark not to verify the checksums.  See 
> http://wiki.wireshark.org/TCP_Checksum_Verification.  This works if you 
> don't really care about the checksums and are looking at other things. 
> If you suspect incorrect checksums, you can always turn off checksum 
> offloading manually.

Better yet fix Wireshark to use the info that the kernel supplies
and ignore checksums only on those packets generated locally for
hardware offload.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
  2008-04-21  3:57   ` Herbert Xu
@ 2008-04-21  4:24     ` David Miller
  2008-04-21  4:50       ` Herbert Xu
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2008-04-21  4:24 UTC (permalink / raw)
  To: herbert; +Cc: dpn, toralf.foerster, netdev

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 21 Apr 2008 11:57:22 +0800

> Daniel Noe <dpn@isomerica.net> wrote:
> >
> > 2) Tell Wireshark not to verify the checksums.  See 
> > http://wiki.wireshark.org/TCP_Checksum_Verification.  This works if you 
> > don't really care about the checksums and are looking at other things. 
> > If you suspect incorrect checksums, you can always turn off checksum 
> > offloading manually.
> 
> Better yet fix Wireshark to use the info that the kernel supplies
> and ignore checksums only on those packets generated locally for
> hardware offload.

True.

But every time we say this they keep coming back at us that they can't
change the tcpdump raw dump file format that's been used for
centuries, and naturally it was designed without any extensibility in
mind so there's nowhere to store the checksum indication.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
  2008-04-21  4:24     ` David Miller
@ 2008-04-21  4:50       ` Herbert Xu
  0 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2008-04-21  4:50 UTC (permalink / raw)
  To: David Miller; +Cc: dpn, toralf.foerster, netdev

On Sun, Apr 20, 2008 at 09:24:51PM -0700, David Miller wrote:
>
> But every time we say this they keep coming back at us that they can't
> change the tcpdump raw dump file format that's been used for
> centuries, and naturally it was designed without any extensibility in
> mind so there's nowhere to store the checksum indication.

They could always fix up the checksums if it has to be written
out.  Alternatively it could notice that the checksum is exactly
that of the pseudo-header and flag it differently versus just any
checksum error.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-21  4:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-27 10:44 tx-checksumming for an Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) Toralf Förster
2008-03-27 11:01 ` David Miller
2008-03-27 12:00 ` Daniel Noe
2008-03-27 12:14   ` Toralf Förster
2008-04-21  3:57   ` Herbert Xu
2008-04-21  4:24     ` David Miller
2008-04-21  4:50       ` Herbert Xu

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).