Skip to content

Commit

Permalink
Merge branch 'master' into aravuri/fxi_opae.io
Browse files Browse the repository at this point in the history
  • Loading branch information
anandaravuri authored Feb 15, 2024
2 parents 70d644b + b993ce2 commit f86be10
Show file tree
Hide file tree
Showing 2 changed files with 9 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
2 changes: 2 additions & 0 deletions python/opae.admin/opae/admin/utils/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def _update_percent(self, pct, ratio=None):
function, otherwise, None.
"""
percent = int(pct*100)
if percent > 100:
percent = 100
num_bars = int(pct*self._total_bars)
bars = self.BAR*num_bars
spaces = ' '*(self._total_bars - num_bars)
Expand Down

0 comments on commit f86be10

Please sign in to comment.