From owner-freebsd-stable Tue Dec 12 12:58:48 2000 From owner-freebsd-stable@FreeBSD.ORG Tue Dec 12 12:58:46 2000 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id BA95037B400 for ; Tue, 12 Dec 2000 12:58:44 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_18979)/8.9.3) with ESMTP id HAA23005; Wed, 13 Dec 2000 07:58:36 +1100 (EDT) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37645) with ESMTP id <01JXNCQ03RMOEAFHEV@cim.alcatel.com.au>; Wed, 13 Dec 2000 07:58:24 +1100 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.0/8.11.0) id eBCKwTG84374; Wed, 13 Dec 2000 07:58:29 +1100 (EST envelope-from jeremyp) Content-return: prohibited Date: Wed, 13 Dec 2000 07:58:28 +1100 From: Peter Jeremy Subject: Re: Different gcc optimisations cause IP packet CRC problems In-reply-to: ; from M.S.Powell@salford.ac.uk on Mon, Dec 11, 2000 at 03:24:21PM +0000 To: Mark Powell Cc: freebsd-stable@FreeBSD.ORG Mail-followup-to: Mark Powell , freebsd-stable@FreeBSD.ORG Message-id: <20001213075828.U69646@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: Sender: jeremyp@gsmx07.alcatel.com.au Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 2000-Dec-11 15:24:21 +0000, Mark Powell wrote: >-O2 -fomit-frame-pointer -mpentium -march=pentium -pipe > >Cause the kernel to produce TCP CRC errors when talking to certain IP >addresses. As various other people have noted, any optimisation above '-O' is not supported. (Also the checksum is a ones-complement sum, not a CRC). That said, if you can produce test-cases which demonstrate incorrect code generation, the gcc developers would love to hear from you. If you are interested in following this though, you could try compiling in_cksum.c, tcp_output.c and tcp_subr.c (all in /sys/netinet) to assembler (-S) with both sets of options and checking for functional differences in the code generated (-g would make this easier, but can affect the code, so the problem may not appear). >BTW Where in the source is the CRC generated? The are several versions of it. There is a general routine in_cksum() in /sys/netinet/in_cksum.c. There are also a number of special-case inlines in or /sys/i386/include/in_cksum.h. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message