nvmf: remove XOR in nvme_tcp_pdu_calc_data_digest

Prepare for the later patch, and make the later patch code clean

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I12b175c86a5245f38dc76fe2d3918ec4b30a475a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12830
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
This commit is contained in:
MengjinWu 2022-05-27 10:56:56 +08:00 committed by Tomasz Zawadzki
parent b5383af40a
commit bb33310aa0
3 changed files with 4 additions and 1 deletions

View File

@ -226,7 +226,6 @@ nvme_tcp_pdu_calc_data_digest(struct nvme_tcp_pdu *pdu)
assert(pad_length <= sizeof(pad)); assert(pad_length <= sizeof(pad));
crc32c = spdk_crc32c_update(pad, pad_length, crc32c); crc32c = spdk_crc32c_update(pad, pad_length, crc32c);
} }
crc32c = crc32c ^ SPDK_CRC32C_XOR;
return crc32c; return crc32c;
} }

View File

@ -483,6 +483,7 @@ pdu_data_crc32_compute(struct nvme_tcp_pdu *pdu)
} }
crc32c = nvme_tcp_pdu_calc_data_digest(pdu); crc32c = nvme_tcp_pdu_calc_data_digest(pdu);
crc32c = crc32c ^ SPDK_CRC32C_XOR;
MAKE_DIGEST_WORD(pdu->data_digest, crc32c); MAKE_DIGEST_WORD(pdu->data_digest, crc32c);
} }
@ -1166,6 +1167,7 @@ nvme_tcp_pdu_payload_handle(struct nvme_tcp_qpair *tqpair,
} }
crc32c = nvme_tcp_pdu_calc_data_digest(pdu); crc32c = nvme_tcp_pdu_calc_data_digest(pdu);
crc32c = crc32c ^ SPDK_CRC32C_XOR;
rc = MATCH_DIGEST_WORD(pdu->data_digest, crc32c); rc = MATCH_DIGEST_WORD(pdu->data_digest, crc32c);
if (rc == 0) { if (rc == 0) {
SPDK_ERRLOG("data digest error on tqpair=(%p) with pdu=%p\n", tqpair, pdu); SPDK_ERRLOG("data digest error on tqpair=(%p) with pdu=%p\n", tqpair, pdu);

View File

@ -1006,6 +1006,7 @@ pdu_data_crc32_compute(struct nvme_tcp_pdu *pdu)
} }
crc32c = nvme_tcp_pdu_calc_data_digest(pdu); crc32c = nvme_tcp_pdu_calc_data_digest(pdu);
crc32c = crc32c ^ SPDK_CRC32C_XOR;
MAKE_DIGEST_WORD(pdu->data_digest, crc32c); MAKE_DIGEST_WORD(pdu->data_digest, crc32c);
} }
@ -1928,6 +1929,7 @@ nvmf_tcp_pdu_payload_handle(struct spdk_nvmf_tcp_qpair *tqpair,
/* check data digest if need */ /* check data digest if need */
if (pdu->ddgst_enable) { if (pdu->ddgst_enable) {
crc32c = nvme_tcp_pdu_calc_data_digest(pdu); crc32c = nvme_tcp_pdu_calc_data_digest(pdu);
crc32c = crc32c ^ SPDK_CRC32C_XOR;
rc = MATCH_DIGEST_WORD(pdu->data_digest, crc32c); rc = MATCH_DIGEST_WORD(pdu->data_digest, crc32c);
if (rc == 0) { if (rc == 0) {
SPDK_ERRLOG("Data digest error on tqpair=(%p) with pdu=%p\n", tqpair, pdu); SPDK_ERRLOG("Data digest error on tqpair=(%p) with pdu=%p\n", tqpair, pdu);