From owner-freebsd-current@FreeBSD.ORG Sat May 17 18:10:56 2003 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 7292737B401; Sat, 17 May 2003 18:10:56 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6CBE43F3F; Sat, 17 May 2003 18:10:55 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9/8.12.9) with ESMTP id h4I1AmM7064092; Sat, 17 May 2003 18:10:52 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200305180110.h4I1AmM7064092@gw.catspoiler.org> Date: Sat, 17 May 2003 18:10:48 -0700 (PDT) From: Don Lewis To: current@FreeBSD.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: wpaul@FreeBSD.org Subject: 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: Sun, 18 May 2003 01:10:56 -0000 Since I'm not the only one who has run into the problem with 82550-based fxp cards truncating packets of certain sizes and we're getting close to 5.1-RELEASE, I thought I should crank out a patch that creates a boot-time knob to keep the fxp driver from enabling the new feature in these cards that seems to trigger the problem. For the record, my card is labeled as: Intel (R) Pro/100S Desktop Adapter and are the PILA8460C3 flavor. The chip is labeled 82550GY. The information returned by "pciconf -l" is: fxp0@pci0:10:0: class=0x020000 card=0x00508086 chip=0x12298086 rev=0x0d hdr=0x00 The other report of this problem that I have data about is fxp0@pci7:2:0: class=0x020000 card=0x10508086 chip=0x12298086 rev=0x0d hdr=0x00 This problem mostly seems to affect NFS, probably because of the packet size distribution in NFS versus the packet sizes commonly found when using ssh or browsing the web. It is possible to test for the presence of this problem in a non-VLAN network by doing: ping -s 216 somehost ping -s 1696 somehost ping -s 3176 somehost If you are affected by this problem, you won't get a response to a ping, and a tcpdump from a host other than the broken one will show that the ICMP packets are truncated. I elected to make the knob tunable by a kernel environment variable that can be set in /boot/loader.conf. I'm open to changing the variable name or to making it settable in /boot/device.hints. How should this knob be documented so that users who are affected by this problem can easily find it? Index: sys/dev/fxp/if_fxp.c =================================================================== RCS file: /home/ncvs/src/sys/dev/fxp/if_fxp.c,v retrieving revision 1.178 diff -u -r1.178 if_fxp.c --- sys/dev/fxp/if_fxp.c 30 Apr 2003 04:14:56 -0000 1.178 +++ sys/dev/fxp/if_fxp.c 18 May 2003 00:10:09 -0000 @@ -379,7 +379,8 @@ u_int32_t val; u_int16_t data, myea[ETHER_ADDR_LEN / 2]; int i, rid, m1, m2, prefer_iomap, maxtxseg; - int s; + int s, ipcbxmit_disable = 0; + char tmpstr[32]; sc->dev = dev; callout_handle_init(&sc->stat_ch); @@ -578,9 +579,19 @@ * and later chips. Note: we need extended TXCB support * too, but that's already enabled by the code above. * Be careful to do this only on the right devices. + * + * At least some 82550 cards probed as "chip=0x12298086 rev=0x0d" + * truncate packets that end with an mbuf containing 1 to 3 bytes + * when used with this feature enabled in this version of the + * driver. The hw.fxp.DEVICENUMBER.ipcbxmit_disable knob allows + * this to be disabled at boot time. */ - if (sc->revision == FXP_REV_82550 || sc->revision == FXP_REV_82550_C) { + snprintf(tmpstr, sizeof(tmpstr), "hw.fxp.%d.ipcbxmit_disable", + device_get_unit(dev)); + TUNABLE_INT_FETCH(tmpstr, &ipcbxmit_disable); + if (ipcbxmit_disable == 0 && (sc->revision == FXP_REV_82550 || + sc->revision == FXP_REV_82550_C)) { sc->rfa_size = sizeof (struct fxp_rfa); sc->tx_cmd = FXP_CB_COMMAND_IPCBXMIT; sc->flags |= FXP_FLAG_EXT_RFA;