https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290259

            Bug ID: 290259
           Summary: nvme: need an ioctl to get serial number
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: [email protected]
          Reporter: [email protected]

The standard way to get a disk's serial number is with the DIOCGIDENT ioctl. 
However, /dev/nvmeX devices don't support that, probably because they aren't
technically disks.  An NVME device's corresponding nda driver _does_.  However,
it may be difficult to determine which nda device corresponds to a given nvme
device, if NVME namespaces are in use.

Within the kernel, the nvme driver already knows its serial number.  It's
recorded in nvme_controller_data.sn .  But it simply isn't exposed to user
space.

I propose that we implement DIOCGIDENT on nvme devices.  Or, if that name is
objectionable we could use NVME_IOCTL_SERIAL or NVME_IOCTL_IDENT.  This would
allow a user to lookup an NVME device's serial number without first translating
the nvme device node into an nda device node.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to