Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 2008 11:28:53 +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:  <20080812022853.GD54362@cdnetworks.co.kr>
In-Reply-To: <g7pau9$2us0$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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 11, 2008 at 12:22:33PM +0000, Christian Weisgerber wrote:
 > Pyun YongHyeon <pyunyh@gmail.com> wrote:
 > 
 > > I don't think it indicates whether checksum offloading actually
 > > works as OpenBSD blindly set a flag, which was derived from
 > > hardware, to indicate hardware performed the checksum computation.
 > 
 > Yes.  It counts the instances where the network stack assumes that
 > the hardware successfully verified the checksum.  That is an
 > interesting number.
 > 
 > 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.

 > * If VLAN tagging is enabled, no rx checksumming is registered at
 >   all.
 > 
 > I don't have documentation for the Realtek chips, so I don't know
 > if the hardware really cannot perform these operations or if the
 > driver simply fails to take advantage of them.  Presumably the same

AFAIK all RealTek gigabit controllers can do TSO, checksum offload,
and VLAN tag insertion/stripping. Of course there are known
hardware bugs for these hardware assistance but it's different
question, I think.

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

 > counters, how can you tell?
 > 

I think you can check the output of ifconfig(4). Unlike OpenBSD,
you can see 'options' part of output which indicates current active
hardware features such as checksum offload, WOL, TSO etc.

I have no strong opinions on adding these counters but I guess
there are too many hardware assisted counters if we take the route,
for example, re(4) can do the following with hardware assistance
and each hardware assistance will require separate counters.
 - TSO(TCP segmentation offload)
 - VLAN tag insertion
 - VLAN tag stripping
 - Tx/Rx IP/TCP/UDP checksum offload 

 > -- 
 > Christian "naddy" Weisgerber                          naddy@mips.inka.de

-- 
Regards,
Pyun YongHyeon



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