[SWDEV-519061] xgmi command output shows zero for all xgmi acc read/write data in the first column (#392)

The xgmi read and write accumulated data from gpu metric index
is based on sysfs xgmi_port_num file. Mapped these two to display
read and write wrt src_gpu Vs dst_gpu.
---------

Signed-off-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com>
This commit is contained in:
Kanangot Balakrishnan, Bindhiya
2025-06-02 14:01:06 -05:00
committed by GitHub
szülő bf0448ff96
commit 8ed52616ad
7 fájl változott, egészen pontosan 161 új sor hozzáadva és 57 régi sor törölve
+2 -6
Fájl megtekintése
@@ -3112,22 +3112,18 @@ def amdsmi_get_link_metrics(processor_handle: amdsmi_wrapper.amdsmi_processor_ha
)
)
bdf = amdsmi_wrapper.amdsmi_bdf_t()
# TODO: Dummy BDF - to be replaced with destination BDF from xgmi_port_num when available
bdf.struct_amdsmi_bdf_t = amdsmi_wrapper.struct_amdsmi_bdf_t(0xFFFF, 0xFF, 0xFF, 0xF)
links = []
for i in range(AMDSMI_MAX_NUM_XGMI_LINKS):
link = link_metrics.links[i]
links.append({
"bdf": _format_bdf(bdf),
"bdf": _format_bdf(link.bdf),
"link_type": link.link_type,
"read": link.read,
"write": link.write,
})
return {
"num_links": AMDSMI_MAX_NUM_XGMI_LINKS,
"num_links": link_metrics.num_links,
"bit_rate": link_metrics.bit_rate,
"max_bandwidth": link_metrics.max_bandwidth,
"links": links