Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Aug 2008 10:09:44 +0900
From:      Pyun YongHyeon <pyunyh@gmail.com>
To:        Christian Weisgerber <naddy@mips.inka.de>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Rx/tx hardware checksumming statistics?
Message-ID:  <20080813010944.GB58659@cdnetworks.co.kr>
In-Reply-To: <g7safq$27kj$1@lorvorc.mips.inka.de>
References:  <g7ktnq$glp$1@lorvorc.mips.inka.de> <20080811021703.GC50045@cdnetworks.co.kr> <g7pau9$2us0$1@lorvorc.mips.inka.de> <20080812022853.GD54362@cdnetworks.co.kr> <g7safq$27kj$1@lorvorc.mips.inka.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 12, 2008 at 03:33:14PM +0000, Christian Weisgerber wrote:
 > Pyun YongHyeon <pyunyh@gmail.com> wrote:
 > 
 > >  > OpenBSD's re(4) driver is ported from FreeBSD.  Recently, Brad Smith
 > >  > has been merging the tx/rx checksum offload support for the newer
 > >  > chips (RTL8111C etc.) into the OpenBSD driver and I have done some
 > >  > testing for him.  Looking at the counters, I have noticed:
 > >  > * IP header rx checksumming is only registered for IP/TCP and IP/UDP
 > >  >   packets, but not for other protocols, such as IP/ICMP.
 > > 
 > > Note, the controller can only offload IP, TCP and UDP checksumming.
 > > ICMP should be handled by software.
 > 
 > Yes, but the IP/ICMP packet should still be subject to IP checksumming.
 > 
 > What I see with an 8111C (RL_FLAG_DESCV2):
 > * incoming IP/TCP packet
 >   => IP checksum processed in hardware
 >   => TCP checksum processed in hardware
 > * incoming IP/UDP packet
 >   => IP checksum processed in hardware
 >   => UDP checksum processed in hardware
 > * incoming IP/ICMP packet
 >   => IP checksum _not_ processed in hardware
 > 
 > With an old 8169S the latter case is different:
 > * incoming IP/ICMP packet
 >   => IP checksum processed in hardware
 > 
 > >  > limitations also apply to the FreeBSD driver, but without the
 > > 
 > > No, FreeBSD have no such limitation, re(4) takes full advantage of
 > > hardware assistance if the controller in question is known to work
 > > with the feature.
 > 
 > I cannot find any difference between the respective drivers suggesting
 > that the behavior above would be any different on FreeBSD.  There
 > are no relevant differences in the RX checksumming section in
 > re_rxeof().
 > 

Aha I see. The second generation of RTL8168/8111/810x controllers
use new descriptor format. I don't know why RealTek dropped
supporting IP/ICMP checksumming and I couldn't verify that as I
have no such hardware. However it seems RealTek added IPv6 checksum
offload support for these controllers so the checksum offload
oddity for IP/ICMP could be a bug introduced in this newer
descriptor format.

 > >  > counters, how can you tell?
 > > 
 > > I think you can check the output of ifconfig(4).
 > 
 > This does not tell you if an individual received packet has been
 > marked CSUM_IP_CHECKED|CSUM_IP_VALID.
 > 

That's correct.

-- 
Regards,
Pyun YongHyeon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080813010944.GB58659>