Add rsmi_dev_pci_throughput_get()

This commit is contained in:
Chris Freehill
2019-02-27 15:10:26 -06:00
parent 4771996d99
commit 18ce553dce
7 changed files with 128 additions and 31 deletions
+26
View File
@@ -468,6 +468,32 @@ rsmi_status_t rsmi_dev_pci_bandwidth_set(uint32_t dv_ind, uint64_t bw_bitmask);
*/
rsmi_status_t rsmi_dev_pci_id_get(uint32_t dv_ind, uint64_t *bdfid);
/**
* @brief Get PCIe traffic information
*
* @details Give a device index @p dv_ind and pointers to a uint64_t's, @p
* sent, @p received and @p max_pkt_sz, this function will write the number
* of bytes sent and received in 1 second to @p sent and @p received,
* respectively. The maximum possible packet size will be written to
* @max_pkt_size.
*
* @param[in] dv_ind a device index
*
* @param[inout] 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.
*
* @param[inout] received a pointer to uint64_t to which the number of bytes
* received will be written. If pointer is NULL, it will be ignored.
*
* @param[inout] 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.
*
* @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.
*/
rsmi_status_t rsmi_dev_pci_throughput_get(uint32_t dv_ind, uint64_t *sent,
uint64_t *received, uint64_t *max_pkt_sz);
/**
* @brief Get the device id associated with the device with provided device
* index.
+3 -2
View File
@@ -64,11 +64,12 @@ enum DevInfoTypes {
kDevDevID,
kDevGPUMClk,
kDevGPUSClk,
kDevPCIEBW,
kDevPCIEClk,
kDevPowerProfileMode,
kDevUsage,
kDevPowerODVoltage,
kDevVBiosVer,
kDevPCIEThruPut,
};
class Device {
@@ -85,7 +86,7 @@ class Device {
#if 0 // This is not being used right now.
int readDevInfo(DevInfoTypes type, uint32_t *val);
#endif
int readDevInfoLine(DevInfoTypes type, std::string *line);
int readDevInfo(DevInfoTypes type, std::string *val);
int readDevInfo(DevInfoTypes type, std::vector<std::string> *retVec);
int writeDevInfo(DevInfoTypes type, uint64_t val);