Subject: Re: port bio(4) and bioctl(8) from openbsd ?
To: Bill Stouder-Studenmund <wrstuden@netbsd.org>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 04/08/2007 00:39:13
> On Sat, Apr 07, 2007 at 07:07:19PM +0200, Manuel Bouyer wrote:
>> Hi,
>> do we want to port the bio(4) interface and associated bioctl(8) tool
>> from openbsd ? Basically it allows control of hardware RAID controllers
>> in a
>> generic way (get states, add hot-spare, start rebuilds, etc ...).
>> On OpenBSD it's currently supported on ami(4), arc(4), ciss(4), mfi(4).
>> I won't go into the softraid stuff, at last not yet.
>> Man pages:
>> http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sbin/bioctl/bioctl.8?rev=1.43&content-type=text/plain
>> http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/share/man/man4/bio.4?rev=1.19&content-type=text/plain
>>
>> In kernel, there's a pseudo-device (bio) to which RAID controllers
>> registers
>> (note that we can use the controllers without bio(4) in the kernel).
>> This pseudo-device keeps a list of raid controllers, and dispatch the
>> IOCTLs. This avoids having one major device per controller driver type.
>
> I like the idea. My concern is that we already have the ld driver
> framework for the devices on RAID cards and this would be a separate
> framework for the cards. Is there some way we could harmonize all of it? I
> agree that ld devices alone aren't what you want for this as you have to
> be able to go from having no ld's on a card to having an ld.

A bit off topic, but in the longer run it would be good to simplify the
disk drivers using something like the ld hack. Hopefully the wedges stuff
will lend itself to that. To some extent the same probably goes for the
tty drivers.

>> OpenBSD has added sensors for the drives: SENSOR_DRIVE, with the states:
>> #define SENSOR_DRIVE_EMPTY    1
>> #define SENSOR_DRIVE_READY    2
>> #define SENSOR_DRIVE_POWERUP  3
>> #define SENSOR_DRIVE_ONLINE   4
>> #define SENSOR_DRIVE_IDLE     5
>> #define SENSOR_DRIVE_ACTIVE   6
>> #define SENSOR_DRIVE_REBUILD  7
>> #define SENSOR_DRIVE_POWERDOWN        8
>> #define SENSOR_DRIVE_FAIL     9
>> #define SENSOR_DRIVE_PFAIL    10
>> The benefit of this is that we could get notification in real time
>> instead of polling though bioctl.

I'm a bit concerned about what it lets you do and what it replaces but
I need to do my research :-). In the two instances where we do have
pretty good native tools (for DPT/Adaptec controllers) I'd be a bit
reluctant to see the capability go. In the interests of security it
I think does make sense though.

Andrew