From owner-freebsd-mobile Mon Feb 12 12:30:30 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 5756837B4EC; Mon, 12 Feb 2001 12:30:22 -0800 (PST) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id VAA90919; Mon, 12 Feb 2001 21:30:21 +0100 (CET) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: mobile@freebsd.org Cc: wpaul@freebsd.org Subject: dc0 problems From: Dag-Erling Smorgrav Date: 12 Feb 2001 21:30:20 +0100 Message-ID: Lines: 105 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I have two IBM EtherJet 10/100 Cardbus cards (Xircom X3201), one with external dongle, the other with built-in jack (the outside end of the card is twice as thick as the inside end). The one with the external dongle works fine. The one with the built-in jack generates lots of "TX underrun" messages (up to several hundred a minute): Feb 9 20:30:58 aes /boot/kernel/kernel: dc0: TX underrun -- using store and forward mode Feb 9 20:33:58 aes /boot/kernel/kernel: dc0: TX underrun -- using store and forward mode Feb 9 20:35:28 aes last message repeated 30 times Feb 9 20:45:28 aes last message repeated 205 times Feb 9 20:54:59 aes last message repeated 132 times Feb 9 21:05:29 aes last message repeated 73 times Feb 9 21:09:59 aes last message repeated 25 times Feb 9 21:10:29 aes /boot/kernel/kernel: dc0: TX underrun -- using store and forward mode Feb 9 21:10:29 aes last message repeated 4 times Feb 9 21:12:29 aes last message repeated 52 times Feb 9 21:12:59 aes /boot/kernel/kernel: dc0: TX underrun -- using store and forward mode Feb 9 21:38:30 aes /boot/kernel/kernel: dc0: TX underrun -- using store and forward mode Feb 9 21:39:30 aes last message repeated 35 times Here's a diff of the probe messages for the two cards; where they differ, the - lines are from the one that works and the + lines from the one that doesn't. Note that the production dates and MAC addresses are (unsurprisingly) different; other than that, the only differences are a few bytes in some of the unkown tuples (one of which seems to contain the lower 24 bits of the MAC address). --- dc0-works Mon Feb 12 21:17:55 2001 +++ dc0-doesnt-work Mon Feb 12 21:18:08 2001 @@ -1,33 +1,33 @@ cardbus0: Detaching card: no cards to detach! pccbb0: pccbb_power: CARD_VCC_0V and CARD_VPP_0V [44] -pccbb1: card inserted: event=0x00000000, state=30000920 +pccbb1: card inserted: event=0x00000009, state=30000920 pccbb1: pccbb_power: CARD_VCC_0V and CARD_VPP_0V [44] pccbb1: pccbb_power: CARD_VCC_3V and CARD_VPP_VCC [11] TUPLE: LINKTARGET [3]: 43 49 53 Product version: 5.0 Product name: IBM | 10/100 EtherJet CardBus | IBMC-10/100 | 1.04 | -TUPLE: Unknown(0x88) [4]: 8d cb 90 00 -TUPLE: Unknown(0x8a) [12]: 4a 31 35 35 31 39 30 43 42 38 44 00 -TUPLE: Unknown(0x8b) [4]: 00 00 00 00 +TUPLE: Unknown(0x88) [4]: db 4b 25 00 +TUPLE: Unknown(0x8a) [12]: 4a 31 35 35 31 32 35 34 42 44 42 00 +TUPLE: Unknown(0x8b) [4]: 01 00 00 00 Manufacturer ID: a400130181 -TUPLE: DATE [4]: ef 52 b9 26 +TUPLE: DATE [4]: a2 4a 39 29 Functions: Network Adaptor, Multi-Functioned -Function Extension: 040600062990cb8d +Function Extension: 0406000629254bdb Function Extension: 0102 Function Extension: 0280969800 Function Extension: 0200e1f505 Function Extension: 0301 Function Extension: 0303 Function Extension: 0501 TUPLE: DEVICE_OC [4]: 02 4f 02 ff cardbus1: Opening BAR: type=IO, bar=10, len=0080 cardbus1: Opening BAR: type=MEM, bar=14, len=0080 cardbus1: Opening BAR: type=MEM, bar=18, len=0100 cardbus1: Invalid BAR number: 27(06) TUPLE: CONFIG_CB [7]: 03 02 03 01 00 00 ff TUPLE: CFTABLE_ENTRY_CB [8]: 41 b0 b0 bc 8e 0e fb 04 TUPLE: CFTABLE_ENTRY_CB [9]: 02 b8 02 b0 bc 8e 1c fb 04 TUPLE: NO_LINK [0]: CIS reading done dc0: port 0x3000-0x307f mem 0x44004000-0x44007fff,0x44000800-0x44000fff,0x44000000-0x440007ff irq 11 at device 0.0 on cardbus1 -dc0: Ethernet address: 00:06:29:90:cb:8d +dc0: Ethernet address: 00:06:29:25:4b:db Bill Paul suggested on IRC to set the DC_TX_STORENFWD flag for X3201 chips, but I haven't tried that yet (I'll post the results when I get the chance) and it doesn't seem entirely fair since the other card works fine without it (including autonegotiation; I've used it on both 10 and 100 Mbps networks). Here's the patch (watch for whitespace conflicts due to cut'n'paste): des@aes /sys/pci% lcvs diff if_dc.c Index: if_dc.c =================================================================== RCS file: /home/ncvs/src/sys/pci/if_dc.c,v retrieving revision 1.44 diff -u -r1.44 if_dc.c --- if_dc.c 2001/01/20 00:07:49 1.44 +++ if_dc.c 2001/02/12 20:00:07 @@ -1927,6 +1927,7 @@ case DC_DEVICEID_X3201: sc->dc_type = DC_TYPE_XIRCOM; sc->dc_flags |= DC_TX_INTR_ALWAYS | DC_TX_COALESCE; + sc->dc_flags |= DC_TX_STORENFWD; /* * We don't actually need to coalesce, but we're doing * it to obtain a double word aligned buffer. If I get the dongle for the other card back (I inadvertantly left it at a customer's after a meeting) I may be able to send the dongle-less card to someone capable of looking into this problem (provided my employer approves, as the card is not mine). DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message