From owner-freebsd-stable@FreeBSD.ORG Sat Jan 17 04:48:08 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A58510656BD; Sat, 17 Jan 2009 04:48:08 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by mx1.freebsd.org (Postfix) with ESMTP id AEA898FC1C; Sat, 17 Jan 2009 04:48:07 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1961912rvf.43 for ; Fri, 16 Jan 2009 20:48:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:date:from :to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=wjitnP46DdG5iuzGawv+Q8cTtg9PMiFVWMRDuFNxdTo=; b=jCpOHhSGq4yRTXMLSBDL5jHSyNVuIu+Iofn2MKu54hV7mWLodSESqggi79YsA1ScZt seE64oU2mABqXqGtGHNVYEYBwj/3XgH6wg0+iJ0zaIUV1b3tDNhe35MCFjemebAf0VCa 8nfDczivnFlYEviHIuaHdclKf1jAuX/yKjP/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ZfM412goDUnM3hnssViejniI/CIOlPpGSuFoFYB+UX2agMvqwBd8nPB7FslAkszxDW iqerX7LYBmLnRpBxdlNHshSzBTBfIzHKRAlSsj4UCR7vTu65PL5iocWfGuBqYkBLPvfk 1L9imhIhtfJu5qHWb/2Rx3BUYLcEvBgqTcSoM= Received: by 10.141.137.8 with SMTP id p8mr1590535rvn.170.1232167687368; Fri, 16 Jan 2009 20:48:07 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([211.53.35.84]) by mx.google.com with ESMTPS id b8sm4265675rvf.9.2009.01.16.20.48.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Jan 2009 20:48:06 -0800 (PST) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.14.3/8.14.3) with ESMTP id n0H4m0QI068876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 17 Jan 2009 13:48:00 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.14.3/8.14.3/Submit) id n0H4lwgl068875; Sat, 17 Jan 2009 13:47:58 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Sat, 17 Jan 2009 13:47:58 +0900 From: Pyun YongHyeon To: Sascha Holzleiter Message-ID: <20090117044758.GB68290@cdnetworks.co.kr> References: <8dfae1c10901070639x67945324jeeecfcac647d7976@mail.gmail.com> <496B7C17.8010107@holzleiter.name> <200901122010.37269.jkim@FreeBSD.org> <496CAB07.5020404@holzleiter.name> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="cvVnyQ+4j833TQvp" Content-Disposition: inline In-Reply-To: <496CAB07.5020404@holzleiter.name> User-Agent: Mutt/1.4.2.3i Cc: freebsd-stable@freebsd.org, Jung-uk Kim Subject: Re: FreeBSD 7.1 Breaks re and rl Network Interface Drivers X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 04:48:08 -0000 --cvVnyQ+4j833TQvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 13, 2009 at 03:53:59PM +0100, Sascha Holzleiter wrote: > Jung-uk Kim wrote: > >On Monday 12 January 2009 12:21 pm, Sascha Holzleiter wrote: > >>Hi, > >> > >>i see similar problems with a re card: > >> > >>re0@pci0:4:7:0: class=0x020000 card=0x816710ec chip=0x816710ec > >>rev=0x10 hdr=0x00 > >> vendor = 'Realtek Semiconductor' > >> device = 'RTL8169/8110 Family Gigabit Ethernet NIC' > >> class = network > >> subclass = ethernet > >> > >>After upgrading to 7.1-RELEASE (and also STABLE) the NIC doesn't > >>seem to receive any frames. I can see the DHCP Requests on the DHCP > >>Server but the DHCPOFFERS are never seen by the client with the re0 > >>device. After setting promiscious mode on the interface (i.e. by > >>tcpdump -ni re0) the interface begins to work fine. > >> > >>I've attached a complete dmesg output, but i think the detection > >>works fine, here the short version: > >> > >>re0: port > >>0x9c00-0x9cff mem 0xdfdff000-0xdfdff0ff irq 20 at device 7.0 on > >>pci4 re0: Chip rev. 0x18000000 > >>re0: MAC rev. 0x00000000 > >>miibus0: on re0 > >>rgephy0: PHY 1 on miibus0 > >>rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, > >>1000baseT, 1000baseT-FDX, auto > >>re0: Ethernet address: 00:1a:92:35:29:fa > >>re0: [FILTER] > > > >Please revert SVN r180519 (or CVS r1.95.2.22) and try again: > > > >http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/re/if_re.c.diff?r1=1.95.2.21;r2=1.95.2.22 > > Thanks! This fixed my problem. I now have DHCP and a running network > interface again with a 7.1-STABLE and the reverted r180519 changes. > If you need to test another version for the changes in r180519 let me > know and i'll test them on this machine. > It seems that RTL8169SC does not like memory mapping. Instead of using io mapping for all revisions, how about attached patch? -- Regards, Pyun YongHyeon --cvVnyQ+4j833TQvp Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="re.8169sc.diff" Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c (revision 187352) +++ sys/dev/re/if_re.c (working copy) @@ -158,6 +158,8 @@ /* Tunables. */ static int msi_disable = 1; TUNABLE_INT("hw.re.msi_disable", &msi_disable); +static int prefer_iomap = 0; +TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); #define RE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -1131,26 +1133,36 @@ pci_enable_busmaster(dev); devid = pci_get_device(dev); - /* Prefer memory space register mapping over IO space. */ - sc->rl_res_id = PCIR_BAR(1); - sc->rl_res_type = SYS_RES_MEMORY; - /* RTL8168/8101E seems to use different BARs. */ - if (devid == RT_DEVICEID_8168 || devid == RT_DEVICEID_8101E) - sc->rl_res_id = PCIR_BAR(2); + /* + * Prefer memory space register mapping over IO space. + * Because RTL8169SC does not seem to work when memory mapping + * is used always activate io mapping. + */ + if (devid == RT_DEVICEID_8169SC) + prefer_iomap = 1; + if (prefer_iomap == 0) { + sc->rl_res_id = PCIR_BAR(1); + sc->rl_res_type = SYS_RES_MEMORY; + /* RTL8168/8101E seems to use different BARs. */ + if (devid == RT_DEVICEID_8168 || devid == RT_DEVICEID_8101E) + sc->rl_res_id = PCIR_BAR(2); + } else { + sc->rl_res_id = PCIR_BAR(0); + sc->rl_res_type = SYS_RES_IOPORT; + } sc->rl_res = bus_alloc_resource_any(dev, sc->rl_res_type, &sc->rl_res_id, RF_ACTIVE); - - if (sc->rl_res == NULL) { + if (sc->rl_res == NULL && prefer_iomap == 0) { sc->rl_res_id = PCIR_BAR(0); sc->rl_res_type = SYS_RES_IOPORT; sc->rl_res = bus_alloc_resource_any(dev, sc->rl_res_type, &sc->rl_res_id, RF_ACTIVE); - if (sc->rl_res == NULL) { - device_printf(dev, "couldn't map ports/memory\n"); - error = ENXIO; - goto fail; - } } + if (sc->rl_res == NULL) { + device_printf(dev, "couldn't map ports/memory\n"); + error = ENXIO; + goto fail; + } sc->rl_btag = rman_get_bustag(sc->rl_res); sc->rl_bhandle = rman_get_bushandle(sc->rl_res); --cvVnyQ+4j833TQvp--