HomeFreeBSD

cam_periph: Add ability to wire units to a serial number

Description

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

Details

Provenance
impAuthored on Nov 5 2021, 2:56 PM
Differential Revision
D32683: cam_periph: Add ability to wire units to a serial number
Parents
rG710a519ebbe3: cam_periph: fix bug in camperiphunitnext logic
Branches
Unknown
Tags
Unknown