12#ifndef _PACKET_NVME_H_
13#define _PACKET_NVME_H_
15#define NVME_CMD_SIZE 64
16#define NVME_CQE_SIZE 16
18#define NVME_FABRIC_OPC 0x7F
19#define NVME_FCTYPE_PROP_SET 0x0
20#define NVME_FCTYPE_CONNECT 0x1
21#define NVME_FCTYPE_PROP_GET 0x4
22#define NVME_FCTYPE_AUTH_SEND 0x5
23#define NVME_FCTYPE_AUTH_RECV 0x6
24#define NVME_FCTYPE_DISCONNECT 0x8
34#define NVME_AQ_OPC_DELETE_SQ 0x00
35#define NVME_AQ_OPC_CREATE_SQ 0x01
36#define NVME_AQ_OPC_GET_LOG_PAGE 0x02
37#define NVME_AQ_OPC_DELETE_CQ 0x04
38#define NVME_AQ_OPC_CREATE_CQ 0x05
39#define NVME_AQ_OPC_IDENTIFY 0x06
40#define NVME_AQ_OPC_ABORT 0x08
41#define NVME_AQ_OPC_SET_FEATURES 0x09
42#define NVME_AQ_OPC_GET_FEATURES 0x0a
43#define NVME_AQ_OPC_ASYNC_EVE_REQ 0x0c
44#define NVME_AQ_OPC_NS_MGMT 0x0d
45#define NVME_AQ_OPC_FW_COMMIT 0x10
46#define NVME_AQ_OPC_FW_IMG_DOWNLOAD 0x11
47#define NVME_AQ_OPC_SELF_TEST 0x14
48#define NVME_AQ_OPC_NS_ATTACH 0x15
49#define NVME_AQ_OPC_KEEP_ALIVE 0x18
50#define NVME_AQ_OPC_DIRECTIVE_SEND 0x19
51#define NVME_AQ_OPC_DIRECTIVE_RECV 0x1a
52#define NVME_AQ_OPC_VIRT_MGMT 0x1c
53#define NVME_AQ_OPC_MI_SEND 0x1d
54#define NVME_AQ_OPC_MI_RECV 0x1e
55#define NVME_AQ_OPC_CAP_MGMT 0x20
56#define NVME_AQ_OPC_DISC_INFO_MGMT 0x21
57#define NVME_AQ_OPC_FABRIC_ZONING_RECV 0x22
58#define NVME_AQ_OPC_LOCKDOWN 0x24
59#define NVME_AQ_OPC_FABRIC_ZONING_LOOKUP 0x25
60#define NVME_AQ_OPC_CLEAR_EXP_NVM_CFG 0x28
61#define NVME_AQ_OPC_FABRIC_ZONING_SEND 0x29
62#define NVME_AQ_OPC_CREATE_EXP_NVM_SUBSYS 0x2a
63#define NVME_AQ_OPC_MANAGE_EXP_NVM_SUBSYS 0x2d
64#define NVME_AQ_OPC_MANAGE_EXP_NS 0x31
65#define NVME_AQ_OPC_MANAGE_EXP_PORT 0x35
66#define NVME_AQ_OPC_CROSS_CTRL_RESET 0x38
67#define NVME_AQ_OPC_SEND_DISC_LOG_PAGE 0x39
68#define NVME_AQ_OPC_TRACK_SEND 0x3d
69#define NVME_AQ_OPC_TRACK_RECV 0x3e
70#define NVME_AQ_OPC_MIGRATION_SEND 0x41
71#define NVME_AQ_OPC_MIGRATION_RECV 0x42
72#define NVME_AQ_OPC_CTRL_DATA_QUEUE 0x45
73#define NVME_AQ_OPC_DBBUF_CONFIG 0x7c
74#define NVME_AQ_OPC_FORMAT_NVM 0x80
75#define NVME_AQ_OPC_SECURITY_SEND 0x81
76#define NVME_AQ_OPC_SECURITY_RECV 0x82
77#define NVME_AQ_OPC_SANITIZE 0x84
78#define NVME_AQ_OPC_LOAD_PROGRAM 0x85
79#define NVME_AQ_OPC_GET_LBA_STATUS 0x86
80#define NVME_AQ_OPC_PROG_ACTIVATION_MGMT 0x88
81#define NVME_AQ_OPC_MEM_RANGE_SET_MGMT 0x89
82#define NVME_AQ_OPC_SANITIZE_NS 0x8c
84#define NVME_IDENTIFY_CNS_IDENTIFY_NS 0x0
85#define NVME_IDENTIFY_CNS_IDENTIFY_CTRL 0x1
86#define NVME_IDENTIFY_CNS_IDENTIFY_NSLIST 0x2
87#define NVME_IDENTIFY_CNS_NSID_DESC_LIST 0x3
88#define NVME_IDENTIFY_CNS_NVM_SET_LIST 0x4
89#define NVME_IDENTIFY_CNS_CS_IND_NS 0x8
90#define NVME_IDENTIFY_CNS_NS_ALLOC_LIST 0x10
91#define NVME_IDENTIFY_CNS_NS_ALLOC 0x11
92#define NVME_IDENTIFY_CNS_CTRL_LIST_NS 0x12
93#define NVME_IDENTIFY_CNS_CTRL_LIST 0x13
94#define NVME_IDENTIFY_CNS_PRI_CTRL_CAP 0x14
95#define NVME_IDENTIFY_CNS_SEC_CTRL_LIST 0x15
96#define NVME_IDENTIFY_CNS_NS_GRAN_LIST 0x16
97#define NVME_IDENTIFY_CNS_UUID_LIST 0x17
109#define NVME_CMD_MAX_TRS (16)
112 uint32_t cmd_pkt_num;
113 uint32_t cqe_pkt_num;
115 uint32_t data_req_pkt_num;
116 uint32_t data_tr_pkt_num[NVME_CMD_MAX_TRS];
117 uint32_t first_tr_psn;
133 unsigned tr_sub_entries;
182extern int hf_nvmeof_cmd_pkt;
183extern int hf_nvmeof_data_req;
185const char *get_nvmeof_cmd_string(uint8_t fctype);
188nvme_publish_qid(proto_tree *tree,
int field_index, uint16_t qid);
191nvme_publish_cmd_latency(proto_tree *tree,
struct nvme_cmd_ctx *cmd_ctx,
194nvme_publish_to_cmd_link(proto_tree *tree, tvbuff_t *tvb,
197nvme_publish_to_cqe_link(proto_tree *tree, tvbuff_t *tvb,
200nvme_publish_to_data_req_link(proto_tree *tree, tvbuff_t *tvb,
203nvme_publish_to_data_resp_link(proto_tree *tree, tvbuff_t *tvb,
206nvme_publish_link(proto_tree *tree, tvbuff_t *tvb,
int hf_index,
207 uint32_t pkt_no,
bool zero_ok);
214 void *ctx, uint16_t cmd_id);
215void* nvme_lookup_cmd_in_pending_list(
struct nvme_q_ctx *q_ctx, uint16_t cmd_id);
225dissect_nvmeof_fabric_cmd(tvbuff_t *nvme_tvb,
packet_info *pinfo, proto_tree *nvme_tree,
228dissect_nvmeof_cmd_data(tvbuff_t *data_tvb,
packet_info *pinfo, proto_tree *data_tree,
231dissect_nvmeof_fabric_cqe(tvbuff_t *nvme_tvb,
packet_info *pinfo,
232 proto_tree *nvme_tree,
244 struct nvme_cmd_ctx *cmd_ctx, uint32_t rkey, uint32_t frame_num);
246nvme_lookup_data_tr_pkt(
struct nvme_q_ctx *q_ctx,
247 uint32_t rkey, uint32_t frame_num);
250nvme_add_data_tr_off(
struct nvme_q_ctx *q_ctx, uint32_t off, uint32_t frame_num);
253nvme_lookup_data_tr_off(
struct nvme_q_ctx *q_ctx, uint32_t frame_num);
256nvme_add_cmd_cqe_to_done_list(
struct nvme_q_ctx *q_ctx,
262void dissect_nvme_cmd_sgl(tvbuff_t *cmd_tvb, proto_tree *cmd_tree,
int field_index,
266dissect_nvme_cmd(tvbuff_t *nvme_tvb,
packet_info *pinfo, proto_tree *root_tree,
272dissect_nvme_data_response(tvbuff_t *nvme_tvb,
packet_info *pinfo, proto_tree *root_tree,
276dissect_nvme_cqe(tvbuff_t *nvme_tvb,
packet_info *pinfo, proto_tree *root_tree,
284nvme_get_opcode_string(uint8_t opcode, uint16_t qid);
298nvme_dissect_admin_sqe_cdws(tvbuff_t *sqe_tvb,
packet_info *pinfo,
310nvme_dissect_admin_cqe_dw0(tvbuff_t *nvme_tvb,
int dw0_off, proto_tree *cqe_tree,
320nvme_dissect_cqe_status(tvbuff_t *nvme_tvb,
packet_info *pinfo,
int status_off,
321 proto_tree *cqe_tree);
352nvme_dissect_admin_data_resp(tvbuff_t *nvme_tvb,
packet_info *pinfo,
354 unsigned off,
unsigned len);
362nvme_is_io_queue_opcode(uint8_t opcode);
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
struct _wmem_tree_t wmem_tree_t
Opaque type representing a red-black tree in the wmem system.
Definition wmem_tree.h:49
Definition packet-nvme.h:218
Definition packet-nvme.h:111
Definition packet-nvme.h:100
Definition packet-nvme.h:335
struct _value_string value_string
Mapping between a 32-bit integer value and its string representation.