svn commit: r259150 - head/sys/dev/cxgbe
Anton Yuzhaninov
citrin at citrin.ru
Wed Dec 11 10:39:18 UTC 2013
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.
More information about the svn-src-all
mailing list