Page MenuHomeFreeBSD

newbus: Create a preferred list of drivers
Needs ReviewPublic

Authored by imp on Feb 23 2022, 11:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 12 2024, 11:29 PM
Unknown Object (File)
Jan 10 2024, 7:09 AM
Unknown Object (File)
Dec 24 2023, 2:56 PM
Unknown Object (File)
Dec 20 2023, 3:44 AM
Unknown Object (File)
Nov 22 2023, 11:18 AM
Unknown Object (File)
Sep 21 2023, 4:28 PM
Unknown Object (File)
Sep 3 2023, 7:00 PM
Subscribers

Details

Reviewers
jhb
Summary

When there is a tie for priority for a device, and the new driver is on
the preferred list, prefer it to the other driver. It's undefined what
happens if multiple drivers on the preferred list can claim a device.

Sponsored by: Netflix

Test Plan

Note: this needs a man page adjusted, but I'm at a loss for which one

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44612
Build 41500: arc lint + arc unit

Event Timeline

imp requested review of this revision.Feb 23 2022, 11:01 PM
imp created this revision.
imp added a reviewer: jhb.
imp added inline comments.
sys/kern/subr_bus.c
380

I should likely not delete this line... I'll fix locally, but not update the review unless other changes are needed since it's so trivial.

I guess this is ok (my only worry is we have to do something else in the future and have to maintain backwards compat for this and the other). It needs to be documented in some foo(4) manpage though?

sys/kern/subr_bus.c
264

I feel like using strsep would be slightly shorter as it would do the null terminate for you? I think there's even an example in the strsep() manpage that is kind of like this, something like:

memcpy(walk2, buffer, len);
for (int i = 0; i < npref; i++)
     preferred_drivers[i] = strsep(&walk2, ",");
2166

s/device/driver/? ("nvme" is a driver name, "nvme0" is a device name)

In D34357#778242, @jhb wrote:

I guess this is ok (my only worry is we have to do something else in the future and have to maintain backwards compat for this and the other). It needs to be documented in some foo(4) manpage though?

which one though?

sys/kern/subr_bus.c
2166

sure.