[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
2025-05-30 16:51:11 -05:00
committed by GitHub
コミット 2eff0b3764
7個のファイルの変更147行の追加31行の削除
+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];