nvmf/tcp: insert dif after all payload received

'nvmf_tcp_pdu_payload_insert_dif' can be done after receiving
whole payload data as an optimization.

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I3054079427c25d102477ef8ec1b288631741d7a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14577
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
This commit is contained in:
MengjinWu 2022-09-20 10:26:27 +00:00 committed by Tomasz Zawadzki
parent 712e8cb7ef
commit 252c053e6f

View File

@ -2209,17 +2209,17 @@ nvmf_tcp_sock_process(struct spdk_nvmf_tcp_qpair *tqpair)
}
pdu->rw_offset += rc;
if (pdu->rw_offset < data_len) {
return NVME_TCP_PDU_IN_PROGRESS;
}
if (spdk_unlikely(pdu->dif_ctx != NULL)) {
rc = nvmf_tcp_pdu_payload_insert_dif(pdu, pdu->rw_offset - rc, rc);
rc = nvmf_tcp_pdu_payload_insert_dif(pdu, 0, data_len);
if (rc != 0) {
return NVME_TCP_PDU_FATAL;
}
}
if (pdu->rw_offset < data_len) {
return NVME_TCP_PDU_IN_PROGRESS;
}
/* All of this PDU has now been read from the socket. */
nvmf_tcp_pdu_payload_handle(tqpair, pdu);
break;