Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host_exerciser:support no FPGA mgmt PF instances #3108

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

anandaravuri
Copy link
Contributor

Issue: The host exerciser fails to execute on Devkits if it does not support FPGA management PF. The host exerciser enumerates FME and quits the program if the bitstream does not support it.

The I series-DK and F series-DK have multiple host exerciser AFUs on separate PCIe bus, device functions.

fix: If the bitstream does not support FME, perform the host exerciser tests and print message.

host_exerciser --pci-address 0000:03:00.2 lpbk
host_exerciser --pci-address 0000:04:00.2 lpbk

Issue: The host exerciser fails to execute on Devkits if it does not support FPGA management PF.
The host exerciser enumerates FME and quits the program if the bitstream does not support it.

The I series-DK and F series-DK have multiple host exerciser AFUs on separate PCIe bus, device functions.

fix: If the bitstream does not support FME, perform the host exerciser tests and print message.

host_exerciser --pci-address 0000:03:00.2 lpbk
host_exerciser --pci-address 0000:04:00.2 lpbk

opae.io ls
[0000:03:00.0] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.7] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: None)
[0000:04:00.5] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:03:00.7] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.3] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.5] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.1] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.3] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.1] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.6] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: None)
[0000:04:00.4] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.6] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.2] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:03:00.4] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.0] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.2] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)

Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
@coveralls
Copy link

coveralls commented Feb 21, 2024

Pull Request Test Coverage Report for Build 8007037196

Details

  • -6 of 28 (78.57%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 64.688%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/afu-test/afu_test.h 22 28 78.57%
Totals Coverage Status
Change from base Build 7981504925: 0.03%
Covered Lines: 15820
Relevant Lines: 24456

💛 - Coveralls

Copy link
Contributor

@pcolberg pcolberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @anandaravuri! A couple of minor comments below:

}
return exit_codes::not_found;
}
logger_->info("Not found FPGA DEVICE");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger_->info("Not found FPGA DEVICE");
logger_->info("no FPGA DEVICE found");

to be consistent with the message below.


if (tokens.size() > 1) {
std::cerr << "more than one DEVICE found matching filter\n";
std::cout << "more than one FPGA DEVICE found \n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this not use logger_?

int open_handle(const char *afu_id) {

if (!enum_fpga_device()) {
std::cout << "Not Found FME device\n";
Copy link
Contributor

@pcolberg pcolberg Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will output another error message, which enum_fpga_device() already does. Why is that needed?

// strange and perhaps unnecessary limitation. Therefore, future work is to
// fix that and clean up the code below.

if (token_device_) {
Copy link
Contributor

@pcolberg pcolberg Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (token_device_) {
if (!token_device_)
return;

to avoid one level of indentation below. As a rule of thumb, the happy path of a function should visually flow vertically, early exits horizontally; which makes it easier to reason what the main purpose of a function is (beyond the documentation).

Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Copy link
Contributor

@pcolberg pcolberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @anandaravuri!

@anandaravuri anandaravuri merged commit dfabc03 into master Feb 22, 2024
27 checks passed
@anandaravuri anandaravuri deleted the aravuri/fix_he_fme branch February 22, 2024 16:50
anandaravuri added a commit that referenced this pull request Feb 23, 2024
* host_exerciser:support no FPGA mgmt PF instances

Issue: The host exerciser fails to execute on Devkits if it does not support FPGA management PF.
The host exerciser enumerates FME and quits the program if the bitstream does not support it.

The I series-DK and F series-DK have multiple host exerciser AFUs on separate PCIe bus, device functions.

fix: If the bitstream does not support FME, perform the host exerciser tests and print message.

host_exerciser --pci-address 0000:03:00.2 lpbk
host_exerciser --pci-address 0000:04:00.2 lpbk

opae.io ls
[0000:03:00.0] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.7] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: None)
[0000:04:00.5] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:03:00.7] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.3] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.5] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.1] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.3] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.1] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.6] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: None)
[0000:04:00.4] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.6] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.2] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:03:00.4] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.0] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.2] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)

--------

Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Co-authored-by: Peter Colberg <peter.colberg@intel.com>
anandaravuri added a commit that referenced this pull request Feb 26, 2024
* host_exerciser:support no FPGA mgmt PF instances

Issue: The host exerciser fails to execute on Devkits if it does not support FPGA management PF.
The host exerciser enumerates FME and quits the program if the bitstream does not support it.

The I series-DK and F series-DK have multiple host exerciser AFUs on separate PCIe bus, device functions.

fix: If the bitstream does not support FME, perform the host exerciser tests and print message.

host_exerciser --pci-address 0000:03:00.2 lpbk
host_exerciser --pci-address 0000:04:00.2 lpbk

opae.io ls
[0000:03:00.0] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.7] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: None)
[0000:04:00.5] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:03:00.7] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.3] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.5] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.1] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.3] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.1] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.6] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: None)
[0000:04:00.4] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.6] (0x8086:0xbccf 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:04:00.2] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)
[0000:03:00.4] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:04:00.0] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: dfl-pci)
[0000:03:00.2] (0x8086:0xbcce 0x8086:0x1771) Intel Acceleration Development Platform N6001 (Driver: vfio-pci)

--------

Signed-off-by: anandaravuri <ananda.ravuri@intel.com>
Co-authored-by: Peter Colberg <peter.colberg@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants