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: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I90940cbd2851b7d56dd928d801e60cd9dde05b7f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/996
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jacek Kalwas 2020-02-25 18:33:38 +01:00 committed by Tomasz Zawadzki
parent eb9d8f3419
commit f29276eb5f

View File

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