From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 10:39:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD62EC31 for ; Wed, 11 Dec 2013 10:39:18 +0000 (UTC) Received: from ost.citrin.ru (ost.citrin.ru [193.169.234.215]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9500E163E for ; Wed, 11 Dec 2013 10:39:18 +0000 (UTC) Received: from citrin.office.vega.ru (citrin.office.vega.ru [10.100.124.49]) (Authenticated sender: citrin@citrin.ru) by ost.citrin.ru (Postfix) with ESMTPSA id 91928CEA7C1 for ; Wed, 11 Dec 2013 10:39:16 +0000 (UTC) Message-ID: <52A840D4.9020407@citrin.ru> Date: Wed, 11 Dec 2013 14:39:16 +0400 From: Anton Yuzhaninov User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130516 Thunderbird/17.0.6 MIME-Version: 1.0 To: svn-src-all@freebsd.org Subject: Re: svn commit: r259150 - head/sys/dev/cxgbe References: <201312100007.rBA074Qq055579@svn.freebsd.org> <20131210192650.GK4615@FreeBSD.org> <52A76BBE.5030903@FreeBSD.org> In-Reply-To: <52A76BBE.5030903@FreeBSD.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 10:39:18 -0000 On 12/10/13 23:30, Alexander Motin wrote: >> A> New Revision: 259150 >> A> URL: http://svnweb.freebsd.org/changeset/base/259150 >> A> >> A> Log: >> A> Print out the full PCIe link negotiation during dmesg. >> >> Shouldn't this be done with common code for all drivers >> on PCI bus(es)? >> >> This is definitely useful for all devices, not to cxgbe(4) only. > > Why not just read `pciconf -lc` output for that? 1. pciconf output is cryptic. At least units of measurement should be added. e. g. current output: cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR link x4(x4) speed 5.0(5.0) ASPM disabled(L0s/L1) better to print like: cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR link width x4(x4) speed 5.0 GT/s (5.0 GT/s) ASPM disabled(L0s/L1) 2. It is not obvious for system administrators, that pciconf should be used to inquire link speed. This feature is not documented in handbook or man pages. 3. I agree, that adding more noise to dmesg is not good, but if current bandwidth is not enough for optimal work of the device - error should be printed in dmesg. Example can be found in sys/dev/ixgbe/ixgbe.c if ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && (hw->bus.speed == ixgbe_bus_speed_2500)) { device_printf(dev, "PCI-Express bandwidth available" " for this card\n is not sufficient for" " optimal performance.\n"); device_printf(dev, "For optimal performance a x8 " "PCIE, or x4 PCIE 2 slot is required.\n"); } 4. Similar speed check will be useful for many devices, not only for ixgbe or cxgbe and should be done in some generic way.