How can I expose SPDK-managed NVMe device as regular block device under Linux?

344 Views Asked by At

I am building a project that requires rewriting a new I/O stack that issues I/O requests to NVMe SSDs, and I am currently writing a prototype using SPDK to test the preliminary performance. I need to use many benchmarks, e.g., MySQL workloads and YCSB, to test the performance. However, as SPDK implements a distinct I/O stack that is not handled by the operating systems, I can not access the NVMe SSDs as regular block devices under Linux. And SPDK only supports testing with RocksDB and FIO, thus I can not perform the tests using the benchmarks as usual.

Therefore, my question is, how can I expose the SPDK-managed NVMe SSD as the regular block device under Linux, while still handling the I/O requests to the SSD using my I/O stack? I heard that this feature is enabled by the SPDK developers, but I can not find how to do so. Thanks.

1

There are 1 best solutions below

2
Faiz On

ublk Target (https://spdk.io/doc/ublk.html) will help here if you want to access nvme drives using spdk driver.

Other way is to create a remote target over nvmeof. Linux kernel nvme will be able to connect to the remote target via nvmeof (https://spdk.io/doc/nvmf.html).