From 84d16c850163ac2a275fda6851f50d2e7c2ff9c4 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 20 Jun 2016 10:39:30 -0700 Subject: [PATCH] nvmf: simplify bounce buffer SGL adjustment A transfer using less than the total bounce buffer size is a normal occurrence and not worthy of a tracelog. Also drop the pointless conditional. Change-Id: Ibcdcf693fea439d5034fa51b08b3fbd8fd7df8f2 Signed-off-by: Daniel Verkamp --- lib/nvmf/conn.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/lib/nvmf/conn.c b/lib/nvmf/conn.c index 9b01c4bfc0..a98287266e 100644 --- a/lib/nvmf/conn.c +++ b/lib/nvmf/conn.c @@ -448,14 +448,10 @@ nvmf_process_async_completion(struct nvmf_request *req) /* Was the command successful */ if ((response->status.sc == SPDK_NVME_SC_SUCCESS) && req->length > 0) { /* data to be copied to host via memory RDMA */ - if (req->length < rx_desc->bb_len) { - /* temporarily adjust SGE to only copy what the - host is prepared to receive. - */ - SPDK_TRACELOG(SPDK_TRACE_DEBUG, " *** modify sgl length from %x to %x\n", - rx_desc->bb_sgl.length, req->length); - rx_desc->bb_sgl.length = req->length; - } + + /* temporarily adjust SGE to only copy what the host is prepared to receive. */ + rx_desc->bb_sgl.length = req->length; + ret = nvmf_post_rdma_write(tx_desc->conn, tx_desc); if (ret) { SPDK_ERRLOG("Unable to post rdma write tx descriptor\n"); @@ -660,14 +656,9 @@ nvmf_process_io_command(struct spdk_nvmf_conn *conn, if (len > 0 && sgl->type == SPDK_NVME_SGL_TYPE_KEYED_DATA_BLOCK) { SPDK_TRACELOG(SPDK_TRACE_RDMA, " Issuing RDMA Read to get host data\n"); /* data to be copied from remote host via memory RDMA */ - if (req->length < rx_desc->bb_len) { - /* temporarily adjust SGE to only copy what the - host is prepared to send. - */ - SPDK_TRACELOG(SPDK_TRACE_DEBUG, " *** modify bb sgl length from %x to %x\n", - rx_desc->bb_sgl.length, req->length); - rx_desc->bb_sgl.length = req->length; - } + + /* temporarily adjust SGE to only copy what the host is prepared to send. */ + rx_desc->bb_sgl.length = req->length; req->pending = NVMF_PENDING_WRITE; ret = nvmf_post_rdma_read(tx_desc->conn, tx_desc); @@ -916,14 +907,9 @@ nvmf_process_connect(struct spdk_nvmf_conn *conn, SPDK_TRACELOG(SPDK_TRACE_RDMA, " Issuing RDMA Read to get host connect data\n"); /* data to be copied from host via memory RDMA */ - if (sgl->nvmf_sgl.length < rx_desc->bb_len) { - /* temporarily adjust SGE to only copy what the - host is prepared to send. - */ - SPDK_TRACELOG(SPDK_TRACE_DEBUG, " *** modify bb sgl length from %x to %x\n", - rx_desc->bb_sgl.length, sgl->nvmf_sgl.length); - rx_desc->bb_sgl.length = sgl->nvmf_sgl.length; - } + + /* temporarily adjust SGE to only copy what the host is prepared to send. */ + rx_desc->bb_sgl.length = sgl->nvmf_sgl.length; ret = nvmf_post_rdma_read(tx_desc->conn, tx_desc); if (ret) {