From owner-freebsd-net@FreeBSD.ORG Thu Jul 10 10:43:23 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E734B106567D; Thu, 10 Jul 2008 10:43:23 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id C7BC98FC2C; Thu, 10 Jul 2008 10:43:23 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 7615E46BB4; Thu, 10 Jul 2008 06:43:23 -0400 (EDT) Date: Thu, 10 Jul 2008 11:43:23 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: gnn@freebsd.org In-Reply-To: Message-ID: <20080710114028.T34050@fledge.watson.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: net@freebsd.org Subject: Re: What's the deal with hardware checksum and net.inet.udp.checksum? 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: Thu, 10 Jul 2008 10:43:24 -0000 On Wed, 9 Jul 2008, gnn@freebsd.org wrote: > I would assume that if a card, say the em, has hardware TX checksum that the > UDP checksum could be calculated by the hardware, but this seems not to be > the case. The manual pages are unhelpful in this regard. On the whole, they should be generated in hardware as long as it's not administratively disabled with ifconfig, and as long as there aren't know bugs in the hardware for the rev you're using. Just for example, hardware checksumming is disabled in software for quite a few early 1gbps cards due to bugs in the hardware causing rather nasty side effects. What specific problem are you seeing? We do do a software checksum of the pseudo-header, but the UDP data should be checksummed by hardware. (The usual test for hardware checksum being enabled on transmit is to tcpdump the interface and see tcpdump reporting lots of bad checksums, as the BPF capture happens before hardware checksumming is run -- in principle on the receive side that shouldn't happen!) Robert N M Watson Computer Laboratory University of Cambridge