From owner-svn-src-all@FreeBSD.ORG Sun Dec 15 03:05:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 851C6410 for ; Sun, 15 Dec 2013 03:05:46 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB6CA1276 for ; Sun, 15 Dec 2013 03:05:44 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBF35ZoN036666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 15 Dec 2013 07:05:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBF35Z7x036665; Sun, 15 Dec 2013 07:05:35 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 15 Dec 2013 07:05:35 +0400 From: Gleb Smirnoff To: Anton Yuzhaninov Subject: Re: svn commit: r259150 - head/sys/dev/cxgbe Message-ID: <20131215030535.GC29088@glebius.int.ru> References: <201312100007.rBA074Qq055579@svn.freebsd.org> <20131210192650.GK4615@FreeBSD.org> <52A76BBE.5030903@FreeBSD.org> <52A840D4.9020407@citrin.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52A840D4.9020407@citrin.ru> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-all@freebsd.org 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: Sun, 15 Dec 2013 03:05:46 -0000 Anton, On Wed, Dec 11, 2013 at 02:39:16PM +0400, Anton Yuzhaninov wrote: A> On 12/10/13 23:30, Alexander Motin wrote: A> >> A> New Revision: 259150 A> >> A> URL: http://svnweb.freebsd.org/changeset/base/259150 A> >> A> A> >> A> Log: A> >> A> Print out the full PCIe link negotiation during dmesg. A> >> A> >> Shouldn't this be done with common code for all drivers A> >> on PCI bus(es)? A> >> A> >> This is definitely useful for all devices, not to cxgbe(4) only. A> > A> > Why not just read `pciconf -lc` output for that? A> A> 1. pciconf output is cryptic. At least units of measurement should be added. A> A> e. g. current output: A> A> cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR link x4(x4) A> speed 5.0(5.0) ASPM disabled(L0s/L1) A> A> better to print like: A> A> cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR link width x4(x4) A> speed 5.0 GT/s (5.0 GT/s) ASPM disabled(L0s/L1) A> A> 2. It is not obvious for system administrators, that pciconf should be used to A> inquire link speed. This feature is not documented in handbook or man pages. A> A> 3. I agree, that adding more noise to dmesg is not good, but if current A> bandwidth is not enough for optimal work of the device - error should be printed A> in dmesg. A> A> Example can be found in sys/dev/ixgbe/ixgbe.c A> A> if ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && A> (hw->bus.speed == ixgbe_bus_speed_2500)) { A> device_printf(dev, "PCI-Express bandwidth available" A> " for this card\n is not sufficient for" A> " optimal performance.\n"); A> device_printf(dev, "For optimal performance a x8 " A> "PCIE, or x4 PCIE 2 slot is required.\n"); A> } A> A> 4. Similar speed check will be useful for many devices, not only for ixgbe or A> cxgbe and should be done in some generic way. I think, that if you submit patches, that implement above features, someone will take them and commit :) -- Totus tuus, Glebius.