• Shiwu Zhang's avatar
    drm/amdgpu: expose the connected port num info through sysfs · 75fb313c
    Shiwu Zhang authored
    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: default avatarShiwu Zhang <shiwu.zhang@amd.com>
    Acked-by: default avatarLijo Lazar <lijo.lazar@amd.com>
    Reviewed-by: default avatarLe Ma <le.ma@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    75fb313c
amdgpu_xgmi.c 42.8 KB