Commit 252c053e authored by MengjinWu's avatar MengjinWu Committed by Tomasz Zawadzki
Browse files

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: default avatarMengjinWu <mengjin.wu@intel.com>
Change-Id: I3054079427c25d102477ef8ec1b288631741d7a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14577


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent 712e8cb7
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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;