nvme: define SPDK_NVME_NQN_FIELD_SIZE
An NQN can only be a maximum of 223 bytes, but the field containing the NQN in all of the NVMe data structures is 256. Specify that #define so it can be used in data structures that need it. Upcoming muser transport will also use this to facilitate nqn handling. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I78ff81d13ae9d1542ee2591314653b23ab14664f Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478496 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
fe7f865315
commit
506246b6f6
@ -1465,6 +1465,8 @@ enum spdk_nvme_flush_broadcast {
|
|||||||
SPDK_NVME_FLUSH_BROADCAST_SUPPORTED = 3
|
SPDK_NVME_FLUSH_BROADCAST_SUPPORTED = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define SPDK_NVME_NQN_FIELD_SIZE 256
|
||||||
|
|
||||||
struct __attribute__((packed)) __attribute__((aligned)) spdk_nvme_ctrlr_data {
|
struct __attribute__((packed)) __attribute__((aligned)) spdk_nvme_ctrlr_data {
|
||||||
/* bytes 0-255: controller capabilities and features */
|
/* bytes 0-255: controller capabilities and features */
|
||||||
|
|
||||||
@ -1808,7 +1810,7 @@ struct __attribute__((packed)) __attribute__((aligned)) spdk_nvme_ctrlr_data {
|
|||||||
|
|
||||||
uint8_t reserved4[228];
|
uint8_t reserved4[228];
|
||||||
|
|
||||||
uint8_t subnqn[256];
|
uint8_t subnqn[SPDK_NVME_NQN_FIELD_SIZE];
|
||||||
|
|
||||||
uint8_t reserved5[768];
|
uint8_t reserved5[768];
|
||||||
|
|
||||||
|
@ -87,8 +87,6 @@
|
|||||||
|
|
||||||
#define FCNVME_GOOD_RSP_LEN 12
|
#define FCNVME_GOOD_RSP_LEN 12
|
||||||
#define FCNVME_ASSOC_HOSTID_LEN 16
|
#define FCNVME_ASSOC_HOSTID_LEN 16
|
||||||
#define FCNVME_ASSOC_HOSTNQN_LEN 256
|
|
||||||
#define FCNVME_ASSOC_SUBNQN_LEN 256
|
|
||||||
|
|
||||||
|
|
||||||
typedef uint64_t FCNVME_BE64;
|
typedef uint64_t FCNVME_BE64;
|
||||||
@ -280,8 +278,8 @@ struct spdk_nvmf_fc_lsdesc_cr_assoc_cmd {
|
|||||||
FCNVME_BE16 sqsize;
|
FCNVME_BE16 sqsize;
|
||||||
FCNVME_BE32 rsvd52;
|
FCNVME_BE32 rsvd52;
|
||||||
uint8_t hostid[FCNVME_ASSOC_HOSTID_LEN];
|
uint8_t hostid[FCNVME_ASSOC_HOSTID_LEN];
|
||||||
uint8_t hostnqn[FCNVME_ASSOC_HOSTNQN_LEN];
|
uint8_t hostnqn[SPDK_NVME_NQN_FIELD_SIZE];
|
||||||
uint8_t subnqn[FCNVME_ASSOC_SUBNQN_LEN];
|
uint8_t subnqn[SPDK_NVME_NQN_FIELD_SIZE];
|
||||||
uint8_t rsvd584[432];
|
uint8_t rsvd584[432];
|
||||||
};
|
};
|
||||||
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fc_lsdesc_cr_assoc_cmd) == 1016, "size_mismatch");
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fc_lsdesc_cr_assoc_cmd) == 1016, "size_mismatch");
|
||||||
|
@ -218,8 +218,8 @@ struct spdk_nvmf_fabric_connect_data {
|
|||||||
uint8_t hostid[16];
|
uint8_t hostid[16];
|
||||||
uint16_t cntlid;
|
uint16_t cntlid;
|
||||||
uint8_t reserved5[238];
|
uint8_t reserved5[238];
|
||||||
uint8_t subnqn[256];
|
uint8_t subnqn[SPDK_NVME_NQN_FIELD_SIZE];
|
||||||
uint8_t hostnqn[256];
|
uint8_t hostnqn[SPDK_NVME_NQN_FIELD_SIZE];
|
||||||
uint8_t reserved6[256];
|
uint8_t reserved6[256];
|
||||||
};
|
};
|
||||||
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_data) == 1024, "Incorrect size");
|
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_data) == 1024, "Incorrect size");
|
||||||
|
Loading…
Reference in New Issue
Block a user