From owner-freebsd-current@FreeBSD.ORG Thu Jun 17 16:29:31 2004 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 1A97116A4CE for ; Thu, 17 Jun 2004 16:29:31 +0000 (GMT) Received: from lithium.plan-ix.de (lithium.plan-ix.de [212.37.39.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF8E443D46 for ; Thu, 17 Jun 2004 16:29:29 +0000 (GMT) (envelope-from braukmann@tse-online.de) Received: from localhost (lithium.plan-ix.de [212.37.39.35]) by lithium.plan-ix.de (Postfix) with ESMTP id 901852EDE51 for ; Thu, 17 Jun 2004 16:29:13 +0000 (GMT) Received: from localhost.plan-ix.de ([212.37.39.35]) by localhost (lithium.plan-ix.de [212.37.39.35]) (amavisd-new, port 10025) with ESMTP id 97700-01 for ; Thu, 17 Jun 2004 16:29:12 +0000 (GMT) Received: from [192.168.222.10] (adsl-dyn-241-2.heliweb.de [83.216.241.2]) by lithium.plan-ix.de (Postfix) with ESMTP id D68AF2EDE50 for ; Thu, 17 Jun 2004 16:29:12 +0000 (GMT) Date: Thu, 17 Jun 2004 18:29:12 +0200 From: Andreas Braukmann To: freebsd-current@freebsd.org Message-ID: <17680000.1087489752@bitrot.bitlab.unixxinu.de> X-Mailer: Mulberry/3.1.0 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-new at plan-ix.de Subject: Realtek RT8139 (onboard) - failed to receive packet in loopback mode 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: Thu, 17 Jun 2004 16:29:31 -0000 Hi there, I'm using a bunch of Portwell SBCs with five onboard Realtek 8139C+ NICs. Currently they're running 5.0 kernels from around April, 2003 and the NICs are driven by rl(4). Since then the 8139C+ was moved to re(4). re(4) doesn't like the chips, though. pciconf -lv output: re0@pci0:9:0: class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00 vendor = 'Realtek Semiconductor' device = 'RT8139 (A/B/C/813x/C+) Fast Ethernet Adapter' class = network subclass = ethernet dmesg output: re0: port 0xdc00-0xdcff mem 0xe3400000-0xe34000ff irq 11 at device 9.0 on pci0 re0: Ethernet address: 00:90:fb:04:1b:31 re0: diagnostic failed, failed to receive packet in loopback mode re0: attach aborted due to hardware diag failure device_attach: re0 attach returned 5 It seems that the 8169-specific hardware diagnostic (re_diag(sc)) should only carried out for chips being identified as 8169 based. I did this trivial patch (v 1.24): gate# diff -C2 if_re.c.sav if_re.c *** if_re.c.sav Thu Jun 17 17:08:48 2004 --- if_re.c Thu Jun 17 17:09:58 2004 *************** *** 1277,1287 **** /* Perform hardware diagnostic. */ ! error = re_diag(sc); ! if (error) { ! printf("re%d: attach aborted due to hardware diag failure\n", ! unit); ! ether_ifdetach(ifp); ! goto fail; } --- 1277,1289 ---- /* Perform hardware diagnostic. */ ! if (sc->rl_type == RL_8169) { ! error = re_diag(sc); ! if (error) { ! printf("re%d: attach aborted due to hardware diag failure\n", ! unit); ! ether_ifdetach(ifp); ! goto fail; ! } } The neat result: gate# kldload ./if_re.ko re0: port 0xdc00-0xdcff mem 0xe3400000-0xe34000ff irq 11 at device 9.0 on pci0 re0: Ethernet address: 00:90:fb:04:1b:31 re0: [GIANT-LOCKED] [... same for the other four nics ...] I see no ill effects so far. -Andreas