OSDN Git Service

drm/amdgpu: expose num_hops and num_links xgmi info through dev attr
authorShiwu Zhang <shiwu.zhang@amd.com>
Wed, 7 Jun 2023 09:14:08 +0000 (17:14 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Jun 2023 14:43:31 +0000 (10:43 -0400)
commit8d8ffe3740b6de4a8a84817cd85195c533ed52b9
tree5e457299e73b764ec7a5105f47448f67fe30df81
parent188d3f80fc6d8451ab5e570becd6a7b2d3033023
drm/amdgpu: expose num_hops and num_links xgmi info through dev attr

Add these two dev attrs for xgmi info details which is helpful for
developers checking the xgmi topology by catting the sys file directly.

Take 4 cards with xgmi connection as an example, get the num_hops for each
device or node through xmig_hive_info dir like,
cat /sys/bus/pci/devices/0000:41:00.0/xgmi_hive_info/node1/num_hops
will return "00 41 41 41" where "00" stands for the hops to node1 itself
and "41" is the hops in hex format to every other node in the same hive.
There are node1/node2/node3/node4 representing 4 cards in the hive.

The same for num_links dev attr.

Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com>
Acked-by: Le Ma <le.ma@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c