From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 00:47:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CA2C106564A; Tue, 10 Feb 2009 00:47:56 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.227]) by mx1.freebsd.org (Postfix) with ESMTP id 1CD258FC1B; Tue, 10 Feb 2009 00:47:55 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so2226570rvf.43 for ; Mon, 09 Feb 2009 16:47:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=rhVRxI8j9eA/5cvFP1SCyqS4ZXVVNVL8OQZPsYnkt9A=; b=tPUq+jGXaGfOYw9UWkWLwtc59ZA1vBoqN/hoRF8VpaWqP6RcI/l0GSASzX5HgVVt2Y hf8O+mO+RxjTi/Zugtq6mf6+2nFn8FzI3TeXrfj1xUK072byEPXleog8iO8L/nPHeQF9 Fj34MkNaeth7UEDwiAeOO1/0WAzEVhEW0P2hg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=G+CR1WXfrRc9Voy0Fj9YjkrkkCULmshptdvyv9UUVROQjvj5uI14XWrYko3HCe+4Np 5a3hdJDsed6BZN0Bkd8UkjNAvR73X6IKWK5U+Tj78f9x42/UB5N4XtuOOCzLywbEMXCl JREF3a1HvolGltiawlnzJnyCK9jhGl0axUOlE= Received: by 10.141.114.19 with SMTP id r19mr4304789rvm.24.1234226875630; Mon, 09 Feb 2009 16:47:55 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([114.111.62.249]) by mx.google.com with ESMTPS id c20sm9850323rvf.8.2009.02.09.16.47.52 (version=SSLv3 cipher=RC4-MD5); Mon, 09 Feb 2009 16:47:54 -0800 (PST) Received: by michelle.cdnetworks.co.kr (sSMTP sendmail emulation); Tue, 10 Feb 2009 09:50:02 +0900 From: Pyun YongHyeon Date: Tue, 10 Feb 2009 09:50:02 +0900 To: Gary Jennejohn Message-ID: <20090210005002.GD98095@michelle.cdnetworks.co.kr> References: <200902090459.n194xDa3045928@svn.freebsd.org> <20090209181056.40db0ba2@ernst.jennejohn.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tEFtbjk+mNEviIIX" Content-Disposition: inline In-Reply-To: <20090209181056.40db0ba2@ernst.jennejohn.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r188381 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 00:47:57 -0000 --tEFtbjk+mNEviIIX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 09, 2009 at 06:10:56PM +0100, Gary Jennejohn wrote: > On Mon, 9 Feb 2009 04:59:13 +0000 (UTC) > Pyun YongHyeon wrote: > > > Author: yongari > > Date: Mon Feb 9 04:59:13 2009 > > New Revision: 188381 > > URL: http://svn.freebsd.org/changeset/base/188381 > > > > Log: > > Reclaim transmitted frames in re_tick(). This is for PCIe > > controllers that lose Tx completion interrupts under certain > > conditions. With this change it's safe to use MSI on PCIe > > controllers so enable MSI on these controllers. > > > > Modified: > > head/sys/dev/re/if_re.c > > > > This does not work with my re(4). When I allow MSI it never transmits. > I noticed this while booting when the sendmail startup hung. A test > with ping(8) showed that there was no output (or maybe no input, hard > to tell with ping). > > Here dmesg output when it fails: > re0: port 0xde00-0xdeff mem 0xfdaff000-0xfdafffff,0xfdae0000-0xfdaeffff irq 18 at device 0.0 on pci2 > re0: Using 2 MSI messages > re0: Chip rev. 0x3c000000 > re0: MAC rev. 0x00400000 > re0: Ethernet address: 00:1f:d0:8f:5a:43 > re0: [FILTER] > re0: [FILTER] > re0: link state changed to UP > > Here dmesg output when it succeeds: > re0: port 0xde00-0xdeff mem 0xfdaff000-0xfdafffff,0xfdae0000-0xfdaeffff irq 18 at device 0.0 on pci2 > re0: turning off MSI enable bit. > re0: Chip rev. 0x3c000000 > re0: MAC rev. 0x00400000 > re0: Ethernet address: 00:1f:d0:8f:5a:43 > re0: [FILTER] > re0: link state changed to UP > > And here pciconf output: > re0@pci0:2:0:0: class=0x020000 card=0xe0001458 chip=0x816810ec rev=0x02 hdr=0x00 > vendor = 'Realtek Semiconductor' > device = 'RTL8168/8111 PCI-E Gigabit Ethernet NIC' > class = network > subclass = ethernet > It seems that broken controllers have two MSI messages. Instead of reverting the change, how about attached patch? --tEFtbjk+mNEviIIX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="re.msi.diff" Index: sys/pci/if_rlreg.h =================================================================== --- sys/pci/if_rlreg.h (revision 188426) +++ sys/pci/if_rlreg.h (working copy) @@ -779,7 +779,7 @@ #define RE_RX_DESC_BUFLEN MCLBYTES #endif -#define RL_MSI_MESSAGES 2 +#define RL_MSI_MESSAGES 1 #define RL_ADDR_LO(y) ((uint64_t) (y) & 0xFFFFFFFF) #define RL_ADDR_HI(y) ((uint64_t) (y) >> 32) Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c (revision 188426) +++ sys/dev/re/if_re.c (working copy) @@ -1149,7 +1149,8 @@ if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); } - if (msic == RL_MSI_MESSAGES && msi_disable == 0) { + if (msic > 0 && msi_disable == 0) { + msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI messages\n", --tEFtbjk+mNEviIIX--