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
F106064611: D20221.diff
Tue, Dec 24, 7:16 PM
Unknown Object (File)
Sat, Dec 21, 11:55 PM
Unknown Object (File)
Thu, Dec 12, 4:42 PM
Unknown Object (File)
Nov 7 2024, 7:06 AM
Unknown Object (File)
Sep 24 2024, 3:08 AM
Unknown Object (File)
Sep 17 2024, 9:30 PM
Unknown Object (File)
Sep 17 2024, 12:45 AM
Unknown Object (File)
Sep 14 2024, 7:33 AM
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.