nvmf: don't report E2E Protection Capabilities to client

When `dif_insert_or_strip` is enabled, NVMf library will do
DIF insert and strip automatically, client isn't aware of
it, when `dif_insert_or_strip` is disabled, we will report
Namespace E2E Protection Capabilities to client, but we
don't process PRACT and PRCHK flags in NVMf library, so
here we don't report the capabilities to client and leave
the use of extended LBA buffer to users.

Change-Id: Ic610dc65fef210a7799c6ab693d89138b99e1193
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12165
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Changpeng Liu 2022-06-22 09:08:10 +08:00 committed by Konrad Sztyber
parent 7f83361553
commit a438718fc2
2 changed files with 5 additions and 21 deletions

View File

@ -131,25 +131,10 @@ nvmf_bdev_ctrlr_identify_ns(struct spdk_nvmf_ns *ns, struct spdk_nvme_ns_data *n
nsdata->mc.extended = 1;
nsdata->mc.pointer = 0;
nsdata->dps.md_start = spdk_bdev_is_dif_head_of_md(bdev);
switch (spdk_bdev_get_dif_type(bdev)) {
case SPDK_DIF_TYPE1:
nsdata->dpc.pit1 = 1;
nsdata->dps.pit = SPDK_NVME_FMT_NVM_PROTECTION_TYPE1;
break;
case SPDK_DIF_TYPE2:
nsdata->dpc.pit2 = 1;
nsdata->dps.pit = SPDK_NVME_FMT_NVM_PROTECTION_TYPE2;
break;
case SPDK_DIF_TYPE3:
nsdata->dpc.pit3 = 1;
nsdata->dps.pit = SPDK_NVME_FMT_NVM_PROTECTION_TYPE3;
break;
default:
SPDK_DEBUGLOG(nvmf, "Protection Disabled\n");
nsdata->dps.pit = SPDK_NVME_FMT_NVM_PROTECTION_DISABLE;
break;
}
/* NVMf library doesn't process PRACT and PRCHK flags, we
* leave the use of extended LBA buffer to users.
*/
nsdata->dps.pit = SPDK_NVME_FMT_NVM_PROTECTION_DISABLE;
}
} else {
nsdata->lbaf[0].ms = 0;

View File

@ -482,8 +482,7 @@ test_nvmf_bdev_ctrlr_identify_ns(void)
CU_ASSERT(nsdata.nacwu == 0);
CU_ASSERT(nsdata.lbaf[0].lbads == spdk_u32log2(4096));
CU_ASSERT(nsdata.lbaf[0].ms == 512);
CU_ASSERT(nsdata.dpc.pit1 == 1);
CU_ASSERT(nsdata.dps.pit == SPDK_NVME_FMT_NVM_PROTECTION_TYPE1);
CU_ASSERT(nsdata.dps.pit == SPDK_NVME_FMT_NVM_PROTECTION_DISABLE);
CU_ASSERT(nsdata.noiob == BDEV_IO_NUM_CHILD_IOV);
CU_ASSERT(nsdata.nmic.can_share == 1);
CU_ASSERT(nsdata.nsrescap.rescap.persist == 1);