Users of Intel discrete graphics adapters are confused with fake
information on PCIe link bandwidth (speed and size) of their GPU devices
reported by tools like lspci or lsgpu. That fake information is
unfortunately provided by hardware, Linux PCI subsystem just exposes it
untouched to upper layers, including userspace via sysfs, and userspace
tools just report those fake values.
While we can't do much about the kernel side or general purpose userspace
tools like lspci, we can try to address the issue with our lsgpu utility.
Correct link bandwidth attributes of a discrete GPU card can be obtained
from the kernel by looking not at the PCI device of the GPU itself, only
at a PCIe upstream port of the card's PCI bridge. For integrity with
content of the sysfs and with output from the other tools, we are not
going to replace the fake information with that from the bridge upstream
port, only show that port and its attributes themselves while listing
devices.
Since the tool uses our udev based igt_device_scan library for identifying
GPU devices and printing their properties and attributes, modifications
that we need apply to that library.
v2: Keep dump_props_and_attrs() generic: hand over decision on omitting
link attributes to the caller, and implementation of the check to a
helper (Sebastian),
- drop unclear GET_REG_MASK macro (Sebastian),
- reuse no longer needed variable containing PCI_HEADER_TYPE for storing
PCI_EXP_FLAGS_TYPE,
- maintain a single instance of struct pci_access throughout processing
of the whole udev device list (Sebastian),
- hand over detection of AER attributes to a helper,
- merge a formerly separate patch "lib/igt_device_scan: Don't print
bridge not applicable attributes" into "lib/igt_device_scan: Print GPU
upstream port parent/child relations" (Sebastian),
- allocate memory to local attributes of a bridge for safety (Sebastian),
- no need for DEVTYPE_BRIDGE, just skip attributes if NULL.
Cc: Sebastian Brzezinka <[email protected]>
Janusz Krzysztofik (6):
lib/igt_device_scan: Don't print fake link bandwidth attributes
lib/igt_device_scan: Split out reusable part of update_or_add_parent
lib/igt_device_scan: Include PCIe bridge upstream port if available
lib/igt_device_scan: List PCIe bridge ports after their children
lib/igt_device_scan: Omit AER statistics data from attributes
lib/igt_device_scan: Print GPU upstream port parent/child relations
lib/igt_device_scan.c | 199 +++++++++++++++++++++++++++++++++++-------
lib/meson.build | 2 +
meson.build | 1 +
3 files changed, 170 insertions(+), 32 deletions(-)
--
2.52.0