Sync. I/O via nvme ioctl()#

The default for xNVMe is to communicate with devices via the operating system NVMe driver IOCTLs, specifically on Linux the following are used:

  • NVME_IOCTL_ID

  • NVME_IOCTL_IO_CMD

  • NVME_IOCTL_ADMIN_CMD

  • NVME_IOCTL_IO64_CMD

  • NVME_IOCTL_ADMIN64_CMD

In case the *64_CMD IOCTLs are not available then xNVMe falls back to using the non-64bit equivalents. The 64 vs 32 completion result mostly affect commands such as Zone Append. You can check that this interface is behaving as expected by running:

xnvme info /dev/nvme0n1

Which you yield output equivalent to:

xnvme_dev:
  xnvme_ident:
    uri: '/dev/nvme0n1'
    dtype: 0x2
    nsid: 0x1
    csi: 0x0
  xnvme_be:
    admin: {id: 'nvme'}
    sync: {id: 'nvme'}
    async: {id: 'emu'}

This tells you that xNVMe can communicate with the given device identifier and it informs you that it utilizes nvme_ioctl for synchronous command execution and it uses thr for asynchronous command execution. Since IOCTLs are inherently synchronous then xNVMe mimics asynchronous behavior over IOCTLs to support the asynchronous primitives provided by the xNVMe API.