From owner-freebsd-net@FreeBSD.ORG Tue Aug 12 15:33:18 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 9191E106567E for ; Tue, 12 Aug 2008 15:33:18 +0000 (UTC) (envelope-from mailnull@mips.inka.de) Received: from mail-in-09.arcor-online.net (mail-in-09.arcor-online.net [151.189.21.49]) by mx1.freebsd.org (Postfix) with ESMTP id 288C68FC23 for ; Tue, 12 Aug 2008 15:33:18 +0000 (UTC) (envelope-from mailnull@mips.inka.de) Received: from mail-in-20-z2.arcor-online.net (mail-in-20-z2.arcor-online.net [151.189.8.85]) by mail-in-09.arcor-online.net (Postfix) with ESMTP id 4773F302894 for ; Tue, 12 Aug 2008 17:33:16 +0200 (CEST) Received: from mail-in-08.arcor-online.net (mail-in-08.arcor-online.net [151.189.21.48]) by mail-in-20-z2.arcor-online.net (Postfix) with ESMTP id 399E41077FD for ; Tue, 12 Aug 2008 17:33:16 +0200 (CEST) Received: from lorvorc.mips.inka.de (dslb-088-067-127-145.pools.arcor-ip.net [88.67.127.145]) by mail-in-08.arcor-online.net (Postfix) with ESMTP id F069E2BB6EB for ; Tue, 12 Aug 2008 17:33:15 +0200 (CEST) Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.14.2/8.14.2) with ESMTP id m7CFXEHn073373 for ; Tue, 12 Aug 2008 17:33:14 +0200 (CEST) (envelope-from mailnull@lorvorc.mips.inka.de) Received: (from mailnull@localhost) by lorvorc.mips.inka.de (8.14.2/8.14.2/Submit) id m7CFXEaH073372 for freebsd-net@freebsd.org; Tue, 12 Aug 2008 17:33:14 +0200 (CEST) (envelope-from mailnull) From: naddy@mips.inka.de (Christian Weisgerber) Date: Tue, 12 Aug 2008 15:33:14 +0000 (UTC) Message-ID: References: <20080811021703.GC50045@cdnetworks.co.kr> <20080812022853.GD54362@cdnetworks.co.kr> Originator: naddy@mips.inka.de (Christian Weisgerber) To: freebsd-net@freebsd.org X-Virus-Scanned: ClamAV 0.93.3/8018/Tue Aug 12 10:36:31 2008 on mail-in-08.arcor-online.net X-Virus-Status: Clean Subject: Re: Rx/tx hardware checksumming statistics? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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 15:33:18 -0000 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(). > > 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. -- Christian "naddy" Weisgerber naddy@mips.inka.de