From owner-freebsd-net Fri Feb 22 8:43:52 2002 Delivered-To: freebsd-net@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id A76BB37B404 for ; Fri, 22 Feb 2002 08:43:47 -0800 (PST) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g1MGhjn20106; Fri, 22 Feb 2002 08:43:45 -0800 (PST) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.6/8.11.0) id g1MGhej38249; Fri, 22 Feb 2002 08:43:40 -0800 (PST) (envelope-from jdp) Date: Fri, 22 Feb 2002 08:43:40 -0800 (PST) Message-Id: <200202221643.g1MGhej38249@vashon.polstra.com> To: net@freebsd.org From: John Polstra Cc: larse@ISI.EDU Subject: Re: incorrect checksums with xl? In-Reply-To: <3C7547E0.8050805@isi.edu> References: <3C7547E0.8050805@isi.edu> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article <3C7547E0.8050805@isi.edu>, Lars Eggert wrote: > > I'm looking at a packet trace taken of an xl card under 4.5, and I see > bad IP and TCP/UDP checksums. The release notes state that checksumming > maybe offloaded to the NIC now, but I'd still expect them to be correct > in a packet trace! > > More specifically, the IP checksum is always zero, while the TCP and UDP > checksums are non-zero but bad. However, netstat shows no packets > arriving with bad checksums, so I assume that they get mangled somewhere > in the kernel after inbound processing. (And the machine works fine on a > network; I found this by accident.) > > Any clues? You are running tcpdump on the system that's sending the "bad" packets, right? It makes perfect sense. The TCP/IP stack knows that the NIC is going to insert the checksums, so it doesn't bother calculating them itself. So BPF is handed packets in mbufs without any checksums. On the way out to the wire, the NIC hardware/firmware adds the checksums, but they don't show up in the mbufs that are being sent to BPF. If you run tcpdump on the receiving system instead, you'll find that the checksums seen there are valid. The same thing happens in the bge driver, because it also offloads checksum generation to the NIC. John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message