Commit 0bff3e7e authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

nvmf: improve request layout



Link is used in the hot path therefore moved to the first cache line.
There were no 16 bytes for that hence moved timeout_tsc which is used
only for connect and abort flows.

By moving memory domain, domain ctx and seq before iov arr we can get
all these fields in second cache line together with first entries of
the iov arr.

Reduce iovcnt size to fit yet another ptr into first cache line.

Put rsvd field explicilty in the padding hole.

Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I82a79485bf55fc5db3823ea5571c29eabbf4c3f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21343


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent f029b824
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -78,16 +78,11 @@ struct spdk_nvmf_request {
	uint8_t				xfer; /* type enum spdk_nvme_data_transfer */
	bool				data_from_pool;
	bool				dif_enabled;
	uint8_t				iovcnt;
	union nvmf_h2c_msg		*cmd;
	union nvmf_c2h_msg		*rsp;
	STAILQ_ENTRY(spdk_nvmf_request)	buf_link;
	uint64_t			timeout_tsc;

	uint32_t			iovcnt;
	struct iovec			iov[NVMF_REQ_MAX_BUFFERS];
	struct spdk_nvmf_stripped_data	*stripped_data;

	struct spdk_nvmf_dif_info	dif;
	TAILQ_ENTRY(spdk_nvmf_request)	link;

	/* Memory domain which describes payload in this request. If the bdev doesn't support memory
	 * domains, bdev layer will do the necessary push or pull operation. */
@@ -96,6 +91,11 @@ struct spdk_nvmf_request {
	void				*memory_domain_ctx;
	struct spdk_accel_sequence	*accel_sequence;

	struct iovec			iov[NVMF_REQ_MAX_BUFFERS];
	struct spdk_nvmf_stripped_data	*stripped_data;

	struct spdk_nvmf_dif_info	dif;

	struct spdk_bdev_io_wait_entry	bdev_io_wait;
	spdk_nvmf_nvme_passthru_cmd_cb	cmd_cb_fn;
	struct spdk_nvmf_request	*first_fused_req;
@@ -103,9 +103,12 @@ struct spdk_nvmf_request {
	struct spdk_poller		*poller;
	struct spdk_bdev_io		*zcopy_bdev_io; /* Contains the bdev_io when using ZCOPY */
	enum spdk_nvmf_zcopy_phase	zcopy_phase;
	uint8_t				rsvd[4];

	TAILQ_ENTRY(spdk_nvmf_request)	link;
	/* Timeout tracked for connect and abort flows. */
	uint64_t timeout_tsc;
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_request) == 784, "Incorrect size");

enum spdk_nvmf_qpair_state {
	SPDK_NVMF_QPAIR_UNINITIALIZED = 0,