Commit 506246b6 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

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: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I78ff81d13ae9d1542ee2591314653b23ab14664f

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478496


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent fe7f8653
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1465,6 +1465,8 @@ enum spdk_nvme_flush_broadcast {
	SPDK_NVME_FLUSH_BROADCAST_SUPPORTED		= 3
};

#define SPDK_NVME_NQN_FIELD_SIZE 256

struct __attribute__((packed)) __attribute__((aligned)) spdk_nvme_ctrlr_data {
	/* 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			subnqn[256];
	uint8_t			subnqn[SPDK_NVME_NQN_FIELD_SIZE];

	uint8_t			reserved5[768];

+2 −4
Original line number Diff line number Diff line
@@ -87,8 +87,6 @@

#define FCNVME_GOOD_RSP_LEN                     12
#define FCNVME_ASSOC_HOSTID_LEN                 16
#define FCNVME_ASSOC_HOSTNQN_LEN                256
#define FCNVME_ASSOC_SUBNQN_LEN                 256


typedef uint64_t FCNVME_BE64;
@@ -280,8 +278,8 @@ struct spdk_nvmf_fc_lsdesc_cr_assoc_cmd {
	FCNVME_BE16  sqsize;
	FCNVME_BE32  rsvd52;
	uint8_t hostid[FCNVME_ASSOC_HOSTID_LEN];
	uint8_t hostnqn[FCNVME_ASSOC_HOSTNQN_LEN];
	uint8_t subnqn[FCNVME_ASSOC_SUBNQN_LEN];
	uint8_t hostnqn[SPDK_NVME_NQN_FIELD_SIZE];
	uint8_t subnqn[SPDK_NVME_NQN_FIELD_SIZE];
	uint8_t rsvd584[432];
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fc_lsdesc_cr_assoc_cmd) == 1016, "size_mismatch");
+2 −2
Original line number Diff line number Diff line
@@ -218,8 +218,8 @@ 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		subnqn[SPDK_NVME_NQN_FIELD_SIZE];
	uint8_t		hostnqn[SPDK_NVME_NQN_FIELD_SIZE];
	uint8_t		reserved6[256];
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_fabric_connect_data) == 1024, "Incorrect size");