diff --git a/include/mtcr_ul/mtcr_com_defs.h b/include/mtcr_ul/mtcr_com_defs.h index 6c147d84..7b4020bf 100644 --- a/include/mtcr_ul/mtcr_com_defs.h +++ b/include/mtcr_ul/mtcr_com_defs.h @@ -335,7 +335,7 @@ typedef enum typedef struct vf_info_t { char dev_name[512]; - u_int16_t domain; + u_int32_t domain; u_int8_t bus; u_int8_t dev; u_int8_t func; @@ -353,7 +353,7 @@ typedef struct dev_info_t { struct { - u_int16_t domain; + u_int32_t domain; u_int8_t bus; u_int8_t dev; u_int8_t func; diff --git a/mlxconfig/mlxcfg_ui.cpp b/mlxconfig/mlxcfg_ui.cpp index 15af7240..955ec11a 100644 --- a/mlxconfig/mlxcfg_ui.cpp +++ b/mlxconfig/mlxcfg_ui.cpp @@ -257,9 +257,9 @@ mlxCfgStatus MlxCfg::queryDevsCfg() mdevices_info_destroy(dev, numOfDev); return err(true, NO_DEV_ERR); } - // printf("-D- num of dev: %d , 1st dev : %s\n", numOfDev, buf); + // printf("-D- num of dev: %d , 1st dev : %s\n", numOfDev, dev->dev_name); dev_info* devPtr = dev; - char pcibuf[32] = {0}; + char pcibuf[64] = {0}; for (int i = 0; i < numOfDev; i++) { @@ -268,7 +268,7 @@ mlxCfgStatus MlxCfg::queryDevsCfg() #else const char* device_name_ptrn = "%04x:%02x:%02x.%x"; #endif - snprintf(pcibuf, 32, device_name_ptrn, devPtr->pci.domain, devPtr->pci.bus, devPtr->pci.dev, + snprintf(pcibuf, 64, device_name_ptrn, devPtr->pci.domain, devPtr->pci.bus, devPtr->pci.dev, devPtr->pci.func); if (queryDevCfg(devPtr->pci.conf_dev, pcibuf, i + 1)) { diff --git a/mtcr_ul/mtcr_ul_com.c b/mtcr_ul/mtcr_ul_com.c index bc0c0d7e..e43bbac5 100644 --- a/mtcr_ul/mtcr_ul_com.c +++ b/mtcr_ul/mtcr_ul_com.c @@ -203,11 +203,11 @@ static int _extract_dbdf_from_full_name(const char* name, unsigned * dev, unsigned * func) { - if (sscanf(name, "/sys/bus/pci/devices/%4x:%2x:%2x.%d/resource0", domain, bus, dev, func) == 4) { + if (sscanf(name, "/sys/bus/pci/devices/%x:%2x:%2x.%d/resource0", domain, bus, dev, func) == 4) { return 0; - } else if (sscanf(name, "/sys/bus/pci/devices/%4x:%2x:%2x.%d/config", domain, bus, dev, func) == 4) { + } else if (sscanf(name, "/sys/bus/pci/devices/%x:%2x:%2x.%d/config", domain, bus, dev, func) == 4) { return 0; - } else if (sscanf(name, "/proc/bus/pci/%4x:%2x/%2x.%d", domain, bus, dev, func) == 4) { + } else if (sscanf(name, "/proc/bus/pci/%x:%2x/%2x.%d", domain, bus, dev, func) == 4) { return 0; } else if (sscanf(name, "/proc/bus/pci/%2x/%2x.%d", bus, dev, func) == 3) { *domain = 0;