4 * Copyright (c) Intel Corporation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef SPDK_NVMF_SPEC_H
35 #define SPDK_NVMF_SPEC_H
37 #include "spdk/stdinc.h"
39 #include "spdk/assert.h"
40 #include "spdk/nvme_spec.h"
44 * NVMe over Fabrics specification definitions
49 struct spdk_nvmf_capsule_cmd
{
54 uint8_t reserved2
[35];
55 uint8_t fabric_specific
[24];
57 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_capsule_cmd
) == 64, "Incorrect size");
59 /* Fabric Command Set */
60 #define SPDK_NVME_OPC_FABRIC 0x7f
62 enum spdk_nvmf_fabric_cmd_types
{
63 SPDK_NVMF_FABRIC_COMMAND_PROPERTY_SET
= 0x00,
64 SPDK_NVMF_FABRIC_COMMAND_CONNECT
= 0x01,
65 SPDK_NVMF_FABRIC_COMMAND_PROPERTY_GET
= 0x04,
66 SPDK_NVMF_FABRIC_COMMAND_AUTHENTICATION_SEND
= 0x05,
67 SPDK_NVMF_FABRIC_COMMAND_AUTHENTICATION_RECV
= 0x06,
68 SPDK_NVMF_FABRIC_COMMAND_START_VENDOR_SPECIFIC
= 0xC0,
71 enum spdk_nvmf_fabric_cmd_status_code
{
72 SPDK_NVMF_FABRIC_SC_INCOMPATIBLE_FORMAT
= 0x80,
73 SPDK_NVMF_FABRIC_SC_CONTROLLER_BUSY
= 0x81,
74 SPDK_NVMF_FABRIC_SC_INVALID_PARAM
= 0x82,
75 SPDK_NVMF_FABRIC_SC_RESTART_DISCOVERY
= 0x83,
76 SPDK_NVMF_FABRIC_SC_INVALID_HOST
= 0x84,
77 SPDK_NVMF_FABRIC_SC_LOG_RESTART_DISCOVERY
= 0x90,
78 SPDK_NVMF_FABRIC_SC_AUTH_REQUIRED
= 0x91,
82 * RDMA Queue Pair service types
84 enum spdk_nvmf_rdma_qptype
{
85 /** Reliable connected */
86 SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED
= 0x1,
88 /** Reliable datagram */
89 SPDK_NVMF_RDMA_QPTYPE_RELIABLE_DATAGRAM
= 0x2,
95 enum spdk_nvmf_rdma_prtype
{
96 /** No provider specified */
97 SPDK_NVMF_RDMA_PRTYPE_NONE
= 0x1,
100 SPDK_NVMF_RDMA_PRTYPE_IB
= 0x2,
103 SPDK_NVMF_RDMA_PRTYPE_ROCE
= 0x3,
106 SPDK_NVMF_RDMA_PRTYPE_ROCE2
= 0x4,
109 SPDK_NVMF_RDMA_PRTYPE_IWARP
= 0x5,
113 * RDMA connection management service types
115 enum spdk_nvmf_rdma_cms
{
116 /** Sockets based endpoint addressing */
117 SPDK_NVMF_RDMA_CMS_RDMA_CM
= 0x1,
121 * NVMe over Fabrics transport types
123 enum spdk_nvmf_trtype
{
125 SPDK_NVMF_TRTYPE_RDMA
= 0x1,
128 SPDK_NVMF_TRTYPE_FC
= 0x2,
131 SPDK_NVMF_TRTYPE_TCP
= 0x3,
133 /** Intra-host transport (loopback) */
134 SPDK_NVMF_TRTYPE_INTRA_HOST
= 0xfe,
138 * Address family types
140 enum spdk_nvmf_adrfam
{
141 /** IPv4 (AF_INET) */
142 SPDK_NVMF_ADRFAM_IPV4
= 0x1,
144 /** IPv6 (AF_INET6) */
145 SPDK_NVMF_ADRFAM_IPV6
= 0x2,
147 /** InfiniBand (AF_IB) */
148 SPDK_NVMF_ADRFAM_IB
= 0x3,
150 /** Fibre Channel address family */
151 SPDK_NVMF_ADRFAM_FC
= 0x4,
153 /** Intra-host transport (loopback) */
154 SPDK_NVMF_ADRFAM_INTRA_HOST
= 0xfe,
158 * NVM subsystem types
160 enum spdk_nvmf_subtype
{
161 /** Discovery type for NVM subsystem */
162 SPDK_NVMF_SUBTYPE_DISCOVERY
= 0x1,
164 /** NVMe type for NVM subsystem */
165 SPDK_NVMF_SUBTYPE_NVME
= 0x2,
169 * Connections shall be made over a fabric secure channel
171 enum spdk_nvmf_treq_secure_channel
{
173 SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED
= 0x0,
176 SPDK_NVMF_TREQ_SECURE_CHANNEL_REQUIRED
= 0x1,
179 SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_REQUIRED
= 0x2,
182 struct spdk_nvmf_fabric_auth_recv_cmd
{
186 uint8_t fctype
; /* NVMF_FABRIC_COMMAND_AUTHENTICATION_RECV (0x06) */
187 uint8_t reserved2
[19];
188 struct spdk_nvme_sgl_descriptor sgl1
;
194 uint8_t reserved4
[16];
196 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_auth_recv_cmd
) == 64, "Incorrect size");
198 struct spdk_nvmf_fabric_auth_send_cmd
{
202 uint8_t fctype
; /* NVMF_FABRIC_COMMAND_AUTHENTICATION_SEND (0x05) */
203 uint8_t reserved2
[19];
204 struct spdk_nvme_sgl_descriptor sgl1
;
210 uint8_t reserved4
[16];
212 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_auth_send_cmd
) == 64, "Incorrect size");
214 struct spdk_nvmf_fabric_connect_data
{
217 uint8_t reserved5
[238];
218 uint8_t subnqn
[SPDK_NVME_NQN_FIELD_SIZE
];
219 uint8_t hostnqn
[SPDK_NVME_NQN_FIELD_SIZE
];
220 uint8_t reserved6
[256];
222 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_data
) == 1024, "Incorrect size");
224 struct spdk_nvmf_fabric_connect_cmd
{
229 uint8_t reserved2
[19];
230 struct spdk_nvme_sgl_descriptor sgl1
;
231 uint16_t recfmt
; /* Connect Record Format */
232 uint16_t qid
; /* Queue Identifier */
233 uint16_t sqsize
; /* Submission Queue Size */
234 uint8_t cattr
; /* queue attributes */
236 uint32_t kato
; /* keep alive timeout */
237 uint8_t reserved4
[12];
239 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_cmd
) == 64, "Incorrect size");
241 struct spdk_nvmf_fabric_connect_rsp
{
255 } status_code_specific
;
261 struct spdk_nvme_status status
;
263 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_rsp
) == 16, "Incorrect size");
265 #define SPDK_NVMF_PROP_SIZE_4 0
266 #define SPDK_NVMF_PROP_SIZE_8 1
268 struct spdk_nvmf_fabric_prop_get_cmd
{
273 uint8_t reserved2
[35];
276 uint8_t reserved
: 5;
278 uint8_t reserved3
[3];
280 uint8_t reserved4
[16];
282 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_prop_get_cmd
) == 64, "Incorrect size");
284 struct spdk_nvmf_fabric_prop_get_rsp
{
296 struct spdk_nvme_status status
;
298 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_prop_get_rsp
) == 16, "Incorrect size");
300 struct spdk_nvmf_fabric_prop_set_cmd
{
305 uint8_t reserved1
[35];
308 uint8_t reserved
: 5;
310 uint8_t reserved2
[3];
321 uint8_t reserved4
[8];
323 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_prop_set_cmd
) == 64, "Incorrect size");
325 #define SPDK_NVMF_NQN_MIN_LEN 11 /* The prefix in the spec is 11 characters */
326 #define SPDK_NVMF_NQN_MAX_LEN 223
327 #define SPDK_NVMF_NQN_UUID_PRE_LEN 32
328 #define SPDK_NVMF_UUID_STRING_LEN 36
329 #define SPDK_NVMF_NQN_UUID_PRE "nqn.2014-08.org.nvmexpress:uuid:"
330 #define SPDK_NVMF_DISCOVERY_NQN "nqn.2014-08.org.nvmexpress.discovery"
332 #define SPDK_DOMAIN_LABEL_MAX_LEN 63 /* RFC 1034 max domain label length */
334 #define SPDK_NVMF_TRSTRING_MAX_LEN 32
335 #define SPDK_NVMF_TRADDR_MAX_LEN 256
336 #define SPDK_NVMF_TRSVCID_MAX_LEN 32
338 /** RDMA transport-specific address subtype */
339 struct spdk_nvmf_rdma_transport_specific_address_subtype
{
340 /** RDMA QP service type (\ref spdk_nvmf_rdma_qptype) */
343 /** RDMA provider type (\ref spdk_nvmf_rdma_prtype) */
346 /** RDMA connection management service (\ref spdk_nvmf_rdma_cms) */
349 uint8_t reserved0
[5];
351 /** RDMA partition key for AF_IB */
354 uint8_t reserved2
[246];
356 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_transport_specific_address_subtype
) == 256,
359 /** TCP Secure Socket Type */
360 enum spdk_nvme_tcp_secure_socket_type
{
362 SPDK_NVME_TCP_SECURITY_NONE
= 0,
364 /** TLS (Secure Sockets) */
365 SPDK_NVME_TCP_SECURITY_TLS
= 1,
368 /** TCP transport-specific address subtype */
369 struct spdk_nvme_tcp_transport_specific_address_subtype
{
370 /** Security type (\ref spdk_nvme_tcp_secure_socket_type) */
373 uint8_t reserved0
[255];
375 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_transport_specific_address_subtype
) == 256,
378 /** Transport-specific address subtype */
379 union spdk_nvmf_transport_specific_address_subtype
{
383 struct spdk_nvmf_rdma_transport_specific_address_subtype rdma
;
386 struct spdk_nvme_tcp_transport_specific_address_subtype tcp
;
388 SPDK_STATIC_ASSERT(sizeof(union spdk_nvmf_transport_specific_address_subtype
) == 256,
391 #define SPDK_NVMF_MIN_ADMIN_MAX_SQ_SIZE 32
394 * Discovery Log Page entry
396 struct spdk_nvmf_discovery_log_page_entry
{
397 /** Transport type (\ref spdk_nvmf_trtype) */
400 /** Address family (\ref spdk_nvmf_adrfam) */
403 /** Subsystem type (\ref spdk_nvmf_subtype) */
406 /** Transport requirements */
408 /** Secure channel requirements (\ref spdk_nvmf_treq_secure_channel) */
409 uint8_t secure_channel
: 2;
411 uint8_t reserved
: 6;
414 /** NVM subsystem port ID */
420 /** Admin max SQ size */
423 uint8_t reserved0
[22];
425 /** Transport service identifier */
426 uint8_t trsvcid
[SPDK_NVMF_TRSVCID_MAX_LEN
];
428 uint8_t reserved1
[192];
430 /** NVM subsystem qualified name */
433 /** Transport address */
434 uint8_t traddr
[SPDK_NVMF_TRADDR_MAX_LEN
];
436 /** Transport-specific address subtype */
437 union spdk_nvmf_transport_specific_address_subtype tsas
;
439 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_log_page_entry
) == 1024, "Incorrect size");
441 struct spdk_nvmf_discovery_log_page
{
445 uint8_t reserved0
[1006];
446 struct spdk_nvmf_discovery_log_page_entry entries
[0];
448 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_log_page
) == 1024, "Incorrect size");
450 /* RDMA Fabric specific definitions below */
452 #define SPDK_NVME_SGL_SUBTYPE_INVALIDATE_KEY 0xF
454 struct spdk_nvmf_rdma_request_private_data
{
455 uint16_t recfmt
; /* record format */
456 uint16_t qid
; /* queue id */
457 uint16_t hrqsize
; /* host receive queue size */
458 uint16_t hsqsize
; /* host send queue size */
459 uint16_t cntlid
; /* controller id */
460 uint8_t reserved
[22];
462 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_request_private_data
) == 32, "Incorrect size");
464 struct spdk_nvmf_rdma_accept_private_data
{
465 uint16_t recfmt
; /* record format */
466 uint16_t crqsize
; /* controller receive queue size */
467 uint8_t reserved
[28];
469 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_accept_private_data
) == 32, "Incorrect size");
471 struct spdk_nvmf_rdma_reject_private_data
{
472 uint16_t recfmt
; /* record format */
473 uint16_t sts
; /* status */
475 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_reject_private_data
) == 4, "Incorrect size");
477 union spdk_nvmf_rdma_private_data
{
478 struct spdk_nvmf_rdma_request_private_data pd_request
;
479 struct spdk_nvmf_rdma_accept_private_data pd_accept
;
480 struct spdk_nvmf_rdma_reject_private_data pd_reject
;
482 SPDK_STATIC_ASSERT(sizeof(union spdk_nvmf_rdma_private_data
) == 32, "Incorrect size");
484 enum spdk_nvmf_rdma_transport_error
{
485 SPDK_NVMF_RDMA_ERROR_INVALID_PRIVATE_DATA_LENGTH
= 0x1,
486 SPDK_NVMF_RDMA_ERROR_INVALID_RECFMT
= 0x2,
487 SPDK_NVMF_RDMA_ERROR_INVALID_QID
= 0x3,
488 SPDK_NVMF_RDMA_ERROR_INVALID_HSQSIZE
= 0x4,
489 SPDK_NVMF_RDMA_ERROR_INVALID_HRQSIZE
= 0x5,
490 SPDK_NVMF_RDMA_ERROR_NO_RESOURCES
= 0x6,
491 SPDK_NVMF_RDMA_ERROR_INVALID_IRD
= 0x7,
492 SPDK_NVMF_RDMA_ERROR_INVALID_ORD
= 0x8,
495 /* TCP transport specific definitions below */
497 /** NVMe/TCP PDU type */
498 enum spdk_nvme_tcp_pdu_type
{
499 /** Initialize Connection Request (ICReq) */
500 SPDK_NVME_TCP_PDU_TYPE_IC_REQ
= 0x00,
502 /** Initialize Connection Response (ICResp) */
503 SPDK_NVME_TCP_PDU_TYPE_IC_RESP
= 0x01,
505 /** Terminate Connection Request (TermReq) */
506 SPDK_NVME_TCP_PDU_TYPE_H2C_TERM_REQ
= 0x02,
508 /** Terminate Connection Response (TermResp) */
509 SPDK_NVME_TCP_PDU_TYPE_C2H_TERM_REQ
= 0x03,
511 /** Command Capsule (CapsuleCmd) */
512 SPDK_NVME_TCP_PDU_TYPE_CAPSULE_CMD
= 0x04,
514 /** Response Capsule (CapsuleRsp) */
515 SPDK_NVME_TCP_PDU_TYPE_CAPSULE_RESP
= 0x05,
517 /** Host To Controller Data (H2CData) */
518 SPDK_NVME_TCP_PDU_TYPE_H2C_DATA
= 0x06,
520 /** Controller To Host Data (C2HData) */
521 SPDK_NVME_TCP_PDU_TYPE_C2H_DATA
= 0x07,
523 /** Ready to Transfer (R2T) */
524 SPDK_NVME_TCP_PDU_TYPE_R2T
= 0x09,
527 /** Common NVMe/TCP PDU header */
528 struct spdk_nvme_tcp_common_pdu_hdr
{
529 /** PDU type (\ref spdk_nvme_tcp_pdu_type) */
532 /** pdu_type-specific flags */
535 /** Length of PDU header (not including the Header Digest) */
538 /** PDU Data Offset from the start of the PDU */
541 /** Total number of bytes in PDU, including pdu_hdr */
544 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_common_pdu_hdr
) == 8, "Incorrect size");
545 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_common_pdu_hdr
, pdu_type
) == 0,
547 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_common_pdu_hdr
, flags
) == 1, "Incorrect offset");
548 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_common_pdu_hdr
, hlen
) == 2, "Incorrect offset");
549 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_common_pdu_hdr
, pdo
) == 3, "Incorrect offset");
550 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_common_pdu_hdr
, plen
) == 4, "Incorrect offset");
552 #define SPDK_NVME_TCP_CH_FLAGS_HDGSTF (1u << 0)
553 #define SPDK_NVME_TCP_CH_FLAGS_DDGSTF (1u << 1)
558 * common.pdu_type == SPDK_NVME_TCP_PDU_TYPE_IC_REQ
560 struct spdk_nvme_tcp_ic_req
{
561 struct spdk_nvme_tcp_common_pdu_hdr common
;
563 /** Specifies the data alignment for all PDUs transferred from the controller to the host that contain data */
568 uint8_t hdgst_enable
: 1;
569 uint8_t ddgst_enable
: 1;
570 uint8_t reserved
: 6;
574 uint8_t reserved16
[112];
576 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_ic_req
) == 128, "Incorrect size");
577 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_ic_req
, pfv
) == 8, "Incorrect offset");
578 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_ic_req
, hpda
) == 10, "Incorrect offset");
579 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_ic_req
, maxr2t
) == 12, "Incorrect offset");
581 #define SPDK_NVME_TCP_CPDA_MAX 31
582 #define SPDK_NVME_TCP_PDU_PDO_MAX_OFFSET ((SPDK_NVME_TCP_CPDA_MAX + 1) << 2)
587 * common.pdu_type == SPDK_NVME_TCP_PDU_TYPE_IC_RESP
589 struct spdk_nvme_tcp_ic_resp
{
590 struct spdk_nvme_tcp_common_pdu_hdr common
;
592 /** Specifies the data alignment for all PDUs transferred from the host to the controller that contain data */
597 uint8_t hdgst_enable
: 1;
598 uint8_t ddgst_enable
: 1;
599 uint8_t reserved
: 6;
602 /** Specifies the maximum number of PDU-Data bytes per H2C Data Transfer PDU */
604 uint8_t reserved16
[112];
606 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_ic_resp
) == 128, "Incorrect size");
607 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_ic_resp
, pfv
) == 8, "Incorrect offset");
608 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_ic_resp
, cpda
) == 10, "Incorrect offset");
609 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_ic_resp
, maxh2cdata
) == 12, "Incorrect offset");
614 * common.pdu_type == SPDK_NVME_TCP_PDU_TYPE_TERM_REQ
616 struct spdk_nvme_tcp_term_req_hdr
{
617 struct spdk_nvme_tcp_common_pdu_hdr common
;
620 uint8_t reserved14
[10];
623 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_term_req_hdr
) == 24, "Incorrect size");
624 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_term_req_hdr
, fes
) == 8, "Incorrect offset");
625 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_term_req_hdr
, fei
) == 10, "Incorrect offset");
627 enum spdk_nvme_tcp_term_req_fes
{
628 SPDK_NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD
= 0x01,
629 SPDK_NVME_TCP_TERM_REQ_FES_PDU_SEQUENCE_ERROR
= 0x02,
630 SPDK_NVME_TCP_TERM_REQ_FES_HDGST_ERROR
= 0x03,
631 SPDK_NVME_TCP_TERM_REQ_FES_DATA_TRANSFER_OUT_OF_RANGE
= 0x04,
632 SPDK_NVME_TCP_TERM_REQ_FES_DATA_TRANSFER_LIMIT_EXCEEDED
= 0x05,
633 SPDK_NVME_TCP_TERM_REQ_FES_R2T_LIMIT_EXCEEDED
= 0x05,
634 SPDK_NVME_TCP_TERM_REQ_FES_INVALID_DATA_UNSUPPORTED_PARAMETER
= 0x06,
637 /* Total length of term req PDU (including PDU header and DATA) in bytes shall not exceed a limit of 152 bytes. */
638 #define SPDK_NVME_TCP_TERM_REQ_ERROR_DATA_MAX_SIZE 128
639 #define SPDK_NVME_TCP_TERM_REQ_PDU_MAX_SIZE (SPDK_NVME_TCP_TERM_REQ_ERROR_DATA_MAX_SIZE + sizeof(struct spdk_nvme_tcp_term_req_hdr))
644 * common.pdu_type == SPDK_NVME_TCP_PDU_TYPE_CAPSULE_CMD
646 struct spdk_nvme_tcp_cmd
{
647 struct spdk_nvme_tcp_common_pdu_hdr common
;
648 struct spdk_nvme_cmd ccsqe
;
649 /**< icdoff hdgest padding + in-capsule data + ddgst (if enabled) */
651 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_cmd
) == 72, "Incorrect size");
652 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_cmd
, ccsqe
) == 8, "Incorrect offset");
657 * common.pdu_type == SPDK_NVME_TCP_PDU_TYPE_CAPSULE_RESP
659 struct spdk_nvme_tcp_rsp
{
660 struct spdk_nvme_tcp_common_pdu_hdr common
;
661 struct spdk_nvme_cpl rccqe
;
663 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_rsp
) == 24, "incorrect size");
664 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_rsp
, rccqe
) == 8, "Incorrect offset");
670 * hdr.pdu_type == SPDK_NVME_TCP_PDU_TYPE_H2C_DATA
672 struct spdk_nvme_tcp_h2c_data_hdr
{
673 struct spdk_nvme_tcp_common_pdu_hdr common
;
678 uint8_t reserved20
[4];
680 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_h2c_data_hdr
) == 24, "Incorrect size");
681 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_h2c_data_hdr
, cccid
) == 8, "Incorrect offset");
682 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_h2c_data_hdr
, ttag
) == 10, "Incorrect offset");
683 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_h2c_data_hdr
, datao
) == 12, "Incorrect offset");
684 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_h2c_data_hdr
, datal
) == 16, "Incorrect offset");
686 #define SPDK_NVME_TCP_H2C_DATA_FLAGS_LAST_PDU (1u << 2)
687 #define SPDK_NVME_TCP_H2C_DATA_FLAGS_SUCCESS (1u << 3)
688 #define SPDK_NVME_TCP_H2C_DATA_PDO_MULT 8u
693 * hdr.pdu_type == SPDK_NVME_TCP_PDU_TYPE_C2H_DATA
695 struct spdk_nvme_tcp_c2h_data_hdr
{
696 struct spdk_nvme_tcp_common_pdu_hdr common
;
698 uint8_t reserved10
[2];
701 uint8_t reserved20
[4];
703 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_c2h_data_hdr
) == 24, "Incorrect size");
704 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_c2h_data_hdr
, cccid
) == 8, "Incorrect offset");
705 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_c2h_data_hdr
, datao
) == 12, "Incorrect offset");
706 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_c2h_data_hdr
, datal
) == 16, "Incorrect offset");
708 #define SPDK_NVME_TCP_C2H_DATA_FLAGS_SUCCESS (1u << 3)
709 #define SPDK_NVME_TCP_C2H_DATA_FLAGS_LAST_PDU (1u << 2)
710 #define SPDK_NVME_TCP_C2H_DATA_PDO_MULT 8u
715 * common.pdu_type == SPDK_NVME_TCP_PDU_TYPE_R2T
717 struct spdk_nvme_tcp_r2t_hdr
{
718 struct spdk_nvme_tcp_common_pdu_hdr common
;
723 uint8_t reserved20
[4];
725 SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_tcp_r2t_hdr
) == 24, "Incorrect size");
726 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_r2t_hdr
, cccid
) == 8, "Incorrect offset");
727 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_r2t_hdr
, ttag
) == 10, "Incorrect offset");
728 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_r2t_hdr
, r2to
) == 12, "Incorrect offset");
729 SPDK_STATIC_ASSERT(offsetof(struct spdk_nvme_tcp_r2t_hdr
, r2tl
) == 16, "Incorrect offset");
733 #endif /* __NVMF_SPEC_H__ */