OFS / opae-sdk

Open Programmable Acceleration Engine
https://ofs.github.io
BSD 3-Clause "New" or "Revised" License
251 stars 84 forks source link

[Update] Add improved error message for buffer allocation failure in HE-MEM #3096

Closed a-thompson2 closed 6 months ago

a-thompson2 commented 7 months ago

Description

Addresses this case. When not enough/no hugepages are allocated, the memory host exerciser simply fails similar to the following:

    starting test run, count of 1
API version: 2
AFU clock: 470 MHz
Allocate SRC Buffer
    Test mem(1): FAIL

With this change, it instead fails like so, notifying the user that enough hugepages might not be reserved:

    starting test run, count of 1
API version: 2
AFU clock: 470 MHz
Allocate SRC Buffer
SRC Buffer allocation failed. Please check that hugepages are reserved.
    Test mem(1): FAIL

The implementation specifically catches opae::fpga::types::except as that is what gets thrown from the VFIO plugin's fpgaPrepareBuffer implementation when its internal opae_vfio_buffer_mmap call is unsuccessful (such as when there are no hugepages).

Collateral (docs, reports, design examples, case IDs):

Tests added:

Tests run:

Tested manually on n6001

coveralls commented 7 months ago

Pull Request Test Coverage Report for Build 7846720071


Totals Coverage Status
Change from base Build 7846576248: 0.0%
Covered Lines: 15809
Relevant Lines: 24507

💛 - Coveralls