Feature #14294
closedWant NVMe admin passthru command
100%
Description
Many NVMe devices support vendor-specific commands, such as telemetry or vendor-defined log pages. We'd like to provide a method for writing vendor-specific commands in userspace, and submitting those to the device on the user's behalf.
Files
Updated by Benjamin Naecker 8 months ago
This ticket tracks work adding a new ioctl to the nvme driver, `NVME_IOC_PASSTHRU`, and a new type to represent the passed-through command. The driver should do some sanity checks on the data, and then submit the data as an entry on the device's admin command queue. The results of the command should be passed back to the caller in the struct provided.
Updated by Benjamin Naecker 7 months ago
- File workload.sh workload.sh added
The proposed patch modifies some of the internal memory-management of the NVMe driver. Specifically, the deprecated interface for iterating over DMA cookies (`ddi_dma_nextcookie`) has been removed, in favor of the explicit index-based `ddi_dma_cookie_get`. Also, physical-region page (PRP) lists have been implemented, since the passthru command may conceivably require any amount of data up to the limits imposed by the controller.
To verify that these changes don't impact the normal data path, I ran a workload using FIO. The script is attached, which reported zero errors.
Updated by Benjamin Naecker 7 months ago
I've also run a few other tests. I verified the code that does some sanity checks on the passthru command (valid buffer size, valid opcode, device support), with a small C program compiled for both 64-bit and 32-bit. I also ran an actual vendor-specific command on Western Digital drives. Certain models support signal integrity eye-diagrams. I collected and validated a number of these using a Rust userland program.
Updated by Electric Monk 7 months ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit eb7b3ff7f0a23dbf314498913db23e56237396c0
commit eb7b3ff7f0a23dbf314498913db23e56237396c0 Author: Benjamin Naecker <bnaecker@fastmail.com> Date: 2022-01-05T17:50:15.000Z 14294 Want NVMe admin passthru command Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Approved by: Dan McDonald <danmcd@joyent.com>