1、1|2023 Storage Developer Conference.2023 Samsung Electronics Co.,Ltd.All Rights Reserved.Virtual ConferenceSeptember 28-29,2021libvfnA low-level NVMe Applicationand VFIO Driver FrameworkKlaus Jensen,Samsung Electronics2|2023 Storage Developer Conference.2023 Samsung Electronics Co.,Ltd.All Rights Re
2、served.What is libvfn?Two“libraries”A VFIO utility library(#include)with helpers for writing user space drivers for any PCI device Core helpers vfio configuration,device bring up,IRQ configuration,mmio IOMMU helpers iommu api,I/O virtual address allocator An NVMe user space driver(#include)Polling a
3、nd event-driven modes Low-level queue and register API LGPL,MIT dual-licensed Core library has zero external dependencies libnvme(and some GPL licensed support libraries)required for building tests and examples Designed(for now)for x86_64 and ARM643|2023 Storage Developer Conference.2023 Samsung Ele
4、ctronics Co.,Ltd.All Rights Reserved.Sigh,another user space driver?Why?io_uring,io_uring_cmd xNVMe?Hello?io_uring_cmd has dramatically reduced the need for user space NVMe drivers io_uring_cmd allows user space to“talk shop”(sending raw-ish NVMe commands)xNVMe provides high-performance abstractions
5、 over block(and raw NVMe I/O)unified API supporting several backends linux aio,io_uring,io_uring_cmd,spdk,and libvfn command submission helpers callback-based“reactor”for completions NVMe type definitions asynchronous and synchronous submission modes4|2023 Storage Developer Conference.2023 Samsung E
6、lectronics Co.,Ltd.All Rights Reserved.io_uring_cmd and NVMeFundamentally this enables a user to Submit raw-ish NVMe commands The submitted payload is slightly different from NVMe PRP1 repurposed as a single 64 bit pointer to a virtual memory address(or struct iovec)PRP2 split into two 32 bit values