From b993ce20aa673041d959eb2de831999a0da68721 Mon Sep 17 00:00:00 2001 From: Ananda Ravuri <33236856+anandaravuri@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:25:26 -0800 Subject: [PATCH] hssi: set sbd properties to enumerate fpga device and set sbdf properties to enumerate afu (#3103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set PCIe segment, bus, and device properties to enumerate FPGA DEVICE (FME) Set PCIe segment, bus, device, and function properties to enumerate FPGA ACCELERATOR hssi hssi_10g works fine, hssi—pci-address b1:00.6 hssi_10g fails if the user provides pci-address cmd args due to PR change. #3094 Set the HSSI/VF PCIe segment, bus, device, and function attributes to try to enumerate FPGA DEVICE (FME) triggers failure, to enumerate FPGA DEVICE set seegment, bus, device attributes to OPAE filter. Signed-off-by: anandaravuri --- libraries/afu-test/afu_test.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 {