Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Thornton <[email protected]>
  • Loading branch information
NateThornton committed Dec 3, 2024
1 parent 4a2effd commit 9aad784
Showing 1 changed file with 133 additions and 98 deletions.
231 changes: 133 additions & 98 deletions src/nvme/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9028,47 +9028,64 @@ struct nvme_ns_mgmt_host_sw_specified {
/**
* enum nvme_lm_cdq_fields - Controller Data Queue command fields
*
* @NVME_LM_CREATE_CDQ: Create CDQ select option
* @NVME_LM_DELETE_CDQ: Delete CDQ select option
* @NVME_LM_CDQ_SELECT_SHIFT: Shift to set Select (SEL) field
* @NVME_LM_CDQ_SELECT_MASK: Mask to set SEL field
* @NVME_LM_QUEUE_TYPE_USER_DATA_MIGRATION_QUEUE: User Data Migration Queue type
* @NVME_LM_QUEUE_TYPE_SHIFT: Shift amount to set Queue Type (QT) field
* @NVME_LM_QUEUE_TYPE_MASK: Mask to set QT field
* @NVME_LM_CREATE_CDQ_PC: Physically Contiguous
* @NVME_LM_CREATE_CDQ_CNTLID_SHIFT: Shift amount to set CNTLID field
* @NVME_LM_CREATE_CDQ_CNTLID_MASK: Mask to set CNTLID field
* @NVME_LM_CREATE_CDQ_CDQID_SHIFT: Shift amount to get CDQID field from Create
* response in completion dword0
* @NVME_LM_CREATE_CDQ_CDQID_MASK: Mask to get CNTLID field from Create
* response in completion dword0
* @NVME_LM_DELETE_CDQ_CDQID_SHIFT: Shift amount to set CDQID field for deletion
* @NVME_LM_DELETE_CDQ_CDQID_MASK: Mask to set CDQID field for deletion
* @NVME_LM_CDQ_MOS_SHIFT: Shift to set Management Operation Specific (MOS)
* field
* @NVME_LM_CDQ_MOS_MASK: Mask to set MOS field
* @NVME_LM_CDQ_SEL_SHIFT: Shift to set Select (SEL) field
* @NVME_LM_CDQ_SEL_MASK: Mask to set SEL field
* @NVME_LM_SEL_CREATE_CDQ: Create CDQ select option
* @NVME_LM_SEL_DELETE_CDQ: Delete CDQ select option
* @NVME_LM_QT_SHIFT: Shift amount to set Queue Type (QT) field relative
* to MOS
* @NVME_LM_QT_MASK: Mask to set QT field relative to MOS
* @NVME_LM_QT_USER_DATA_MIGRATION_QUEUE: User Data Migration Queue type
* @NVME_LM_CREATE_CDQ_PC: Physically Contiguous (PC)
* @NVME_LM_CREATE_CDQ_CNTLID_SHIFT: Shift amount to set CNTLID field relative to MOS
* @NVME_LM_CREATE_CDQ_CNTLID_MASK: Mask to set CNTLID field relative to MOS
* @NVME_LM_DELETE_CDQ_CDQID_SHIFT: Shift amount to set CDQID field for deletion
* @NVME_LM_DELETE_CDQ_CDQID_MASK: Mask to set CDQID field for deletion
* @NVME_LM_CREATE_CDQ_CDQID_SHIFT: Shift amount to get CDQID field from Create response
* in completion dword0
* @NVME_LM_CREATE_CDQ_CDQID_MASK: Mask to get CNTLID field from Create response in
* completion dword0
*/
enum nvme_lm_cdq_fields {
NVME_LM_CREATE_CDQ = 0,
NVME_LM_DELETE_CDQ = 1,
NVME_LM_CDQ_SELECT_SHIFT = 0,
NVME_LM_CDQ_SELECT_MASK = 16,
NVME_LM_QUEUE_TYPE_USER_DATA_MIGRATION_QUEUE = 0,
NVME_LM_QUEUE_TYPE_SHIFT = 16,
NVME_LM_QUEUE_TYPE_MASK = 0xffff,
NVME_LM_CDQ_MOS_SHIFT = 16,
NVME_LM_CDQ_MOS_MASK = 0xffff,
NVME_LM_CDQ_SEL_SHIFT = 0,
NVME_LM_CDQ_SEL_MASK = 0xff,
NVME_LM_SEL_CREATE_CDQ = 0,
NVME_LM_SEL_DELETE_CDQ = 1,

/* Controller Data Queue - Create CDQ */
NVME_LM_QT_SHIFT = 0,
NVME_LM_QT_MASK = 0xff,
NVME_LM_QT_USER_DATA_MIGRATION_QUEUE = 0,
NVME_LM_CREATE_CDQ_PC = 1,
NVME_LM_CREATE_CDQ_CNTLID_SHIFT = 16,
NVME_LM_CREATE_CDQ_CNTLID_SHIFT = 0,
NVME_LM_CREATE_CDQ_CNTLID_MASK = 0xffff,
NVME_LM_CREATE_CDQ_CDQID_SHIFT = 0,
NVME_LM_CREATE_CDQ_CDQID_MASK = 0xffff,

/* Controller Data Queue - Delete CDQ */
NVME_LM_DELETE_CDQ_CDQID_SHIFT = 0,
NVME_LM_DELETE_CDQ_CDQID_MASK = 0xffff,

/* Controller Data Queue - Create CDQ - Completion Queue Entry Dword 0 */
NVME_LM_CREATE_CDQ_CDQID_SHIFT = 0,
NVME_LM_CREATE_CDQ_CDQID_MASK = 0xffff,
};

/**
* enum nvme_lm_track_send_fields - Track Send command fields
*
* @NVME_LM_LOG_USER_DATA_CHANGES: Log User Data Changes
* @NVME_LM_TRACK_MEMORY_CHANGES: Track Memory Changes
* @NVME_LM_TRACK_SEND_SELECT_SHIFT: Shift to set Select (SEL) field
* @NVME_LM_TRACK_SEND_SELECT_MASK: Mask to set SEL field
* @NVME_LM_TRACK_SEND_MOS_SHIFT: Shift to set Management Operation Specific (MOS) field
* @NVME_LM_TRACK_SEND_MOS_MASK: Mask to set MOS field
* @NVME_LM_TRACK_SEND_SEL_SHIFT: Shift to set Select (SEL) field
* @NVME_LM_TRACK_SEND_SEL_MASK: Mask to set SEL field
* @NVME_LM_SEL_LOG_USER_DATA_CHANGES: Log User Data Changes select option
* @NVME_LM_SEL_TRACK_MEMORY_CHANGES: Track Memory Changes select option
* @NVME_LM_LACT_SHIFT: Shift to set Logging Action (LACT) relative to MOS
* @NVME_LM_LACT_MASK: Mask to set LACT relative to MOS
* @NVME_LM_LACT_STOP_LOGGING: The controller shall stop logging user data changes to
* namespaces attached to the controller associated with the
* User Data Migration Queue specified in the CDQ ID.
Expand All @@ -9078,39 +9095,48 @@ enum nvme_lm_cdq_fields {
* Queue where those user data changes are caused by the
* controller associated with that User Data Migration Queue
* processing commands.
* @NVME_LM_LACT_MASK: Mask to set Logging Action (LACT)
* @NVME_LM_LACT_SHIFT: Shift to set LACT
*/
enum nvme_lm_track_send_fields {
NVME_LM_LOG_USER_DATA_CHANGES = 0,
NVME_LM_TRACK_MEMORY_CHANGES = 1,
NVME_LM_TRACK_SEND_SELECT_SHIFT = 0,
NVME_LM_TRACK_SEND_SELECT_MASK = 16,
NVME_LM_TRACK_SEND_MOS_SHIFT = 16,
NVME_LM_TRACK_SEND_MOS_MASK = 0xffff,
NVME_LM_TRACK_SEND_SEL_SHIFT = 0,
NVME_LM_TRACK_SEND_SEL_MASK = 0xff,
NVME_LM_SEL_LOG_USER_DATA_CHANGES = 0,
NVME_LM_SEL_TRACK_MEMORY_CHANGES = 1,

/* Track Send - Log User Data Changes */
NVME_LM_LACT_SHIFT = 0,
NVME_LM_LACT_MASK = 0xf,
NVME_LM_LACT_STOP_LOGGING = 0,
NVME_LM_LACT_START_LOGGING = 1,
NVME_LM_LACT_MASK = 0xf,
NVME_LM_LACT_SHIFT = 16,
};

/**
* enum nvme_lm_migration_send_fields - Migration Send command fields
*
* @NVME_LM_SUSPEND: Migration Send - Suspend
* @NVME_LM_RESUME: Migration Send - Resume
* @NVME_LM_SET_CONTROLLER_STATE: Migration Send - Set Controller State
* @NVME_LM_MIGRATION_SEND_MOS_SHIFT: Shift to set Management Operation Specific (MOS) field
* @NVME_LM_MIGRATION_SEND_MOS_MASK: Mask to set MOS field
* @NVME_LM_MIGRATION_SEND_SEL_SHIFT: Shift amount to set Select (SEL) field
* @NVME_LM_MIGRATION_SEND_SEL_MASK: Mask to set SEL field
* @NVME_LM_SEL_SUSPEND: Migration Send - Suspend
* @NVME_LM_SEL_RESUME: Migration Send - Resume
* @NVME_LM_SEL_SET_CONTROLLER_STATE: Migration Send - Set Controller State
* @NVME_LM_MIGRATION_SEND_CNTLID_SHIFT: Shift amount to set Controller ID (CNTLID)
* @NVME_LM_MIGRATION_SEND_CNTLID_MASK: Mask to set CNTLID
* @NVME_LM_MIGRATION_SEND_UIDX_SHIFT: Shift to set UUID Index (UIDX)
* @NVME_LM_MIGRATION_SEND_UIDX_MASK: Mask to set UIDX
* @NVME_LM_DUDMQ: Delete User Data Migration Queue (DUDMQ)
* @NVME_LM_DUDMQ_SHIFT: Shift amount to set DUDMQ
* @NVME_LM_DUDMQ_MASK: Mask to set DUDMQ
* @NVME_LM_STYPE_NOTIFICATION: Suspend Type (STYPE) - Suspend Notification
* @NVME_LM_STYPE_SUSPEND: Suspend Type (STYPE) - Suspend
* @NVME_LM_STYPE_SHIFT: Shift amount to set STYPE
* @NVME_LM_STYPE_SHIFT: Shift amount to set Suspend Type (STYPE)
* @NVME_LM_STYPE_MASK: Mask to set STYPE
* @NVME_LM_STYPE_SUSPEND_NOTIFICATION: Suspend Notification - The specified controller is going to
* be suspended in the future with a subsequent Migration Send
* command
* @NVME_LM_STYPE_SUSPEND: Suspend Type (STYPE) - Suspend the controller
* @NVME_LM_SEQIND_SHIFT: Shift amount to set Sequence Indicator (SEQIND) field
* relative to MOS
* @NVME_LM_SEQIND_MASK: Mask to set SEQIND field relative to MOS
* @NVME_LM_SEQIND_NOT_FIRST_NOT_LAST: This command is not the first or last of a sequence two or
* more Migration Send commands with this management operation
* used to transfer the controller state from host to
Expand All @@ -9121,40 +9147,41 @@ enum nvme_lm_track_send_fields {
* more Migration Send commands
* @NVME_LM_SEQIND_ENTIRE: This Migration Send command is the only command and contains
* the entire controller state for this management operation
* @NVME_LM_SEQIND_SHIFT: Shift amount to set SEQIND
* @NVME_LM_SEQIND_MASK: Mask to set SEQIND
* @NVME_LM_MIGRATION_SEND_CSUUIDI_SHIFT: Shift amount to set Controller State UUID Index (CSUUIDI)
* @NVME_LM_MIGRATION_SEND_CSUUIDI_MASK: Mask to set CSUUIDI
* @NVME_LM_MIGRATION_SEND_CSVI_SHIFT: Shift amount to set Controller State Version Index (CSVI)
* @NVME_LM_MIGRATION_SEND_CSVI_MASK: Mask to set CSVI
*/
enum nvme_lm_migration_send_fields {
NVME_LM_SUSPEND = 0,
NVME_LM_RESUME = 1,
NVME_LM_SET_CONTROLLER_STATE = 2,
NVME_LM_MIGRATION_SEND_MOS_SHIFT = 16,
NVME_LM_MIGRATION_SEND_MOS_MASK = 0xffff,
NVME_LM_MIGRATION_SEND_SEL_SHIFT = 0,
NVME_LM_MIGRATION_SEND_SEL_MASK = 0xff,
NVME_LM_SEL_SUSPEND = 0,
NVME_LM_SEL_RESUME = 1,
NVME_LM_SEL_SET_CONTROLLER_STATE = 2,
NVME_LM_MIGRATION_SEND_CNTLID_SHIFT = 0,
NVME_LM_MIGRATION_SEND_CNTLID_MASK = 0xffff,
NVME_LM_MIGRATION_SEND_UIDX_SHIFT = 0,
NVME_LM_MIGRATION_SEND_UIDX_MASK = 0x7f,

/* Migration Send - Suspend */
NVME_LM_DUDMQ = 1,
NVME_LM_DUDMQ_SHIFT = 31,
NVME_LM_DUDMQ_MASK = 0x1,
NVME_LM_STYPE_NOTIFICATION = 0,
NVME_LM_STYPE_SUSPEND = 1,
NVME_LM_DUDMQ = 1,
NVME_LM_STYPE_SHIFT = 16,
NVME_LM_STYPE_MASK = 0xff,
NVME_LM_STYPE_SUSPEND_NOTIFICATION = 0,
NVME_LM_STYPE_SUSPEND = 1,

/* Migration Send - Set Controller State */
NVME_LM_SEQIND_SHIFT = 16,
NVME_LM_SEQIND_MASK = 0xf,
NVME_LM_SEQIND_NOT_FIRST_NOT_LAST = 0,
NVME_LM_SEQIND_FIRST = 1,
NVME_LM_SEQIND_LAST = 2,
NVME_LM_SEQIND_ENTIRE = 3,
NVME_LM_SEQIND_SHIFT = 16,
NVME_LM_SEQIND_MASK = 0xf,
NVME_LM_MIGRATION_SEND_CSUUIDI_SHIFT = 24,
NVME_LM_MIGRATION_SEND_CSUUIDI_MASK = 0xff,
NVME_LM_MIGRATION_SEND_CSVI_SHIFT = 16,
Expand All @@ -9163,90 +9190,98 @@ enum nvme_lm_migration_send_fields {
/**
* enum nvme_lm_migration_recv_fields - Migration Receive command fields
*
* @NVME_LM_GET_CONTROLLER_STATE: Get Controller State
* @NVME_LM_MIGRATION_RECV_MOS_SHIFT: Shift amount to set Management Specific Operation (MOS)
* field
* @NVME_LM_MIGRATION_RECV_MOS_MASK: Mask to set MOS field
* @NVME_LM_MIGRATION_RECV_SEL_SHIFT: Shift amount to set Select (SEL) field
* @NVME_LM_MIGRATION_RECV_SEL_MASK: Mask to set SEL field
* @NVME_LM_MIGRATION_RECV_CNTLID_SHIFT: Shift amount to set Controller ID (CNTLID)
* @NVME_LM_MIGRATION_RECV_CNTLID_MASK: Mask to set CNTLID
* @NVME_LM_SEL_GET_CONTROLLER_STATE: Get Controller State select option
* @NVME_LM_MIGRATION_RECV_UIDX_SHIFT: Shift to set UUID Index (UIDX)
* @NVME_LM_MIGRATION_RECV_UIDX_MASK: Mask to set UIDX
* @NVME_LM_MIGRATION_RECV_CSVI_SHIFT: Shift amount to set Controller State Version Index (CSVI)
* relative to MOS
* @NVME_LM_MIGRATION_RECV_CSVI_MASK: Mask to set CSVI relative to MOS
* @NVME_LM_MIGRATION_RECV_CSUIDXP_SHIFT: Shift amount to set Controller State UUID Index Parameter
* (CSUIDXP)
* @NVME_LM_MIGRATION_RECV_CSUIDXP_MASK: Mask to set CSUIDXP
* @NVME_LM_MIGRATION_RECV_CSUUIDI_SHIFT: Shift amount to set Controller State UUID Index (CSUUIDI).-
* @NVME_LM_MIGRATION_RECV_CSUUIDI_MASK: Mask to set CSUUIDI
* @NVME_LM_MIGRATION_RECV_CSVI_SHIFT: Shift amount to set Controller State Version Index (CSVI)
* @NVME_LM_MIGRATION_RECV_CSVI_MASK: Mask to set CSVI
* @NVME_LM_MIGRATION_RECV_CNTLID_SHIFT: Shift amount to set Controller ID (CNTLID)
* @NVME_LM_MIGRATION_RECV_CNTLID_MASK: Mask to set CNTLID
* @NVME_LM_MIGRATION_RECV_CSUP_SHIFT: Shift to get Controller Suspended (CSUP) value in
* completion dword0 of Migration Receive command
* @NVME_LM_MIGRATION_RECV_CSUP_MASK: Mask to get CSUPvalue in completion dword0 of Migration
* Receive command
* @NVME_LM_MIGRATION_RECV_CTRL_SUSPENDED: Controller Suspended
* @NVME_LM_MIGRATION_RECV_CTRL_SUSPENDED_SHIFT: Shift to get Controller Suspended value in
* completion dword0 of Migration Receive command
* @NVME_LM_MIGRATION_RECV_CTRL_SUSPENDED_MASK: Mask to get Controller Suspended value in
* completion dword0 of Migration Receive command
*/
enum nvme_lm_migration_recv_fields {
NVME_LM_GET_CONTROLLER_STATE = 0,
NVME_LM_MIGRATION_RECV_MOS_SHIFT = 16,
NVME_LM_MIGRATION_RECV_MOS_MASK = 0xffff,
NVME_LM_MIGRATION_RECV_SEL_SHIFT = 0,
NVME_LM_MIGRATION_RECV_SEL_MASK = 0xff,
NVME_LM_MIGRATION_RECV_CNTLID_SHIFT = 0,
NVME_LM_MIGRATION_RECV_CNTLID_MASK = 0xffff,
NVME_LM_SEL_GET_CONTROLLER_STATE = 0,
NVME_LM_MIGRATION_RECV_UIDX_SHIFT = 0,
NVME_LM_MIGRATION_RECV_UIDX_MASK = 0x7f,

/* Migration Receive - Get Controller State */
NVME_LM_MIGRATION_RECV_CSVI_SHIFT = 0,
NVME_LM_MIGRATION_RECV_CSVI_MASK = 0xff,
NVME_LM_MIGRATION_RECV_CSUIDXP_SHIFT = 24,
NVME_LM_MIGRATION_RECV_CSUIDXP_MASK = 0xff,
NVME_LM_MIGRATION_RECV_CSUUIDI_SHIFT = 16,
NVME_LM_MIGRATION_RECV_CSUUIDI_MASK = 0xff,
NVME_LM_MIGRATION_RECV_CSVI_SHIFT = 16,
NVME_LM_MIGRATION_RECV_CSVI_MASK = 0xff,
NVME_LM_MIGRATION_RECV_CNTLID_SHIFT = 0,
NVME_LM_MIGRATION_RECV_CNTLID_MASK = 0xffff,

/* Migration Receive - Get Controller State - Completion Queue Entry Dword 0*/
NVME_LM_MIGRATION_RECV_CSUP_SHIFT = 0,
NVME_LM_MIGRATION_RECV_CSUP_MASK = 0x1,
NVME_LM_MIGRATION_RECV_CTRL_SUSPENDED = 1,
NVME_LM_MIGRATION_RECV_CTRL_SUSPENDED_SHIFT = 0,
NVME_LM_MIGRATION_RECV_CTRL_SUSPENDED_MASK = 0x1,
};

/**
* struct nvme_lm_io_submission_queue_data - I/O Submission Queue data structure. Fields related to
* the contents of Create I/O Submission Queue command that created an I/O Submission Queue.
*
* @prp1: PRP Entry 1
* @qsize: Queue Size
* @qid: Queue Identifier
* @cqid: Completion Queue Identifier
* @attrs: Attributes
* @hp: Head Pointer
* @tp: Tail Pointer
* @rsvd20: Reserved
* @iosqprp1: I/O Submission PRP Entry 1 (IOSQPRP1)
* @iosqqsize: I/O Submission Queue Size (IOSQQSIZE)
* @iosqqid: I/O Submission Queue Identifier (IOSQQID)
* @iosqcqid: I/O Completion Queue Identifier (IOSQCQID)
* @iosqa: I/O Submission Queue Attributes (IOSQA)
* @iosqhp: I/O Submission Queue Head Pointer (IOSQHP)
* @iosqtp: I/O Submission Queue Tail Pointer (IOSQTP)
* @rsvd20: Reserved
*/
struct nvme_lm_io_submission_queue_data {
__u64 prp1;
__u16 qsize;
__u16 qid;
__u16 cqid;
__u16 attrs;
__u16 hp;
__u16 tp;
__u64 iosqprp1;
__u16 iosqqsize;
__u16 iosqqid;
__u16 iosqcqid;
__u16 iosqa;
__u16 iosqhp;
__u16 iosqtp;
__u8 rsvd20[4];
};

/**
* struct nvme_lm_io_completion_queue_data - I/O Completion Queue data structure. Fields related to
* the contents of Create I/O Completion Queue command that created an I/O Completion Queue.
*
* @prp1: PRP Entry 1
* @qsize: Queue Size
* @qid: Queue Identifier
* @hp: Head Pointer
* @tp: Tail Pointer
* @attrs: Attributes
* @rsvd20: Reserved
* @iocqprp1: I/O Completion Queue PRP Entry 1 (IOCQPRP1)
* @iocqqsize: I/O Completion Queue Size (IOCQQSIZE)
* @iocqqid: I/O Completion Queue Identifier (IOCQQID)
* @iocqhp: I/O Completion Queue Head Pointer (IOCQHP)
* @iocqtp: I/O Completion Queue Tail Pointer (IOCQTP)
* @iocqa: I/O Completion Queue Attributes (IOCQA)
* @rsvd20: Reserved
*/
struct nvme_lm_io_completion_queue_data {
__u64 prp1;
__u16 qsize;
__u16 qid;
__u16 hp;
__u16 tp;
__u32 attrs;
__u64 iocqprp1;
__u16 iocqqsize;
__u16 iocqqid;
__u16 iocqhp;
__u16 iocqtp;
__u32 iocqa;
__u8 rsvd20[4];
};

Expand Down

0 comments on commit 9aad784

Please sign in to comment.