Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 May 2003 18:10:48 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        current@FreeBSD.org
Cc:        wpaul@FreeBSD.org
Subject:   fxp patch to disable 82550 IPCBXMIT feature
Message-ID:  <200305180139.h4I1dFM7064118@gw.catspoiler.org>

next in thread | raw e-mail | index | archive | help
[sorry for sending this twice, I forgot to set the subject ...]

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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305180139.h4I1dFM7064118>