OFS / opae-sdk

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

Improve VFIO device enumeration performance #3090

Closed michael-adler closed 7 months ago

michael-adler commented 7 months ago

Description

coveralls commented 7 months ago

Pull Request Test Coverage Report for Build 7633334986


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

💛 - Coveralls
michael-adler commented 7 months ago

@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.