[PATCH RFC 1/5] nvme: Add CDQ data structures to nvme spec header
Joel Granados
joel.granados at kernel.org
Fri Apr 24 04:37:51 PDT 2026
Add Controller Data Queue (CDQ) related data structures and definitions
to include/linux/nvme.h. These are just the data structures. No
functional implementation yet.
Signed-off-by: Joel Granados <joel.granados at kernel.org>
---
include/linux/nvme.h | 45 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 655d194f8e722c3400ac00f76841e1af0281f38f..4a42f1614de962b9d448193193f68fe1968dfb6f 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -1314,6 +1314,7 @@ enum nvme_admin_opcode {
nvme_admin_virtual_mgmt = 0x1c,
nvme_admin_nvme_mi_send = 0x1d,
nvme_admin_nvme_mi_recv = 0x1e,
+ nvme_admin_cdq = 0x45,
nvme_admin_dbbuf = 0x7C,
nvme_admin_format_nvm = 0x80,
nvme_admin_security_send = 0x81,
@@ -1352,7 +1353,8 @@ enum nvme_admin_opcode {
nvme_admin_opcode_name(nvme_admin_security_send), \
nvme_admin_opcode_name(nvme_admin_security_recv), \
nvme_admin_opcode_name(nvme_admin_sanitize_nvm), \
- nvme_admin_opcode_name(nvme_admin_get_lba_status))
+ nvme_admin_opcode_name(nvme_admin_get_lba_status), \
+ nvme_admin_opcode_name(nvme_admin_cdq))
enum {
NVME_QUEUE_PHYS_CONTIG = (1 << 0),
@@ -1412,6 +1414,10 @@ enum {
NVME_FWACT_ACTV = (2 << 3),
};
+enum {
+ NVME_FEAT_CDQ_ID_MASK = GENMASK(15, 0),
+};
+
struct nvme_supported_log {
__le32 lids[256];
};
@@ -1590,6 +1596,42 @@ struct nvme_directive_cmd {
__u32 rsvd16[3];
};
+enum {
+ NVME_CDQ_SEL_CREATE_CDQ = 0x0,
+ NVME_CDQ_SEL_DELETE_CDQ = 0x1
+};
+
+enum {
+ NVME_CDQ_CFG_PC_DISCONT = 0x0,
+ NVME_CDQ_CFG_PC_CONT = 0x1
+};
+
+union nvme_cdq_dw11 {
+ struct {
+ __le16 flags;
+ __le16 cqs;
+ };
+ struct {
+ __le16 cdqid;
+ __le16 rsvd;
+ };
+};
+
+struct nvme_cdq {
+ __u8 opcode;
+ __u8 flags;
+ __u16 command_id;
+ __u32 rsvd1[5];
+ __le64 prp1;
+ __le32 rsvd8[2];
+ __u8 sel;
+ __u8 rsvd10;
+ __le16 mos;
+ union nvme_cdq_dw11 dw11;
+ __le32 cdqsize;
+ __u32 rsvd13[3];
+};
+
/*
* Fabrics subcommands.
*/
@@ -2000,6 +2042,7 @@ struct nvme_command {
struct nvme_dbbuf dbbuf;
struct nvme_directive_cmd directive;
struct nvme_io_mgmt_recv_cmd imr;
+ struct nvme_cdq cdq;
};
};
--
2.50.1
More information about the Linux-nvme
mailing list