Date: Wed, 11 Dec 2013 14:39:16 +0400 From: Anton Yuzhaninov <citrin@citrin.ru> To: svn-src-all@freebsd.org Subject: Re: svn commit: r259150 - head/sys/dev/cxgbe Message-ID: <52A840D4.9020407@citrin.ru> In-Reply-To: <52A76BBE.5030903@FreeBSD.org> References: <201312100007.rBA074Qq055579@svn.freebsd.org> <20131210192650.GK4615@FreeBSD.org> <52A76BBE.5030903@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52A840D4.9020407>