2016-06-06 21:44:30 +00:00
|
|
|
/*-
|
|
|
|
* BSD LICENSE
|
|
|
|
*
|
|
|
|
* Copyright (c) Intel Corporation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
* * Neither the name of Intel Corporation nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SPDK_NVMF_SPEC_H
|
|
|
|
#define SPDK_NVMF_SPEC_H
|
|
|
|
|
2017-05-01 20:22:48 +00:00
|
|
|
#include "spdk/stdinc.h"
|
2016-06-06 21:44:30 +00:00
|
|
|
|
|
|
|
#include "spdk/assert.h"
|
|
|
|
#include "spdk/nvme_spec.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file
|
2016-08-15 20:27:32 +00:00
|
|
|
* NVMe over Fabrics specification definitions
|
2016-06-06 21:44:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
2016-11-15 05:42:59 +00:00
|
|
|
/* Minimum number of admin queue entries defined by NVMe over Fabrics spec */
|
|
|
|
#define SPDK_NVMF_MIN_ADMIN_QUEUE_ENTRIES 32
|
|
|
|
|
2016-06-06 21:44:30 +00:00
|
|
|
struct spdk_nvmf_capsule_cmd {
|
|
|
|
uint8_t opcode;
|
|
|
|
uint8_t reserved1;
|
|
|
|
uint16_t cid;
|
|
|
|
uint8_t fctype;
|
|
|
|
uint8_t reserved2[35];
|
|
|
|
uint8_t fabric_specific[24];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_capsule_cmd) == 64, "Incorrect size");
|
|
|
|
|
|
|
|
/* Fabric Command Set */
|
2016-06-23 21:27:40 +00:00
|
|
|
#define SPDK_NVME_OPC_FABRIC 0x7f
|
2016-06-06 21:44:30 +00:00
|
|
|
|
|
|
|
enum spdk_nvmf_fabric_cmd_types {
|
|
|
|
SPDK_NVMF_FABRIC_COMMAND_PROPERTY_SET = 0x00,
|
|
|
|
SPDK_NVMF_FABRIC_COMMAND_CONNECT = 0x01,
|
|
|
|
SPDK_NVMF_FABRIC_COMMAND_PROPERTY_GET = 0x04,
|
|
|
|
SPDK_NVMF_FABRIC_COMMAND_AUTHENTICATION_SEND = 0x05,
|
|
|
|
SPDK_NVMF_FABRIC_COMMAND_AUTHENTICATION_RECV = 0x06,
|
|
|
|
SPDK_NVMF_FABRIC_COMMAND_START_VENDOR_SPECIFIC = 0xC0,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum spdk_nvmf_fabric_cmd_status_code {
|
|
|
|
SPDK_NVMF_FABRIC_SC_INCOMPATIBLE_FORMAT = 0x80,
|
|
|
|
SPDK_NVMF_FABRIC_SC_CONTROLLER_BUSY = 0x81,
|
|
|
|
SPDK_NVMF_FABRIC_SC_INVALID_PARAM = 0x82,
|
|
|
|
SPDK_NVMF_FABRIC_SC_RESTART_DISCOVERY = 0x83,
|
|
|
|
SPDK_NVMF_FABRIC_SC_INVALID_HOST = 0x84,
|
|
|
|
SPDK_NVMF_FABRIC_SC_LOG_RESTART_DISCOVERY = 0x90,
|
|
|
|
SPDK_NVMF_FABRIC_SC_AUTH_REQUIRED = 0x91,
|
|
|
|
};
|
|
|
|
|
2016-06-22 05:11:38 +00:00
|
|
|
/**
|
|
|
|
* RDMA Queue Pair service types
|
|
|
|
*/
|
2016-07-15 20:10:33 +00:00
|
|
|
enum spdk_nvmf_rdma_qptype {
|
2016-06-22 05:11:38 +00:00
|
|
|
/** Reliable connected */
|
2016-07-15 20:10:33 +00:00
|
|
|
SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED = 0x1,
|
|
|
|
|
2016-06-22 05:11:38 +00:00
|
|
|
/** Reliable datagram */
|
2016-07-15 20:10:33 +00:00
|
|
|
SPDK_NVMF_RDMA_QPTYPE_RELIABLE_DATAGRAM = 0x2,
|
2016-06-22 05:11:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* RDMA provider types
|
|
|
|
*/
|
2016-07-15 20:10:33 +00:00
|
|
|
enum spdk_nvmf_rdma_prtype {
|
|
|
|
/** No provider specified */
|
|
|
|
SPDK_NVMF_RDMA_PRTYPE_NONE = 0x1,
|
|
|
|
|
|
|
|
/** InfiniBand */
|
2016-06-22 05:11:38 +00:00
|
|
|
SPDK_NVMF_RDMA_PRTYPE_IB = 0x2,
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** RoCE v1 */
|
2016-06-22 05:11:38 +00:00
|
|
|
SPDK_NVMF_RDMA_PRTYPE_ROCE = 0x3,
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** RoCE v2 */
|
2016-06-22 05:11:38 +00:00
|
|
|
SPDK_NVMF_RDMA_PRTYPE_ROCE2 = 0x4,
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** iWARP */
|
2016-06-22 05:11:38 +00:00
|
|
|
SPDK_NVMF_RDMA_PRTYPE_IWARP = 0x5,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* RDMA connection management service types
|
|
|
|
*/
|
2016-07-15 20:10:33 +00:00
|
|
|
enum spdk_nvmf_rdma_cms {
|
2016-06-22 05:11:38 +00:00
|
|
|
/** Sockets based endpoint addressing */
|
|
|
|
SPDK_NVMF_RDMA_CMS_RDMA_CM = 0x1,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* NVMe over Fabrics transport types
|
|
|
|
*/
|
2016-07-15 20:10:33 +00:00
|
|
|
enum spdk_nvmf_trtype {
|
|
|
|
/** RDMA */
|
|
|
|
SPDK_NVMF_TRTYPE_RDMA = 0x1,
|
|
|
|
|
|
|
|
/** Fibre Channel */
|
|
|
|
SPDK_NVMF_TRTYPE_FC = 0x2,
|
|
|
|
|
|
|
|
/** Intra-host transport (loopback) */
|
|
|
|
SPDK_NVMF_TRTYPE_INTRA_HOST = 0xfe,
|
2016-06-22 05:11:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Address family types
|
|
|
|
*/
|
2016-07-15 20:10:33 +00:00
|
|
|
enum spdk_nvmf_adrfam {
|
|
|
|
/** IPv4 (AF_INET) */
|
|
|
|
SPDK_NVMF_ADRFAM_IPV4 = 0x1,
|
|
|
|
|
|
|
|
/** IPv6 (AF_INET6) */
|
|
|
|
SPDK_NVMF_ADRFAM_IPV6 = 0x2,
|
|
|
|
|
|
|
|
/** InfiniBand (AF_IB) */
|
|
|
|
SPDK_NVMF_ADRFAM_IB = 0x3,
|
|
|
|
|
|
|
|
/** Fibre Channel address family */
|
|
|
|
SPDK_NVMF_ADRFAM_FC = 0x4,
|
|
|
|
|
|
|
|
/** Intra-host transport (loopback) */
|
|
|
|
SPDK_NVMF_ADRFAM_INTRA_HOST = 0xfe,
|
2016-06-22 05:11:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* NVM subsystem types
|
|
|
|
*/
|
2016-07-15 20:10:33 +00:00
|
|
|
enum spdk_nvmf_subtype {
|
2016-06-22 05:11:38 +00:00
|
|
|
/** Discovery type for NVM subsystem */
|
2016-07-15 20:10:33 +00:00
|
|
|
SPDK_NVMF_SUBTYPE_DISCOVERY = 0x1,
|
|
|
|
|
2016-06-22 05:11:38 +00:00
|
|
|
/** NVMe type for NVM subsystem */
|
2016-07-15 20:10:33 +00:00
|
|
|
SPDK_NVMF_SUBTYPE_NVME = 0x2,
|
2016-06-22 05:11:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Connections shall be made over a fabric secure channel
|
|
|
|
*/
|
2016-07-15 20:10:33 +00:00
|
|
|
enum spdk_nvmf_treq_secure_channel {
|
|
|
|
/** Not specified */
|
|
|
|
SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED = 0x0,
|
|
|
|
|
|
|
|
/** Required */
|
|
|
|
SPDK_NVMF_TREQ_SECURE_CHANNEL_REQUIRED = 0x1,
|
|
|
|
|
|
|
|
/** Not required */
|
|
|
|
SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_REQUIRED = 0x2,
|
2016-06-22 05:11:38 +00:00
|
|
|
};
|
|
|
|
|
2016-06-06 21:44:30 +00:00
|
|
|
struct spdk_nvmf_fabric_auth_recv_cmd {
|
|
|
|
uint8_t opcode;
|
|
|
|
uint8_t reserved1;
|
|
|
|
uint16_t cid;
|
|
|
|
uint8_t fctype; /* NVMF_FABRIC_COMMAND_AUTHENTICATION_RECV (0x06) */
|
|
|
|
uint8_t reserved2[19];
|
|
|
|
struct spdk_nvme_sgl_descriptor sgl1;
|
|
|
|
uint8_t reserved3;
|
|
|
|
uint8_t spsp0;
|
|
|
|
uint8_t spsp1;
|
|
|
|
uint8_t secp;
|
|
|
|
uint32_t al;
|
|
|
|
uint8_t reserved4[16];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_auth_recv_cmd) == 64, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_fabric_auth_send_cmd {
|
|
|
|
uint8_t opcode;
|
|
|
|
uint8_t reserved1;
|
|
|
|
uint16_t cid;
|
|
|
|
uint8_t fctype; /* NVMF_FABRIC_COMMAND_AUTHENTICATION_SEND (0x05) */
|
|
|
|
uint8_t reserved2[19];
|
|
|
|
struct spdk_nvme_sgl_descriptor sgl1;
|
|
|
|
uint8_t reserved3;
|
|
|
|
uint8_t spsp0;
|
|
|
|
uint8_t spsp1;
|
|
|
|
uint8_t secp;
|
|
|
|
uint32_t tl;
|
|
|
|
uint8_t reserved4[16];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_auth_send_cmd) == 64, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_fabric_connect_data {
|
|
|
|
uint8_t hostid[16];
|
|
|
|
uint16_t cntlid;
|
|
|
|
uint8_t reserved5[238];
|
|
|
|
uint8_t subnqn[256];
|
|
|
|
uint8_t hostnqn[256];
|
|
|
|
uint8_t reserved6[256];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_data) == 1024, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_fabric_connect_cmd {
|
|
|
|
uint8_t opcode;
|
|
|
|
uint8_t reserved1;
|
|
|
|
uint16_t cid;
|
|
|
|
uint8_t fctype;
|
|
|
|
uint8_t reserved2[19];
|
|
|
|
struct spdk_nvme_sgl_descriptor sgl1;
|
|
|
|
uint16_t recfmt; /* Connect Record Format */
|
|
|
|
uint16_t qid; /* Queue Identifier */
|
|
|
|
uint16_t sqsize; /* Submission Queue Size */
|
|
|
|
uint8_t cattr; /* queue attributes */
|
|
|
|
uint8_t reserved3;
|
|
|
|
uint32_t kato; /* keep alive timeout */
|
|
|
|
uint8_t reserved4[12];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_cmd) == 64, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_fabric_connect_rsp {
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint16_t cntlid;
|
|
|
|
uint16_t authreq;
|
|
|
|
} success;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint16_t ipo;
|
|
|
|
uint8_t iattr;
|
|
|
|
uint8_t reserved;
|
|
|
|
} invalid;
|
|
|
|
|
|
|
|
uint32_t raw;
|
|
|
|
} status_code_specific;
|
|
|
|
|
|
|
|
uint32_t reserved0;
|
|
|
|
uint16_t sqhd;
|
|
|
|
uint16_t reserved1;
|
|
|
|
uint16_t cid;
|
|
|
|
struct spdk_nvme_status status;
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_rsp) == 16, "Incorrect size");
|
|
|
|
|
2016-07-07 22:32:04 +00:00
|
|
|
#define SPDK_NVMF_PROP_SIZE_4 0
|
|
|
|
#define SPDK_NVMF_PROP_SIZE_8 1
|
2016-06-06 21:44:30 +00:00
|
|
|
|
|
|
|
struct spdk_nvmf_fabric_prop_get_cmd {
|
|
|
|
uint8_t opcode;
|
|
|
|
uint8_t reserved1;
|
|
|
|
uint16_t cid;
|
|
|
|
uint8_t fctype;
|
|
|
|
uint8_t reserved2[35];
|
2016-07-07 22:32:04 +00:00
|
|
|
struct {
|
|
|
|
uint8_t size : 2;
|
|
|
|
uint8_t reserved : 6;
|
|
|
|
} attrib;
|
2016-06-06 21:44:30 +00:00
|
|
|
uint8_t reserved3[3];
|
|
|
|
uint32_t ofst;
|
|
|
|
uint8_t reserved4[16];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_prop_get_cmd) == 64, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_fabric_prop_get_rsp {
|
|
|
|
union {
|
|
|
|
uint64_t u64;
|
|
|
|
struct {
|
|
|
|
uint32_t low;
|
|
|
|
uint32_t high;
|
|
|
|
} u32;
|
|
|
|
} value;
|
|
|
|
|
|
|
|
uint16_t sqhd;
|
|
|
|
uint16_t reserved0;
|
|
|
|
uint16_t cid;
|
|
|
|
struct spdk_nvme_status status;
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_prop_get_rsp) == 16, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_fabric_prop_set_cmd {
|
|
|
|
uint8_t opcode;
|
|
|
|
uint8_t reserved0;
|
|
|
|
uint16_t cid;
|
|
|
|
uint8_t fctype;
|
|
|
|
uint8_t reserved1[35];
|
2016-07-07 22:32:04 +00:00
|
|
|
struct {
|
|
|
|
uint8_t size : 2;
|
|
|
|
uint8_t reserved : 6;
|
|
|
|
} attrib;
|
2016-06-06 21:44:30 +00:00
|
|
|
uint8_t reserved2[3];
|
|
|
|
uint32_t ofst;
|
|
|
|
|
|
|
|
union {
|
|
|
|
uint64_t u64;
|
|
|
|
struct {
|
|
|
|
uint32_t low;
|
|
|
|
uint32_t high;
|
|
|
|
} u32;
|
|
|
|
} value;
|
|
|
|
|
|
|
|
uint8_t reserved4[8];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_prop_set_cmd) == 64, "Incorrect size");
|
|
|
|
|
2016-06-28 20:25:41 +00:00
|
|
|
#define SPDK_NVMF_NQN_MAX_LEN 223
|
2016-06-06 21:44:30 +00:00
|
|
|
#define SPDK_NVMF_DISCOVERY_NQN "nqn.2014-08.org.nvmexpress.discovery"
|
|
|
|
|
2016-11-21 22:11:59 +00:00
|
|
|
#define SPDK_NVMF_TRADDR_MAX_LEN 256
|
|
|
|
#define SPDK_NVMF_TRSVCID_MAX_LEN 32
|
|
|
|
|
2016-07-15 20:10:33 +00:00
|
|
|
/** RDMA transport-specific address subtype */
|
2016-07-15 16:46:20 +00:00
|
|
|
struct spdk_nvmf_rdma_transport_specific_address_subtype {
|
2016-07-15 20:10:33 +00:00
|
|
|
/** RDMA QP service type (\ref spdk_nvmf_rdma_qptype) */
|
|
|
|
uint8_t rdma_qptype;
|
|
|
|
|
|
|
|
/** RDMA provider type (\ref spdk_nvmf_rdma_prtype) */
|
|
|
|
uint8_t rdma_prtype;
|
|
|
|
|
|
|
|
/** RDMA connection management service (\ref spdk_nvmf_rdma_cms) */
|
|
|
|
uint8_t rdma_cms;
|
|
|
|
|
2016-06-22 05:11:38 +00:00
|
|
|
uint8_t reserved0[5];
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** RDMA partition key for AF_IB */
|
2016-06-22 05:11:38 +00:00
|
|
|
uint16_t rdma_pkey;
|
2016-07-15 20:10:33 +00:00
|
|
|
|
2016-06-22 05:11:38 +00:00
|
|
|
uint8_t reserved2[246];
|
|
|
|
};
|
2016-07-15 16:46:20 +00:00
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_transport_specific_address_subtype) == 256,
|
2016-06-22 05:11:38 +00:00
|
|
|
"Incorrect size");
|
2016-06-06 21:44:30 +00:00
|
|
|
|
2016-07-15 20:10:33 +00:00
|
|
|
/** Transport-specific address subtype */
|
2016-07-15 16:46:20 +00:00
|
|
|
union spdk_nvmf_transport_specific_address_subtype {
|
2016-07-15 16:34:25 +00:00
|
|
|
uint8_t raw[256];
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** RDMA */
|
2016-07-15 16:46:20 +00:00
|
|
|
struct spdk_nvmf_rdma_transport_specific_address_subtype rdma;
|
2016-07-15 16:34:25 +00:00
|
|
|
};
|
2016-07-15 16:46:20 +00:00
|
|
|
SPDK_STATIC_ASSERT(sizeof(union spdk_nvmf_transport_specific_address_subtype) == 256,
|
|
|
|
"Incorrect size");
|
2016-07-15 16:34:25 +00:00
|
|
|
|
2016-07-15 20:10:33 +00:00
|
|
|
/**
|
|
|
|
* Discovery Log Page entry
|
|
|
|
*/
|
2016-06-06 21:44:30 +00:00
|
|
|
struct spdk_nvmf_discovery_log_page_entry {
|
2016-07-15 20:10:33 +00:00
|
|
|
/** Transport type (\ref spdk_nvmf_trtype) */
|
|
|
|
uint8_t trtype;
|
|
|
|
|
|
|
|
/** Address family (\ref spdk_nvmf_adrfam) */
|
|
|
|
uint8_t adrfam;
|
|
|
|
|
|
|
|
/** Subsystem type (\ref spdk_nvmf_subtype) */
|
2016-06-06 21:44:30 +00:00
|
|
|
uint8_t subtype;
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** Transport requirements */
|
|
|
|
struct {
|
|
|
|
/** Secure channel requirements (\ref spdk_nvmf_treq_secure_channel) */
|
|
|
|
uint8_t secure_channel : 2;
|
|
|
|
|
|
|
|
uint8_t reserved : 6;
|
|
|
|
} treq;
|
|
|
|
|
|
|
|
/** NVM subsystem port ID */
|
2016-06-06 21:44:30 +00:00
|
|
|
uint16_t portid;
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** Controller ID */
|
2016-06-06 21:44:30 +00:00
|
|
|
uint16_t cntlid;
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** Admin max SQ size */
|
|
|
|
uint16_t asqsz;
|
|
|
|
|
|
|
|
uint8_t reserved0[22];
|
|
|
|
|
|
|
|
/** Transport service identifier */
|
2016-11-21 22:11:59 +00:00
|
|
|
uint8_t trsvcid[SPDK_NVMF_TRSVCID_MAX_LEN];
|
2016-07-15 20:10:33 +00:00
|
|
|
|
2016-06-06 21:44:30 +00:00
|
|
|
uint8_t reserved1[192];
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** NVM subsystem qualified name */
|
2016-06-06 21:44:30 +00:00
|
|
|
uint8_t subnqn[256];
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** Transport address */
|
2016-11-21 22:11:59 +00:00
|
|
|
uint8_t traddr[SPDK_NVMF_TRADDR_MAX_LEN];
|
2016-07-15 20:10:33 +00:00
|
|
|
|
|
|
|
/** Transport-specific address subtype */
|
2016-07-15 16:46:20 +00:00
|
|
|
union spdk_nvmf_transport_specific_address_subtype tsas;
|
2016-06-06 21:44:30 +00:00
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_log_page_entry) == 1024, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_discovery_log_page {
|
|
|
|
uint64_t genctr;
|
|
|
|
uint64_t numrec;
|
|
|
|
uint16_t recfmt;
|
|
|
|
uint8_t reserved0[1006];
|
|
|
|
struct spdk_nvmf_discovery_log_page_entry entries[0];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_log_page) == 1024, "Incorrect size");
|
|
|
|
|
|
|
|
/* RDMA Fabric specific definitions below */
|
|
|
|
|
|
|
|
#define SPDK_NVME_SGL_SUBTYPE_INVALIDATE_KEY 0xF
|
|
|
|
|
|
|
|
struct spdk_nvmf_rdma_request_private_data {
|
|
|
|
uint16_t recfmt; /* record format */
|
|
|
|
uint16_t qid; /* queue id */
|
|
|
|
uint16_t hrqsize; /* host receive queue size */
|
|
|
|
uint16_t hsqsize; /* host send queue size */
|
2017-01-13 21:44:25 +00:00
|
|
|
uint16_t cntlid; /* controller id */
|
|
|
|
uint8_t reserved[22];
|
2016-06-06 21:44:30 +00:00
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_request_private_data) == 32, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_rdma_accept_private_data {
|
|
|
|
uint16_t recfmt; /* record format */
|
|
|
|
uint16_t crqsize; /* controller receive queue size */
|
|
|
|
uint8_t reserved[28];
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_accept_private_data) == 32, "Incorrect size");
|
|
|
|
|
|
|
|
struct spdk_nvmf_rdma_reject_private_data {
|
|
|
|
uint16_t recfmt; /* record format */
|
2017-12-05 17:38:27 +00:00
|
|
|
uint16_t sts; /* status */
|
2016-06-06 21:44:30 +00:00
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_reject_private_data) == 4, "Incorrect size");
|
|
|
|
|
|
|
|
union spdk_nvmf_rdma_private_data {
|
|
|
|
struct spdk_nvmf_rdma_request_private_data pd_request;
|
|
|
|
struct spdk_nvmf_rdma_accept_private_data pd_accept;
|
|
|
|
struct spdk_nvmf_rdma_reject_private_data pd_reject;
|
|
|
|
};
|
|
|
|
SPDK_STATIC_ASSERT(sizeof(union spdk_nvmf_rdma_private_data) == 32, "Incorrect size");
|
|
|
|
|
2017-12-05 17:38:27 +00:00
|
|
|
enum spdk_nvmf_rdma_transport_error {
|
2016-06-06 21:44:30 +00:00
|
|
|
SPDK_NVMF_RDMA_ERROR_INVALID_PRIVATE_DATA_LENGTH = 0x1,
|
|
|
|
SPDK_NVMF_RDMA_ERROR_INVALID_RECFMT = 0x2,
|
|
|
|
SPDK_NVMF_RDMA_ERROR_INVALID_QID = 0x3,
|
|
|
|
SPDK_NVMF_RDMA_ERROR_INVALID_HSQSIZE = 0x4,
|
|
|
|
SPDK_NVMF_RDMA_ERROR_INVALID_HRQSIZE = 0x5,
|
|
|
|
SPDK_NVMF_RDMA_ERROR_NO_RESOURCES = 0x6,
|
|
|
|
SPDK_NVMF_RDMA_ERROR_INVALID_IRD = 0x7,
|
|
|
|
SPDK_NVMF_RDMA_ERROR_INVALID_ORD = 0x8,
|
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
#endif /* __NVMF_SPEC_H__ */
|