From owner-freebsd-net@FreeBSD.ORG Wed Aug 13 01:11:57 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 336B51065680 for ; Wed, 13 Aug 2008 01:11:57 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.236]) by mx1.freebsd.org (Postfix) with ESMTP id 8A9108FC12 for ; Wed, 13 Aug 2008 01:11:56 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so4562352rvf.43 for ; Tue, 12 Aug 2008 18:11:56 -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=83Q7Xq5x5QfIg8UMBdir9OqJ6URpEoyVrXOoCl1dgl0=; b=U3m1TYjUzfKNNpBAoLmfR1QKxQGllrLwwz0h+FkLncXMYlOtr4hpOfu0tKlxvOxzW0 ND2bVaPmRyjKjMyQqzK6X1M5Nn0VwjZ3UbebXtoeBh9xsac6s8UVYdw02IjfkvZvBn0T q+Vv4Con+zE4OZ8w1Y2A6Ej3ddeBqgIO3tl1c= 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=fi5BQO7CA6/59qk3vtoogl/cqzrgA+HQchCHicWnkDzHEWNO1CWtNi+BHbRHOAqxQk M+PaVmLXB3Id3d/gI8gCmzxlKE3u950mA+9ZtpBY4l50Yi0tUvm8IbU2EaDfT3RCPjja P5FShljmonH12a5k/0MGxiD2CYpntqPtMuJag= Received: by 10.141.172.7 with SMTP id z7mr4837391rvo.15.1218589916306; Tue, 12 Aug 2008 18:11:56 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id k2sm12333006rvb.4.2008.08.12.18.11.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 Aug 2008 18:11:55 -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 m7D19jhg058907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Aug 2008 10:09:45 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id m7D19i8b058906; Wed, 13 Aug 2008 10:09:44 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Wed, 13 Aug 2008 10:09:44 +0900 From: Pyun YongHyeon To: Christian Weisgerber Message-ID: <20080813010944.GB58659@cdnetworks.co.kr> References: <20080811021703.GC50045@cdnetworks.co.kr> <20080812022853.GD54362@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: Wed, 13 Aug 2008 01:11:57 -0000 On Tue, Aug 12, 2008 at 03:33:14PM +0000, Christian Weisgerber wrote: > Pyun YongHyeon 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