Skip to content

Commit

Permalink
hssi: set sbd properties to enumerate fpga device and set sbdf proper…
Browse files Browse the repository at this point in the history
…ties to enumerate afu (#3103)

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 <[email protected]>
  • Loading branch information
anandaravuri authored Feb 15, 2024
1 parent 195ca07 commit b993ce2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libraries/afu-test/afu_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b993ce2

Please sign in to comment.