diff --git a/libraries/afu-test/afu_test.h b/libraries/afu-test/afu_test.h index e063b61ad38a..1c6e7875f3a0 100644 --- a/libraries/afu-test/afu_test.h +++ b/libraries/afu-test/afu_test.h @@ -204,13 +204,12 @@ class afu { // This is to allow access to OPAE-API functions that are only supported // through the xfpga plugin (i.e accessing sysfs entries) // In contrast, the ACCELERATOR token may be underlied by the vfio plugin. - + // Set PCIe segment, bus, and device properties to enumerate FPGA DEVICE (FME) if (!pci_addr_.empty()) { auto p = pcie_address::parse(pci_addr_.c_str()); filter->segment = p.fields.domain; filter->bus = p.fields.bus; filter->device = p.fields.device; - filter->function = p.fields.function; } filter->type = FPGA_DEVICE; @@ -242,7 +241,12 @@ class afu { // The following code attempts to get a token + handle for the AFU // (ACCELERATOR device) matching the given command's afu_id. - // We reuse the PCIe SBDF addressing from above. + // Set PCIe segment, bus, device, and functionproperties to enumerate FPGA ACCELERATOR + if (!pci_addr_.empty()) { + auto p = pcie_address::parse(pci_addr_.c_str()); + filter->function = p.fields.function; + } + auto app_afu_id = afu_id ? afu_id : afu_id_.c_str(); filter->type = FPGA_ACCELERATOR; try {