From owner-freebsd-net@FreeBSD.ORG Tue Aug 12 02:31:08 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6915F1065673 for ; Tue, 12 Aug 2008 02:31:08 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.234]) by mx1.freebsd.org (Postfix) with ESMTP id 2EAEF8FC18 for ; Tue, 12 Aug 2008 02:31:08 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so3774831rvf.43 for ; Mon, 11 Aug 2008 19:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:date:from :to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=LdLiSDzGdZEYl+Gh1ZxtlS4teOTlDio+yH1hHRp96Pg=; b=Q5ywBDbFR8Pgl9lqjpm/zhG77vGeWsZdrcfW/RehSPq3aPsjd6M9BKfOYJnOPwjsku Q3b3mSlXMLVSwg41ZNPX165uvvTZ0LXRUso7e8W7AiWFskDw1ugSvGEYKx7l2HHeqMhw opUjmswfK6Wk5e9YsscIyQBJo/kXMr0TYyDmY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=kaqcaqLri9tiPFdrwv8lktrwrCEIDSSlYdRmJAZ53OA9gaqUUBgWJqjtYuCmn5K19m 4bGGieWcg/PdF4ssgU1aDRuxFvG+DzZcQb9ddaKE9KL52y1cxyizP5hxO8Wky+CjLkOj xO5LUUFCtotPFOUchwgI8/58p3XvAF96ZPAXI= Received: by 10.141.15.19 with SMTP id s19mr3990213rvi.205.1218508267917; Mon, 11 Aug 2008 19:31:07 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id b8sm10042997rvf.8.2008.08.11.19.31.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 11 Aug 2008 19:31:06 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id m7C2StKN054925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Aug 2008 11:28:55 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id m7C2SroL054924; Tue, 12 Aug 2008 11:28:53 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Tue, 12 Aug 2008 11:28:53 +0900 From: Pyun YongHyeon To: Christian Weisgerber Message-ID: <20080812022853.GD54362@cdnetworks.co.kr> References: <20080811021703.GC50045@cdnetworks.co.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: freebsd-net@freebsd.org Subject: Re: Rx/tx hardware checksumming statistics? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 02:31:08 -0000 On Mon, Aug 11, 2008 at 12:22:33PM +0000, Christian Weisgerber wrote: > Pyun YongHyeon 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