From owner-freebsd-stable@FreeBSD.ORG Mon Jan 22 07:43:06 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F10E16A408 for ; Mon, 22 Jan 2007 07:43:06 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-3-125.belrs4.nsw.optusnet.com.au [220.239.3.125]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5E913C442 for ; Mon, 22 Jan 2007 07:43:05 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.8/8.13.8) with ESMTP id l0M7h4tG000908; Mon, 22 Jan 2007 18:43:04 +1100 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.8/8.13.8/Submit) id l0M7h4kZ000907; Mon, 22 Jan 2007 18:43:04 +1100 (EST) (envelope-from peter) Date: Mon, 22 Jan 2007 18:43:04 +1100 From: Peter Jeremy To: Louis Mamakos Message-ID: <20070122074304.GB837@turion.vk2pj.dyndns.org> References: <45B09856.8080600@IPricot.com> <45B3796A.3020409@transsys.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s2ZSL+KKDSLx8OML" Content-Disposition: inline In-Reply-To: <45B3796A.3020409@transsys.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-stable@freebsd.org Subject: Re: tcpdump, rl, sis, fxp and multicast problems X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2007 07:43:06 -0000 --s2ZSL+KKDSLx8OML Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, 2007-Jan-21 09:32:10 -0500, Louis Mamakos wrote: >However, since it is a 1's complement checksum, there is a distinguished= =20 >value (all zero bits) that you could set the checksum field to that=20 >wouldn't occur for a normal computed checksum. That's a useful idea. > Since the presence of a=20 >checksum is mandatory for TCP, you can use this trick and external=20 >software could "know" that it's a distinguished value. Keep in mind that tcpdump/libpcap in contributed software so making local changes is frowned upon. >I suspect the overhead isn't the CPU instruction, but the memory=20 >reference. If you manipulate the checksum field to the distinguished=20 >value at the time the other fields are written, they they'll all get=20 >written out to memory when the cache line is flushed. You've already=20 >got to initialize the Urgent Pointer field, which is the other 16 bits=20 >in the same 32 bit word. If you were really clever, you could make a=20 >union to cover both fields and zero both out in the same store instruction. And given that a 16-bit update is no faster (and typically slower) than a 32-bit update on all supported architectures, this may even be faster. Feel free to come up with a patch. --=20 Peter Jeremy --s2ZSL+KKDSLx8OML Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFtGsI/opHv/APuIcRAoLzAJ9Hzzvr0Q9sVbUwjoEsS4+dkCpQBACfZ3bP E4UsV7Zx1cNVTOTbhRkLObU= =jhIk -----END PGP SIGNATURE----- --s2ZSL+KKDSLx8OML--