Numa affinity shows large number

Change the affinity from unsigned int to integer to represent -1.

Change-Id: I82dc6f476b45fa4ec03a3c686fe8e6e2b7761b56
This commit is contained in:
Bill(Shuzhou) Liu
2023-08-24 13:08:47 -05:00
committed by Shuzhou Liu
parent 3602447109
commit 471fbfddc1
5 changed files with 11 additions and 9 deletions
+4 -3
View File
@@ -756,7 +756,7 @@ rsmi_dev_pci_id_get(uint32_t dv_ind, uint64_t *bdfid) {
}
rsmi_status_t
rsmi_topo_numa_affinity_get(uint32_t dv_ind, uint32_t *numa_node) {
rsmi_topo_numa_affinity_get(uint32_t dv_ind, int32_t *numa_node) {
TRY
rsmi_status_t ret;
uint64_t val = 0;
@@ -764,9 +764,10 @@ rsmi_topo_numa_affinity_get(uint32_t dv_ind, uint32_t *numa_node) {
CHK_SUPPORT_NAME_ONLY(numa_node)
DEVICE_MUTEX
ret = get_dev_value_int(amd::smi::kDevNumaNode, dv_ind, &val);
std::string str_val;
ret = get_dev_value_str(amd::smi::kDevNumaNode, dv_ind, &str_val);
*numa_node = std::stol(str_val, 0);
*numa_node = static_cast<uint32_t>(val);
return ret;
CATCH
}
+1 -1
View File
@@ -928,7 +928,6 @@ int Device::readDevInfo(DevInfoTypes type, uint64_t *val) {
case kDevDFCountersAvailable:
case kDevMemBusyPercent:
case kDevXGMIError:
case kDevNumaNode:
ret = readDevInfoStr(type, &tempStr);
RET_IF_NONZERO(ret);
if (tempStr == "") {
@@ -1046,6 +1045,7 @@ int Device::readDevInfo(DevInfoTypes type, std::string *val) {
case kDevAvailableComputePartition:
case kDevComputePartition:
case kDevMemoryPartition:
case kDevNumaNode:
return readDevInfoStr(type, val);
break;