From owner-freebsd-stable@FreeBSD.ORG Sat Jan 17 04:54:36 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 4C078106564A; Sat, 17 Jan 2009 04:54:36 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.233]) by mx1.freebsd.org (Postfix) with ESMTP id 07C348FC1D; Sat, 17 Jan 2009 04:54:35 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1963460rvf.43 for ; Fri, 16 Jan 2009 20:54:35 -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=eWZXHE8sbo6PgSZqyJC29PT3KTjk3Ys+fsy4R9YIYdY=; b=j/X4ZUY2P8EwGC/bYic7wia45Jtb374TxJgPfXLDpwRuM2zHG9fdb5SKPER5mwtQJd Ey3v4dfFJOikzSXC/bu2VFv8Udv5fk7WZjMsQCMnWOrTv7na8O/p37hAWwujNkjHHeg/ 14XLTW392cGJh7JQcm7GDT1PgZ8m7bBdK958g= 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=bs5LFAusEauMKmxqQ3t4pZjKtzEH5EkjP+vEv6qTdVI11BxGOGkEw2SDPQtDQ86LOr P1H0n8kBS4M6lqvcDnc0Qy+B5OPiMgmUQcXgas5XBfsqnZXoAYuvETPAVrl3HHs3fG5f jEY1kVZxpFI/vyyXyaCK6ahWlJnFO1FQW7pWY= Received: by 10.141.175.5 with SMTP id c5mr1586075rvp.243.1232168075612; Fri, 16 Jan 2009 20:54:35 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([211.53.35.84]) by mx.google.com with ESMTPS id f42sm1867178rvb.5.2009.01.16.20.54.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Jan 2009 20:54:34 -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 n0H4sP8g068892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 17 Jan 2009 13:54:25 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.14.3/8.14.3/Submit) id n0H4sNlw068891; Sat, 17 Jan 2009 13:54:23 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Sat, 17 Jan 2009 13:54:23 +0900 From: Pyun YongHyeon To: Dimitry Andric Message-ID: <20090117045423.GC68290@cdnetworks.co.kr> References: <8dfae1c10901070639x67945324jeeecfcac647d7976@mail.gmail.com> <20090113050223.GH46346@cdnetworks.co.kr> <496CB2E7.2060902@andric.com> <200901131806.02868.jkim@FreeBSD.org> <496F9823.4060503@andric.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0vzXIDBeUiKkjNJl" Content-Disposition: inline In-Reply-To: <496F9823.4060503@andric.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-stable@FreeBSD.org, Jung-uk Kim , eugene@donpac.ru 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:54:36 -0000 --0vzXIDBeUiKkjNJl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 15, 2009 at 09:10:11PM +0100, Dimitry Andric wrote: > On 2009-01-14 00:05, Jung-uk Kim wrote: > > Can you try one of the following patches? > > > > -CURRENT: http://people.freebsd.org/~jkim/re/re.current.diff > > -STABLE: http://people.freebsd.org/~jkim/re/re.stable.diff > > > > These patches contain all patches suggested by me and yongari and an > > additional patch, which may (or may not) decrease the initial setup > > time. > > I have applied the -STABLE patch, and while this doesn't have much > influence on the initial setup time, it does seem to solve the problem > of not being able to send any packets. I think the initial setup time issue of 8169SC is different one. Did re(4) of 7.0-RELEASE also have the same issue? Also would you try attached patch? It doesn't fix initial setup time issue but I'd like to know whether it makes your controller work. -- Regards, Pyun YongHyeon --0vzXIDBeUiKkjNJl 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); --0vzXIDBeUiKkjNJl--