NVMe: Passthrough IOCTL for IO commands

The NVME_IOCTL_SUBMIT_IO only works for IO commands with block data
transfers and isn't usable for other NVMe commands like flush,
data set management, or any sort of vendor unique command. The
NVME_IOCTL_ADMIN_CMD, however, can easily be modified to accept arbitrary
IO commands in addition to arbitrary admin commands without breaking
backward compatibility. This patch just adds a new IOCTL to distinguish
if the driver should submit the command on an IO or Admin queue.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Keith Busch
2014-09-12 16:07:20 -06:00
committed by Jens Axboe
parent 1b9dbf7fe0
commit 7963e52181
2 changed files with 16 additions and 6 deletions

View File

@@ -503,7 +503,7 @@ struct nvme_user_io {
__u16 appmask;
};
struct nvme_admin_cmd {
struct nvme_passthru_cmd {
__u8 opcode;
__u8 flags;
__u16 rsvd1;
@@ -524,8 +524,11 @@ struct nvme_admin_cmd {
__u32 result;
};
#define nvme_admin_cmd nvme_passthru_cmd
#define NVME_IOCTL_ID _IO('N', 0x40)
#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
#define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd)
#endif /* _UAPI_LINUX_NVME_H */