2
0

Make bdfid use 32 bit domain if possible

If the 32-bit domain is found in the kfd node properties for
a device, then it will be used when constructing the bdfid.
If it's not present, it will continue to use the 16 bit version.

Also, whether or not 32b or 16b are used for the domain, the
domain will now be placed in the upper 32b of the 64b bdfid.

* Fixed some unrelated doxygen issues

Change-Id: Icb5116daa1ab45ee305bdbe6cd5df5736dd3ffa3
Este cometimento está contido em:
Chris Freehill
2019-08-25 19:31:46 -05:00
ascendente 01e0800741
cometimento 469af303d6
7 ficheiros modificados com 253 adições e 15 eliminações
+17 -4
Ver ficheiro
@@ -328,7 +328,7 @@ typedef enum {
/**
* @brief Pre-set Profile Selections. These bitmasks can be AND'd with the
* ::rsmi_power_profile_status_t.available_profiles returned from
* ::rsmi_dev_power_profile_presets_get() to determine which power profiles
* ::rsmi_dev_power_profile_presets_get to determine which power profiles
* are supported by the system.
*/
typedef enum {
@@ -996,6 +996,19 @@ rsmi_dev_pci_bandwidth_get(uint32_t dv_ind, rsmi_pcie_bandwidth_t *bandwidth);
* (BDFID) associated with device @p dv_ind to the value pointed to by
* @p bdfid.
*
* The format of @p 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] |
*
* @param[in] dv_ind a device index
*
* @param[inout] bdfid a pointer to uint64_t to which the device bdfid value
@@ -1851,9 +1864,9 @@ rsmi_dev_firmware_version_get(uint32_t dv_ind, rsmi_fw_block_t block,
*
* @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.
*
* ::RSMI_NOT_SUPPORTED will be returned if either ECC is not enabled for the
* specified block @p block, or if there is no kernel support for ECC for
* that block.
* ::RSMI_STATUS_NOT_SUPPORTED will be returned if either ECC is not enabled
* for the specified block @p block, or if there is no kernel support for ECC
* for that block.
*
*/
rsmi_status_t rsmi_dev_ecc_count_get(uint32_t dv_ind,
+37 -1
Ver ficheiro
@@ -51,6 +51,7 @@
#include <cstdint>
#include <vector>
#include <unordered_set>
#include <map>
#include "rocm_smi/rocm_smi_monitor.h"
#include "rocm_smi/rocm_smi_power_mon.h"
@@ -64,6 +65,38 @@ extern "C" {
namespace amd {
namespace smi {
enum DevKFDNodePropTypes {
kDevKFDNodePropCachesCnt,
kDevKFDNodePropIoLinksCnt,
kDevKFDNodePropCPUCoreIdBase,
kDevKFDNodePropSimdIdBase,
kDevKFDNodePropMaxWavePerSimd,
kDevKFDNodePropLdsSz,
kDevKFDNodePropGdsSz,
kDevKFDNodePropNumGWS,
kDevKFDNodePropWaveFrontSize,
kDevKFDNodePropArrCnt,
kDevKFDNodePropSimdArrPerEng,
kDevKFDNodePropCuPerSimdArr,
kDevKFDNodePropSimdPerCU,
kDevKFDNodePropMaxSlotsScratchCu,
kDevKFDNodePropVendorId,
kDevKFDNodePropDeviceId,
kDevKFDNodePropLocationId,
kDevKFDNodePropDrmRenderMinor,
kDevKFDNodePropHiveId,
kDevKFDNodePropNumSdmaEngines,
kDevKFDNodePropNumSdmaXgmiEngs,
kDevKFDNodePropMaxEngClkFComp,
kDevKFDNodePropLocMemSz,
kDevKFDNodePropFwVer,
kDevKFDNodePropCapability,
kDevKFDNodePropDbgProp,
kDevKFDNodePropSdmaFwVer,
kDevKFDNodePropMaxEngClkCComp,
kDevKFDNodePropDomain,
};
enum DevInfoTypes {
kDevPerfLevel,
kDevOverDriveLevel,
@@ -139,6 +172,9 @@ class Device {
int readDevInfo(DevInfoTypes type, std::vector<std::string> *retVec);
int writeDevInfo(DevInfoTypes type, uint64_t val);
int writeDevInfo(DevInfoTypes type, std::string val);
int populateKFDNodeProperties(bool force_update = false);
int getKFDNodeProperty(DevKFDNodePropTypes prop, uint64_t *val);
uint32_t index(void) const {return index_;}
void set_index(uint32_t index) {index_ = index;}
uint32_t drm_render_minor(void) const {return drm_render_minor_;}
@@ -146,7 +182,6 @@ class Device {
static rsmi_dev_perf_level perfLvlStrToEnum(std::string s);
uint64_t bdfid(void) const {return bdfid_;}
void set_bdfid(uint64_t val) {bdfid_ = val;}
uint64_t get_bdfid(void) const {return bdfid_;}
pthread_mutex_t *mutex(void) {return mutex_.ptr;}
evt::dev_evt_grp_set_t* supported_event_groups(void) {
return &supported_event_groups_;}
@@ -169,6 +204,7 @@ class Device {
uint64_t bdfid_;
std::unordered_set<rsmi_event_group_t,
evt::RSMIEventGrpHashFunction> supported_event_groups_;
std::map<std::string, uint64_t> kfdNodePropMap_;
};
} // namespace smi
+6
Ver ficheiro
@@ -43,6 +43,9 @@
#ifndef INCLUDE_ROCM_SMI_ROCM_SMI_KFD_H_
#define INCLUDE_ROCM_SMI_ROCM_SMI_KFD_H_
#include <string>
#include <vector>
#include "rocm_smi/rocm_smi.h"
namespace amd {
@@ -54,6 +57,9 @@ GetProcessInfo(rsmi_process_info_t *procs, uint32_t num_allocated,
int
GetProcessInfoForPID(uint32_t pid, rsmi_process_info_t *proc);
int
ReadKFDDeviceProperties(uint32_t dev_id, std::vector<std::string> *retVec);
} // namespace smi
} // namespace amd