Page MenuHomeFreeBSD

iflib: provide probe wrapper for vendor drivers
ClosedPublic

Authored by jacob.e.keller_intel.com on May 10 2019, 12:15 AM.

Details

Summary

Vendor drivers that exist out-of-tree generally should return
BUS_PROBE_VENDOR from their device probe functions. This helps ensure
that a vendor replacement driver will supersede the in-kernel driver for
a given device.

Currently, if a vendor wants to implement a driver based on iflib, it
will always report BUS_PROBE_DEFAULT.

Add a wrapper function, iflib_device_probe_vendor() which can be used in
place of iflib_device_probe(). This function will just return
BUS_PROBE_VENDOR whenever iflib_device_probe() would return
BUS_PROBE_DEFAULT.

While vendor drivers can already implement such a wrapper themselves,
providing it in the iflib.h header makes it easier for the vendor driver
to do the right thing.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Harbormaster completed remote builds in B24181: Diff 57243.

We discovered this as part of our rename from ixlv to iavf.

I also considered the approach of adding a new field to the if_shared_ctx. However, this solution seemed more elegant, and is easier for us to implement as a compatibility in our driver code if it's not in the kernel yet.

We *could* just implement this oureslves, but it seemed like something that might be useful to have in the upstream, so that vendor drivers based on iflib are more likely to do the right thing.

gallatin accepted this revision as: gallatin.May 10 2019, 12:20 PM
erj accepted this revision as: erj.May 10 2019, 5:11 PM
marius accepted this revision.May 22 2019, 5:55 PM
marius added a subscriber: marius.

Looks good to me

This revision is now accepted and ready to land.May 22 2019, 5:55 PM
This revision was automatically updated to reflect the committed changes.