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

Improve VFIO device enumeration performance #3090

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

michael-adler
Copy link
Member

Description

  • Use results of earlier device walks instead of reopening devices.
  • Add a lightweight check for busy devices.

@coveralls
Copy link

coveralls commented Jan 23, 2024

Pull Request Test Coverage Report for Build 7633334986

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.004%) to 64.519%

Totals Coverage Status
Change from base Build 7632342319: -0.004%
Covered Lines: 15802
Relevant Lines: 24492

💛 - Coveralls

- Use results of earlier device walks instead of reopening devices.
- Add a lightweight check for busy devices.

Signed-off-by: Michael Adler <michael.adler@intel.com>
@michael-adler michael-adler self-assigned this Jan 23, 2024
@michael-adler michael-adler marked this pull request as ready for review January 23, 2024 23:53
@michael-adler michael-adler requested a review from a team as a code owner January 23, 2024 23:53
@michael-adler
Copy link
Member Author

@anandaravuri and @pcolberg --

This dramatically improves performance of fpgaEnumerate(), especially on systems with a lot of ports. I tested on a machine with about 20 ports and an AFU with 2 children. Opening the AFU dropped from 12 to 2 seconds.

There are two changes you should check:

  1. Check whether a port is busy by just opening the vfio group instead of going through the whole container setup and initialization.
  2. Discover tokens for a device only once. Once walked, future references to the device use the old token list.

I'm confident about 1. Less so about 2.

@michael-adler michael-adler merged commit 522c4da into OFS:master Jan 24, 2024
19 checks passed
@michael-adler michael-adler deleted the mcadler/vfio_walk_speed branch January 24, 2024 18:09
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