Page MenuHomeFreeBSD

iflib: provide probe wrapper for vendor drivers
ClosedPublic

Authored by jacob.e.keller_intel.com on May 10 2019, 12:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 3:28 PM
Unknown Object (File)
Mar 20 2024, 12:41 AM
Unknown Object (File)
Mar 19 2024, 7:47 PM
Unknown Object (File)
Feb 7 2024, 10:09 PM
Unknown Object (File)
Dec 27 2023, 6:20 AM
Unknown Object (File)
Dec 22 2023, 3:49 AM
Unknown Object (File)
Dec 10 2023, 9:47 PM
Unknown Object (File)
Nov 3 2023, 1:13 PM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.

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.