From owner-freebsd-hackers Thu Aug 13 05:13:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA19592 for freebsd-hackers-outgoing; Thu, 13 Aug 1998 05:13:00 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ic.vrn.ru (ic.vrn.ru [195.98.64.65]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA19563 for ; Thu, 13 Aug 1998 05:12:48 -0700 (PDT) (envelope-from bazilio@monitord.vrn.ru) Received: from dialup34.vrn.ru (dialup34.vrn.ru [195.98.64.192]) by ic.vrn.ru (8.8.8/Relcom-2A) with SMTP id QAA17396 for ;Thu, 13 Aug 1998 16:01:48 +0400 (MSD) Received: from baz_station [192.168.100.10] by monitor.voronezh.su [127.0.0.1] with SMTP (MDaemon.v2.7.SP0.R) for ; Thu, 13 Aug 98 14:25:56 +0400 Message-ID: <000801bdc6a4$6e6fd180$0a64a8c0@baz_station.monitord.vrn.ru> From: "Vasily V. Grechishnikov" To: "Bill Paul" Cc: Subject: Re: Some errors in XL driver ? Date: Thu, 13 Aug 1998 14:23:35 +0400 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.0 X-MDaemon-Deliver-To: freebsd-hackers@freebsd.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----Original Message----- From: Bill Paul To: Vasily V. Grechishnikov Cc: hackers@freebsd.org Date: 12 августа 1998 г. 1:01 Subject: Re: Some errors in XL driver ? >Of all the gin joints in all the towns in all the world, Vasily V. >Grechishnikov had to walk into mine and say: > >> Hi ! >> Today I had to test 3C905 NIC. After downloading XL driver >> from www.freebsd.org/~/wpaul I had strange results. NIC detection >> and autonegotiation works fine but some performance problem >> occured - 380-400Kb/s at 10Mbps. After looking at network >> statistic I saw very high Ierrs count. Here netstat -ni from my >> test box running 2.2.7-RELEASE after downloading 12MB >> file from local ftp. Whats happen ? >> >> Name Mtu Network Address Ipkts Ierrs Opkts Oerrs >> Coll >> xl0 1500 00.a0.24.4d.c3.3b 9305 1757 4113 0 >> 0 >> xl0 1500 192.168.100 192.168.100.245 9305 1757 4113 0 >> 0 Now my 3c905B works nicely. netstat -ni after applying patch listed below: Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll xl0 1500 00.10.4b.06.a7.55 9083 4 4018 1565 332 xl0 1500 192.168.100 192.168.100.245 9083 4 4018 1565 332 lp0* 1500 0 0 0 0 0 tun0* 1500 0 0 0 0 0 sl0* 552 0 0 0 0 0 ppp0* 1500 0 0 0 0 0 lo0 16384 26 0 26 0 0 lo0 16384 127 127.0.0.1 26 0 26 0 0 > >Aieeee! I think I found the cause of this problem. The autonegotiation >code is setting the modes incorrectly. Please try to fix this using >one of the following methods: > >- Force the card to 10mbps/half-duplex mode using the following command: > # ifconfig xl0 media 10baseT/UTP mediaopt half-duplex > This is just to see if setting the mode correctly clears up the > problem. If so, do one of the next to things. > >- Apply the following patch to if_xl.c, recompile your kernel, and > reboot: > >--- if_xl.c 1998/08/11 02:13:59 1.33 >+++ if_xl.c 1998/08/11 15:26:28 >@@ -796,13 +796,13 @@ > ability & PHY_ANAR_10BTFULL) { > ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_FDX; > media &= ~PHY_BMCR_SPEEDSEL; >- media &= ~PHY_BMCR_DUPLEX; >+ media |= PHY_BMCR_DUPLEX; > printf("(full-duplex, 10Mbps)\n"); > } else if (advert & PHY_ANAR_10BTHALF && > ability & PHY_ANAR_10BTHALF) { > ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX; > media &= ~PHY_BMCR_SPEEDSEL; >- media |= PHY_BMCR_DUPLEX; >+ media &= ~PHY_BMCR_DUPLEX; > printf("(half-duplex, 10Mbps)\n"); > } > > >- Download a new copy of if_xl.c from www.freebsd.org/~wpaul/3Com, > recompile your kernel and reboot. > >As you can see, I transposed a couple of lines: the chip is detecting >the right modes, but the code later sets the duplex mode incorrectly. >I'm not sure how this crept in, but it explains the poor performance >at 10Mbps: if you set the duplex bit incorrectly, the card behaves >very strangely. I didn't notice this initially because the machine I >use for 10Mbps testing has a 3c900 card, which does not have a PHY, >hance the autoneg code is never used. The other code in xl_setmode_mii() >which manually sets the chip modes gets this right, which is why >setting the mode manually works. > >I apologize for this stupid mistake; that's what I get for not doing >proper testing. Naturally, at 100Mbps, which is what my 3c905B test >machines were set for, it works right. > >[chop] > >> dmesg output (disabled XL_USEIOSPACE), else if this variable >> defined we has supplement warning xl0: command never completed!: > >[chop] > >This I want to know more about. It anybody else sees this, please >let me know. Try to show me where the warning appears and whether or >not it affects the operation of the NIC. > >-Bill > >-- >=========================================================================== == >-Bill Paul (212) 854-6020 | System Manager, Master of Unix-Fu >Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research >Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City >=========================================================================== == > "It is not I who am crazy; it is I who am mad!" - Ren Hoek, "Space Madness" >=========================================================================== == > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message