]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cam_periph: Add ability to wire units to a serial number
authorWarner Losh <imp@FreeBSD.org>
Fri, 5 Nov 2021 14:56:33 +0000 (08:56 -0600)
committerWarner Losh <imp@FreeBSD.org>
Fri, 5 Nov 2021 14:56:33 +0000 (08:56 -0600)
commit577f9aa266e3407a2de9d6bd6d836a9ba984e944
treeb040a538d8576ed18fa9e96fd271cdd98098705a
parent710a519ebbe34850ee37e688896a761606be5009
cam_periph: Add ability to wire units to a serial number

For scsi, ata and nvme, at least, we read a serial number from the
device (if the device supports it, some scsi drives do not) and record
it during the *_xpt probe device state machine before it posts the
AC_FOUND_DEVICE async event. For mmc, no serial number is ever
retrieved, so it's always NULL. Add the ability to match this serial
number during device wiring.

This mechanism is competely optional, and often times using a label
and/or some other attribute of the device is easier. However, other
times wiring a unit to a serial number simplifies management as most
monitoring tools require the *daX device and having it stable from boot
to boot helps with data continuity. It can be especially helpful for
nvme where no other means exists to reliably tie a ndaX device to an
underlying nvme drive and namespace.

A similar mechanism exists in Linux to mange device unit numbers with
udev.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32683
sys/cam/cam_periph.c