From owner-freebsd-i386@FreeBSD.ORG Thu Oct 26 10:30:21 2006 Return-Path: X-Original-To: freebsd-i386@hub.freebsd.org Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6BE0916A417 for ; Thu, 26 Oct 2006 10:30:21 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5B1F43D6B for ; Thu, 26 Oct 2006 10:30:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k9QAUG7T054242 for ; Thu, 26 Oct 2006 10:30:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k9QAUG0q054238; Thu, 26 Oct 2006 10:30:16 GMT (envelope-from gnats) Resent-Date: Thu, 26 Oct 2006 10:30:16 GMT Resent-Message-Id: <200610261030.k9QAUG0q054238@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Frans van der Veer Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBD3A16A40F for ; Thu, 26 Oct 2006 10:22:30 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id B703943D4C for ; Thu, 26 Oct 2006 10:22:30 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k9QAMUQo022549 for ; Thu, 26 Oct 2006 10:22:30 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k9QAMUdt022544; Thu, 26 Oct 2006 10:22:30 GMT (envelope-from nobody) Message-Id: <200610261022.k9QAMUdt022544@www.freebsd.org> Date: Thu, 26 Oct 2006 10:22:30 GMT From: Frans van der Veer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: i386/104826: FreeBSD 6.1 not RFC 768 (UDP) compliant on Compaq/HP DL-380G3 X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2006 10:30:21 -0000 >Number: 104826 >Category: i386 >Synopsis: FreeBSD 6.1 not RFC 768 (UDP) compliant on Compaq/HP DL-380G3 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 26 10:30:15 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Frans van der Veer >Release: 6.1 >Organization: PEEK Traffic BV, The Netherlands >Environment: FreeBSD gandalf.rd.nl.peeknet.prv. 6.1-RELEASE FreeBSD 6.1-RELEASE #1: Wed Oct 25 11:31:21 CEST 2006 root@gandalf.rd.nl.peeknet.prv.:/usr/src/sys/i386/compile/GANDALF i386 >Description: During testing of a Profibus/Ethernet gateway device that was suspected not have implemented UDP RFC 768 correctly, we stumbled onto a possible bug on FreeBSD 6.1 in the same area. It appears that 6.1 is not capable of sending out UDP checksum 0xffff when the internal combination of pseudo-header, upd header and udp payload requires that. In stead of that, the machine sends out 0x0000 as UDP checksum which is interpreted as "no checksum calculated". We tracked the failure down to the bge driver. We found that the bge device driver uses a feature called "checksum offload". When we switch that feature off, the system operates accoring to RFC 768. We noticed this with FreeBSD 6.1 on a Compaq/HP DL380G3 system. Relevant lines from the messages file are: Oct 25 11:51:55 gandalf kernel: FreeBSD 6.1-RELEASE #1: Wed Oct 25 11:31:21 CEST 2006 - - Oct 25 11:51:55 gandalf kernel: bge0: mem 0xf06f0000-0xf06fffff irq 29 at device 1.0 on pci2 Oct 25 11:51:55 gandalf kernel: bge0: No checksum offload (This log is from after we created a patch for ourselves, the last log line is due to that patch) We created a dirty fix to get outselves out of trouble for the moment: we switched of the "hwassist" feature in the initialisation phase of the bge driver to give the checksum calculation task back to software in stead of the Broadcom hardware. Kind regards, Frans van der Veer Senior software engineer. R&D department, PEEK Traffic B.V., The Netherlands. >How-To-Repeat: We repeated the problem by creating a small UDP echo program that answered on a machine sending UDP packets. With ethereal (run on another machine since ethereal is troubles by the same checksum offload feature as well) we checked the checksum, did a hexadecimal calculator exercise and modified the data the echo program is sending out to achieve checksum 0xffff. >Fix: As told, we created a "dirty fix" to get us out of trouble for the time being. This is how: Patched File /usr/src/sys/dev/if_bge.c: (from line 2213 on) /* * 5700 B0 chips do not support checksumming correctly due * to hardware bugs. */ if ( 1 ) { ifp->if_capabilities &= ~IFCAP_HWCSUM; ifp->if_capenable &= IFCAP_HWCSUM; ifp->if_hwassist = 0; device_printf(sc->bge_dev, "No checksum offload\n"); } Original code: /* * 5700 B0 chips do not support checksumming correctly due * to hardware bugs. */ if (sc->bge_chipid == BGE_CHIPID_BCM5700_B0) { ifp->if_capabilities &= ~IFCAP_HWCSUM; ifp->if_capenable &= IFCAP_HWCSUM; ifp->if_hwassist = 0; }As told, we created a "dirty fix" to get us out of trouble for the time being. See attached documents on how we did that. >Release-Note: >Audit-Trail: >Unformatted: