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

nvme: put cpl status into union



3rd party library can be integrated with spdk code. To simplify that
integration nvme status filed within that patch is exposed as union
with u16. Having that is easier to assign spdk status when rhs is u16
and easier to read when lhs is u16. However, both sides need to be
aligned with nvme spec.

To align with SPDK style it shall be rather status.bits / status.raw
but it requires a lot of changes in nvme/nvmf library.

Note: According to spec phase tag is not within status but Linux
driver does similar, when rsp needs to be set it just shift left 1.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent eb9d8f34
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1103,8 +1103,11 @@ struct spdk_nvme_cpl {

	/* dword 3 */
	uint16_t		cid;	/* command identifier */
	union {
		uint16_t                status_raw;
		struct spdk_nvme_status	status;
	};
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_cpl) == 16, "Incorrect size");

/**