Unify the amdsmi_get_pcie_info python interface

Make the python interface consistent with the C interface.

Change-Id: Idda08f888947c757e475d5a024b0ec3d8e1d846a
이 커밋은 다음에 포함됨:
Bill(Shuzhou) Liu 작성하고 Maisam Arif가 2024-02-22 03:33:59 -05:00를 커밋함
1 부모 f58613561c
커밋 db33cda0c1
7 파일이 변경됨
+36 -22

검색과 일치하는 파일 없음

+2 -2
파일 보기
@@ -1964,7 +1964,7 @@ amdsmi_status_t amdsmi_get_pcie_info(amdsmi_processor_handle processor_handle, a
printf("Failed to open file: %s \n", path_max_link_width.c_str());
return AMDSMI_STATUS_API_FAILED;
}
info->pcie_static.max_pcie_lanes = (uint16_t)pcie_width;
info->pcie_static.max_pcie_width = (uint16_t)pcie_width;
std::string path_max_link_speed = "/sys/class/drm/" +
gpu_device->get_gpu_path() + "/device/max_link_speed";
@@ -2028,7 +2028,7 @@ amdsmi_status_t amdsmi_get_pcie_info(amdsmi_processor_handle processor_handle, a
if (status != AMDSMI_STATUS_SUCCESS)
return status;
info->pcie_metric.pcie_lanes = metric_info.pcie_link_width;
info->pcie_metric.pcie_width = metric_info.pcie_link_width;
// gpu metrics is inconsistent with pcie_speed values, if 0-6 then it needs to be translated
if (metric_info.pcie_link_speed <= 6) {
status = smi_amdgpu_get_pcie_speed_from_pcie_type(metric_info.pcie_link_speed, &info->pcie_metric.pcie_speed); // mapping to MT/s