PCIe Queries#
Functions | |
rsmi_status_t | rsmi_dev_pci_bandwidth_get (uint32_t dv_ind, rsmi_pcie_bandwidth_t *bandwidth) |
Get the list of possible PCIe bandwidths that are available. More... | |
rsmi_status_t | rsmi_dev_pci_id_get (uint32_t dv_ind, uint64_t *bdfid) |
Get the unique PCI device identifier associated for a device. More... | |
rsmi_status_t | rsmi_topo_numa_affinity_get (uint32_t dv_ind, int32_t *numa_node) |
Get the NUMA node associated with a device. More... | |
rsmi_status_t | rsmi_dev_pci_throughput_get (uint32_t dv_ind, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz) |
Get PCIe traffic information. More... | |
rsmi_status_t | rsmi_dev_pci_replay_counter_get (uint32_t dv_ind, uint64_t *counter) |
Get PCIe replay counter. More... | |
Detailed Description
These functions provide information about PCIe.
Function Documentation
◆ rsmi_dev_pci_bandwidth_get()
rsmi_status_t rsmi_dev_pci_bandwidth_get | ( | uint32_t | dv_ind, |
rsmi_pcie_bandwidth_t * | bandwidth | ||
) |
Get the list of possible PCIe bandwidths that are available.
Given a device index dv_ind
and a pointer to a to an rsmi_pcie_bandwidth_t structure bandwidth
, this function will fill in bandwidth
with the possible T/s values and associated number of lanes, and indication of the current selection.
- Parameters
-
[in] dv_ind a device index [in,out] bandwidth a pointer to a caller provided rsmi_pcie_bandwidth_t structure to which the frequency information will be written
- Return values
-
RSMI_STATUS_SUCCESS is returned upon successful call. RSMI_STATUS_UNEXPECTED_DATA Data read or provided was not as expected
◆ rsmi_dev_pci_id_get()
rsmi_status_t rsmi_dev_pci_id_get | ( | uint32_t | dv_ind, |
uint64_t * | bdfid | ||
) |
Get the unique PCI device identifier associated for a device.
Give a device index dv_ind
and a pointer to a uint64_t bdfid
, this function will write the Bus/Device/Function PCI identifier (BDFID) associated with device dv_ind
to the value pointed to by bdfid
.
The format of bdfid
will be as follows:
BDFID = ((DOMAIN & 0xffffffff) << 32) | ((BUS & 0xff) << 8) | ((DEVICE & 0x1f) <<3 ) | (FUNCTION & 0x7)
Name | Field |
---|---|
Domain | [64:32] |
Reserved | [31:16] |
Bus | [15: 8] |
Device | [ 7: 3] |
Function | [ 2: 0] |
- Parameters
-
[in] dv_ind a device index [in,out] bdfid a pointer to uint64_t to which the device bdfid value will be written If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_topo_numa_affinity_get()
rsmi_status_t rsmi_topo_numa_affinity_get | ( | uint32_t | dv_ind, |
int32_t * | numa_node | ||
) |
Get the NUMA node associated with a device.
Given a device index dv_ind
and a pointer to a uint32_t numa_node
, this function will retrieve the NUMA node value associated with device dv_ind
and store the value at location pointed to by numa_node
.
- Parameters
-
[in] dv_ind a device index [in,out] numa_node pointer to location where NUMA node value will be written. If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_dev_pci_throughput_get()
rsmi_status_t rsmi_dev_pci_throughput_get | ( | uint32_t | dv_ind, |
uint64_t * | sent, | ||
uint64_t * | received, | ||
uint64_t * | max_pkt_sz | ||
) |
Get PCIe traffic information.
Give a device index dv_ind
and pointers to a uint64_t's, sent
, received
and max_pkt_sz
, this function will write the number of bytes sent and received in 1 second to sent
and received
, respectively. The maximum possible packet size will be written to max_pkt_sz
.
- Parameters
-
[in] dv_ind a device index [in,out] sent a pointer to uint64_t to which the number of bytes sent will be written in 1 second. If pointer is NULL, it will be ignored. [in,out] received a pointer to uint64_t to which the number of bytes received will be written. If pointer is NULL, it will be ignored. [in,out] max_pkt_sz a pointer to uint64_t to which the maximum packet size will be written. If pointer is NULL, it will be ignored.
- Return values
-
RSMI_STATUS_SUCCESS is returned upon successful call. RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments
◆ rsmi_dev_pci_replay_counter_get()
rsmi_status_t rsmi_dev_pci_replay_counter_get | ( | uint32_t | dv_ind, |
uint64_t * | counter | ||
) |
Get PCIe replay counter.
Given a device index dv_ind
and a pointer to a uint64_t counter
, this function will write the sum of the number of NAK's received by the GPU and the NAK's generated by the GPU to memory pointed to by counter
.
- Parameters
-
[in] dv_ind a device index [in,out] counter a pointer to uint64_t to which the sum of the NAK's received and generated by the GPU is written If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid