]> www.infradead.org Git - nvme.git/commit
drm/amdgpu: expose the connected port num info through sysfs
authorShiwu Zhang <shiwu.zhang@amd.com>
Tue, 31 Oct 2023 04:32:54 +0000 (12:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Nov 2023 14:30:51 +0000 (09:30 -0500)
commit75fb313c55fa102f973c440f55dc63ffc61f3b54
tree3d7b6424a8d9b1da1a9260f09664ae507a23ef22
parent59e4db5375f587954eb779ac9c7888a6c81c306b
drm/amdgpu: expose the connected port num info through sysfs

By catting the xgmi_port_num sysfs node, it prints out the info in the
format of <src node id>:<src port num> -> <dst node id>:<dst port num>
for one xgmi link.

For example, in case of 4 sockets fully and evenly connected setup, it
would be like as below for the first node in the hive.
01:02 -> 02:03
01:03 -> 02:02
01:07 -> 03:04
01:04 -> 03:07
01:06 -> 04:05
01:05 -> 04:06
Based on the fact that there is two xgmi links between each socket pair,
"01:02 -> 02:03" means that the current socket in question use the port 2
to connect with port 3 of the second node in the hive and so on.

v2: print out the src/dst node id for each xgmi link (lijo)
v3: replace the current_node++ with +1 to align with dst node (le)
    and use the dev_err instead of pr_err (lijo)
v4: fix checkpatch warning (alex)

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