Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mstconfig: Add support for PCI domain up to 32-bits #926

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/mtcr_ul/mtcr_com_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions mlxconfig/mlxcfg_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand All @@ -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))
{
Expand Down
6 changes: 3 additions & 3 deletions mtcr_ul/mtcr_ul_com.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down