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 { diff --git a/python/opae.admin/opae/admin/utils/progress.py b/python/opae.admin/opae/admin/utils/progress.py index 4f5ef33d45d6..5c6b5bfecd9d 100644 --- a/python/opae.admin/opae/admin/utils/progress.py +++ b/python/opae.admin/opae/admin/utils/progress.py @@ -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)