From owner-freebsd-current@FreeBSD.ORG Tue Aug 24 23:57:07 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22E6216A4CE for ; Tue, 24 Aug 2004 23:57:07 +0000 (GMT) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9FA843D39 for ; Tue, 24 Aug 2004 23:57:06 +0000 (GMT) (envelope-from qing.li@bluecoat.com) Received: from bcs-mail.bluecoat.com (bcs-mail.bluecoat.com [216.52.23.69]) by whisker.bluecoat.com (8.13.0/8.13.0) with ESMTP id i7ONv6jq027372; Tue, 24 Aug 2004 16:57:06 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 24 Aug 2004 16:57:05 -0700 Message-ID: <00CDF9AA240E204FA6E923BD35BC6436063B074A@bcs-mail.internal.cacheflow.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: IPv4 checksum oddness (gcc compiler bug?) Thread-Index: AcSKJiw97RFNy1gMTsOhuKw/D79lPgAD567A From: "Li, Qing" To: "Mike Bristow" , X-Scanned-By: MIMEDefang 2.44 Subject: RE: IPv4 checksum oddness (gcc compiler bug?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2004 23:57:07 -0000 I ran into a checksum problem and filed the following bug report. See if it's related. http://www.freebsd.org/cgi/query-pr.cgi?pr=3D69257 >Category: i386 >Responsible: freebsd-i386 >Synopsis: in_cksum_hdr is non-functional without -O compiler flag >Arrival-Date: Sun Jul 18 23:10:10 GMT 2004 -- Qing > -----Original Message----- > From: owner-freebsd-current@freebsd.org=20 > [mailto:owner-freebsd-current@freebsd.org] On Behalf Of Mike Bristow > Sent: Tuesday, August 24, 2004 2:53 PM > To: freebsd-current@freebsd.org > Subject: IPv4 checksum oddness (gcc compiler bug?) >=20 >=20 > Hi, >=20 > I've been suffering from really horrid (~60-70%) packet loss=20 > for a while, but only with IPv4. >=20 > I've spent some time thinking I had a hardware problem, as it=20 > started at the same time as changed some networking bits but=20 > it doesn't appear to be the case: older (5.2.1) version of=20 > FreeBSD don't have this problem. >=20 > I've just cvsuped to RELENG_5 box (cvsup'ed with tag=3DRELENG_5=20 > date=3D2004.08.24.00.00.00), and with the attached patch I see=20 > many entries like in my logs: >=20 > csum calc discrepancy:=20 > 45:10:00:64:b0:22:40:00:40:06:98:95:50:b1:28:36:50:b1:28:34 > csum calc discrepancy:=20 > 45:10:00:84:b0:23:40:00:40:06:98:74:50:b1:28:36:50:b1:28:34 >=20 > However, my patch is obviously wrong. =20 >=20 > The only thing that I can think of that might possibly be the=20 > cause is a compiler optimization bug - but I'm not sure that=20 > that's the case, either. My make.conf is boring=20 > (http://www.urgle.com/~mike/make.conf > if you want to see its dullness). I can't believe that this is > a real problem, rather than an artifact of my stupidity,=20 > because if it was a real problem everyone with old PIIs would=20 > be screaming > the place down. =20 >=20 > Has anyone any ideas as to how to debug this? =20 >=20 > The kernel is GENERIC; possibly interesting other facts include: >=20 > hw.model: Pentium II/Pentium II Xeon/Celeron > hw.ncpu: 2 > vr0: flags=3D8843 mtu 1500 > inet 80.177.40.52 netmask 0xfffffff0 broadcast 80.177.40.63 > inet6 fe80::280:c8ff:feea:8041%vr0 prefixlen 64 scopeid 0x1 > inet6 2002:50b1:2836:1:280:c8ff:feea:8041 prefixlen=20 > 64 autoconf > ether 00:80:c8:ea:80:41 > media: Ethernet autoselect (100baseTX ) > status: active >=20 >=20 > --- ip_input.c.orig Tue Aug 24 22:24:45 2004 > +++ ip_input.c Tue Aug 24 22:24:45 2004 > @@ -366,6 +366,14 @@ > } else { > if (hlen =3D=3D sizeof(struct ip)) { > sum =3D in_cksum_hdr(ip); > + if (sum) { > + u_short sumchk; > + sumchk =3D in_cksum(m, hlen); > + if (!sumchk) { > + printf("csum calc=20 > discrepancy: %20D\n", (u_char *)ip, ":"); > + sum =3D 0; > + } > + } > } else { > sum =3D in_cksum(m, hlen); > } >=20 >=20 > --=20 > You dont have to be illiterate to use the Internet, but it=20 > help's. _______________________________________________ > freebsd-current@freebsd.org mailing list=20 > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to=20 > "freebsd-current-unsubscribe@freebsd.org" >=20