From owner-freebsd-stable@FreeBSD.ORG Sat Jan 17 04:45:56 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 788261065670; Sat, 17 Jan 2009 04:45:56 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.230]) by mx1.freebsd.org (Postfix) with ESMTP id 3544A8FC1A; Sat, 17 Jan 2009 04:45:55 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1961495rvf.43 for ; Fri, 16 Jan 2009 20:45:55 -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=6mZzrmHdQe/nAxQK23D6LgfN5UHwYZCVW6Jy9p5+HJs=; b=q+ttTelnS0vyFf2AZOk86zK+fgYYd7djXSLzWOnPtLFwii+cBk4wmZ7nRxRnFgrDnX fOI8p0moC2AOeJlVCH5MAfiqEyrBRBpm09CzI7gMR3fU6y6bN5QDB454b36pI7FCVTG8 UzUPYbVyWd7SMbGMujHhIyRFwPvSj8RLE9vDw= 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=ZY5ku/gOnBM2SIMzE346t5Pl17lxaF1TC60C3+bjavypXvk8apZpNVWzF7xMorvTxc Na5IY9rANPqqGofn6KvIVUTSyMYBWV5BgXJ5yRDGLKKQTtEJZWPjiJJVxav9LZwFLJnR GjQdRFW3rMd+b/7XTtYuNjJmE/rBL00KO2oFA= Received: by 10.141.197.14 with SMTP id z14mr222224rvp.63.1232167555795; Fri, 16 Jan 2009 20:45:55 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([211.53.35.84]) by mx.google.com with ESMTPS id g31sm4228153rvb.4.2009.01.16.20.45.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Jan 2009 20:45:53 -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 n0H4jlZw068865 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 17 Jan 2009 13:45:47 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.14.3/8.14.3/Submit) id n0H4jjVg068864; Sat, 17 Jan 2009 13:45:45 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Sat, 17 Jan 2009 13:45:45 +0900 From: Pyun YongHyeon To: Bartosz Stec Message-ID: <20090117044545.GA68290@cdnetworks.co.kr> References: <8dfae1c10901070639x67945324jeeecfcac647d7976@mail.gmail.com> <496DF428.6050800@kkip.pl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline In-Reply-To: <496DF428.6050800@kkip.pl> User-Agent: Mutt/1.4.2.3i Cc: Walter Venable , stable@freebsd.org, yongari@freebsd.org 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:45:56 -0000 --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 14, 2009 at 03:18:16PM +0100, Bartosz Stec wrote: > Walter Venable pisze: > >FreeBSD 7.1 upgrade broke my network access, machine is totally > >offline (powered-on and I can play inside it at the terminal, but > >absolutely 0 network access): > >This happened AFTER make kernel but BEFORE make installworld. I think > >this implies it's a kernel driver issue. > > > >http://forums.freebsd.org/showthread.php?t=1323 (this is an ongoing > >thread on the issue, the rl driver has also been reported broken). > >_______________________________________________ > >freebsd-stable@freebsd.org mailing list > >http://lists.freebsd.org/mailman/listinfo/freebsd-stable > >To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > > > I can confirm issues with re and 7.1-R > > dmesg: > re0: port > 0xbc00-0xbcff mem 0xfbfff000-0xfbfff0ff irq 17 at device 7.0 on pci1 > re0: Chip rev. 0x18000000 > re0: MAC rev. 0x00000000 > > In my case this NIC works, but lags like hell after upgrade! Working on > console gives me pauses every 3-4 second, and second server which > connect to this one with re0 is reporting that communication is lost > every couple of minutes > Would you try attached patch? -- Regards, Pyun YongHyeon --mP3DRpeJDSE+ciuQ 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); --mP3DRpeJDSE+ciuQ--