mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
89377bc197
Add a new NVME_IOCTL_IO64_CMD_VEC ioctl that works like the existing NVME_IOCTL_IO64_CMD ioctl except that it takes and array of iovecs and thus supports vectored I/O. - cmd.addr is base address of user iovec array - cmd.vec_cnt is count of iovec array elements This patch does not include vectored-variant for admin-commands as most of them are light on buffers and likely to have low invocation frequency. Signed-off-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
86 lines
1.8 KiB
C
86 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
|
/*
|
|
* Definitions for the NVM Express ioctl interface
|
|
* Copyright (c) 2011-2014, Intel Corporation.
|
|
*/
|
|
|
|
#ifndef _UAPI_LINUX_NVME_IOCTL_H
|
|
#define _UAPI_LINUX_NVME_IOCTL_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct nvme_user_io {
|
|
__u8 opcode;
|
|
__u8 flags;
|
|
__u16 control;
|
|
__u16 nblocks;
|
|
__u16 rsvd;
|
|
__u64 metadata;
|
|
__u64 addr;
|
|
__u64 slba;
|
|
__u32 dsmgmt;
|
|
__u32 reftag;
|
|
__u16 apptag;
|
|
__u16 appmask;
|
|
};
|
|
|
|
struct nvme_passthru_cmd {
|
|
__u8 opcode;
|
|
__u8 flags;
|
|
__u16 rsvd1;
|
|
__u32 nsid;
|
|
__u32 cdw2;
|
|
__u32 cdw3;
|
|
__u64 metadata;
|
|
__u64 addr;
|
|
__u32 metadata_len;
|
|
__u32 data_len;
|
|
__u32 cdw10;
|
|
__u32 cdw11;
|
|
__u32 cdw12;
|
|
__u32 cdw13;
|
|
__u32 cdw14;
|
|
__u32 cdw15;
|
|
__u32 timeout_ms;
|
|
__u32 result;
|
|
};
|
|
|
|
struct nvme_passthru_cmd64 {
|
|
__u8 opcode;
|
|
__u8 flags;
|
|
__u16 rsvd1;
|
|
__u32 nsid;
|
|
__u32 cdw2;
|
|
__u32 cdw3;
|
|
__u64 metadata;
|
|
__u64 addr;
|
|
__u32 metadata_len;
|
|
union {
|
|
__u32 data_len; /* for non-vectored io */
|
|
__u32 vec_cnt; /* for vectored io */
|
|
};
|
|
__u32 cdw10;
|
|
__u32 cdw11;
|
|
__u32 cdw12;
|
|
__u32 cdw13;
|
|
__u32 cdw14;
|
|
__u32 cdw15;
|
|
__u32 timeout_ms;
|
|
__u32 rsvd2;
|
|
__u64 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)
|
|
#define NVME_IOCTL_RESET _IO('N', 0x44)
|
|
#define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)
|
|
#define NVME_IOCTL_RESCAN _IO('N', 0x46)
|
|
#define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64)
|
|
#define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64)
|
|
#define NVME_IOCTL_IO64_CMD_VEC _IOWR('N', 0x49, struct nvme_passthru_cmd64)
|
|
|
|
#endif /* _UAPI_LINUX_NVME_IOCTL_H */
|