Commit 267f09de authored by Ziye Yang's avatar Ziye Yang Committed by Changpeng Liu
Browse files

nvme/tcp: put the plen initialization into the correct location.



To fix a very small issue due to the refactoring, the previous
plen initialization is wrong. We will miss caculate 4 for
head digest, if we put this variable in this location.

Change-Id: I197e1498a4b7f7c4b8d9eb99447634ef9be1c76d
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447669


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 87851b6f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,6 @@ nvme_tcp_build_iovecs(struct iovec *iovec, int num_iovs, struct nvme_tcp_pdu *pd

	_iov_ctx_init(&ctx, iovec, num_iovs, pdu->writev_offset);
	hlen = pdu->hdr.common.hlen;
	plen = hlen;
	enable_digest = 1;
	if (pdu->hdr.common.pdu_type == SPDK_NVME_TCP_PDU_TYPE_IC_REQ ||
	    pdu->hdr.common.pdu_type == SPDK_NVME_TCP_PDU_TYPE_IC_RESP ||
@@ -241,6 +240,7 @@ nvme_tcp_build_iovecs(struct iovec *iovec, int num_iovs, struct nvme_tcp_pdu *pd
		hlen += SPDK_NVME_TCP_DIGEST_LEN;
	}

	plen = hlen;
	if (!pdu->data_len || !pdu->data) {
		/* PDU header + possible header digest */
		_iov_ctx_set_iov(&ctx, (uint8_t *)&pdu->hdr.raw, hlen);