[SWDEV-530633] Use gpu_metric speed and BW for xgmi (#366)

The xgmi command was showing pcie bit rate and bandwidth instead of xgmi. Corrected the API to get xgmi data from gpu metric.
Added python API for amdsmi_get_link_metrics. Modified the amdsmi_link_metrics struct.
Added check to confirm non zero partition got xgmi command.

---------

Signed-off-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com>
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Этот коммит содержится в:
Kanangot Balakrishnan, Bindhiya authored and GitHub committed 2025-05-30 16:51:11 -05:00
1 родитель 2e8aaf02c9
Коммит 2eff0b3764
7 files changed
+147 -31

No files matched your search

+7 -7
Просмотреть файл
@@ -967,14 +967,14 @@ typedef struct {
* @cond @tag{gpu_bm_linux} @endcond
*/
typedef struct {
uint32_t num_links; //!< number of links
uint32_t num_links; //!< number of links
uint32_t bit_rate; //!< current link speed in Gb/s
uint32_t max_bandwidth; //!< max bandwidth of the link in Gb/s
struct _links {
amdsmi_bdf_t bdf;
uint32_t bit_rate; //!< current link speed in Gb/s
uint32_t max_bandwidth; //!< max bandwidth of the link in Gb/s
amdsmi_link_type_t link_type; //!< type of the link
uint64_t read; //!< total data received for each link in KB
uint64_t write; //!< total data transfered for each link in KB
amdsmi_bdf_t bdf; //!< bdf of the destination gpu
amdsmi_link_type_t link_type; //!< type of the link
uint64_t read; //!< total data received for each link in KB
uint64_t write; //!< total data transfered for each link in KB
uint64_t reserved[2];
} links[AMDSMI_MAX_NUM_XGMI_PHYSICAL_LINK];
uint64_t reserved[7];