From d706fa417f35dbfceac8924d0c381ec2c2ba8be3 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Mon, 6 Mar 2017 10:08:49 +0800 Subject: [PATCH] nvmf,rdma: Remove spdk_nvmf_rdma_request_ack_completion The sq_head handling is already done in spdk_nvmf_rdma_request_send_completion, so do not need to do again. Change-Id: I527ff8adfcbdf43ac79794cb5c7777c0e8ef6973 Signed-off-by: Ziye Yang --- lib/nvmf/rdma.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 64489ff46..902f74f07 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -519,7 +519,7 @@ nvmf_post_rdma_send(struct spdk_nvmf_request *req) * 2) Upon transfer completion, update sq_head, re-post the recv capsule, * and send the completion. (spdk_nvmf_rdma_request_send_completion) * 3) Upon getting acknowledgement of the completion, decrement the internal - * count of number of outstanding requests. (spdk_nvmf_rdma_request_ack_completion) + * count of number of outstanding requests. * * The public interface to initiate the process of completing a request is * spdk_nvmf_rdma_request_complete(), which calls a a callback in the transport layer. @@ -600,24 +600,6 @@ spdk_nvmf_rdma_request_send_completion(struct spdk_nvmf_request *req) return rc; } -static int -spdk_nvmf_rdma_request_ack_completion(struct spdk_nvmf_request *req) -{ - struct spdk_nvmf_conn *conn = req->conn; - struct spdk_nvmf_rdma_conn *rdma_conn = get_rdma_conn(conn); - - /* Advance our sq_head pointer */ - if (conn->sq_head == conn->sq_head_max) { - conn->sq_head = 0; - } else { - conn->sq_head++; - } - - rdma_conn->cur_queue_depth--; - - return 0; -} - static int nvmf_rdma_connect(struct rdma_cm_event *event) { @@ -1429,11 +1411,7 @@ spdk_nvmf_rdma_poll(struct spdk_nvmf_conn *conn) SPDK_TRACELOG(SPDK_TRACE_RDMA, "RDMA SEND Complete. Request: %p Connection: %p Outstanding I/O: %d\n", req, conn, rdma_conn->cur_queue_depth - 1); - rc = spdk_nvmf_rdma_request_ack_completion(req); - if (rc) { - error = true; - continue; - } + rdma_conn->cur_queue_depth--; break; case IBV_WC_RDMA_WRITE: