Commit ddd97a8b authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

nvmf/tcp: Move setting orig_length to the location the value is fixed at



tcp_req->orig_length had been set just before I/O submission but
the value is already fixed in spdk_nvmf_tcp_req_parse_sgl().
Hence move setting tcp_req->orig_length accordingly.

This follows the good practice of RDMA transport.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I99f6e266d8f7027bce810864314f3ee24a1af10c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468910


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent a41fb6e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2246,6 +2246,7 @@ spdk_nvmf_tcp_req_parse_sgl(struct spdk_nvmf_tcp_transport *ttransport,
		SPDK_DEBUGLOG(SPDK_LOG_NVMF_TCP, "Data requested length= 0x%x\n", length);

		if (spdk_unlikely(tcp_req->dif_insert_or_strip)) {
			tcp_req->orig_length = length;
			length = spdk_dif_get_length_with_md(length, &tcp_req->dif_ctx);
			tcp_req->elba_length = length;
		}
@@ -2631,7 +2632,6 @@ spdk_nvmf_tcp_req_process(struct spdk_nvmf_tcp_transport *ttransport,

			if (spdk_unlikely(tcp_req->dif_insert_or_strip)) {
				assert(tcp_req->elba_length >= tcp_req->req.length);
				tcp_req->orig_length = tcp_req->req.length;
				tcp_req->req.length = tcp_req->elba_length;
			}