From ddd97a8b3b5cefef9377a53391d5f19dd3623736 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Fri, 20 Sep 2019 09:43:22 +0900 Subject: [PATCH] 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: Shuhei Matsumoto Change-Id: I99f6e266d8f7027bce810864314f3ee24a1af10c Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468910 Tested-by: SPDK CI Jenkins Community-CI: Broadcom SPDK FC-NVMe CI Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/nvmf/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nvmf/tcp.c b/lib/nvmf/tcp.c index 5c2095508..6a17b1c0a 100644 --- a/lib/nvmf/tcp.c +++ b/lib/nvmf/tcp.c @@ -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; }