Commit e48e569d authored by Ziye Yang's avatar Ziye Yang Committed by Daniel Verkamp
Browse files

nvmf/rdma: Replace the queue empty check



Replace with it with check the returned req
via spdk_unlikely macro

Change-Id: I1202b3955af9a68496d8ced7cf66c20cf26f7fff
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
parent 730a63d0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@
#include "spdk/string.h"
#include "spdk/trace.h"
#include "spdk/util.h"
#include "spdk/likely.h"

#include "spdk_internal/log.h"

@@ -895,11 +896,11 @@ spdk_nvmf_rdma_handle_pending_rdma_rw(struct spdk_nvmf_conn *conn)

	/* Try to initiate RDMA Reads or Writes on requests that have data buffers */
	while (rdma_conn->cur_rdma_rw_depth < rdma_conn->max_rw_depth) {
		if (TAILQ_EMPTY(&rdma_conn->pending_rdma_rw_queue)) {
		rdma_req = TAILQ_FIRST(&rdma_conn->pending_rdma_rw_queue);
		if (spdk_unlikely(!rdma_req)) {
			break;
		}

		rdma_req = TAILQ_FIRST(&rdma_conn->pending_rdma_rw_queue);
		TAILQ_REMOVE(&rdma_conn->pending_rdma_rw_queue, rdma_req, link);

		SPDK_TRACELOG(SPDK_TRACE_RDMA, "Submitting previously queued for RDMA R/W request %p\n", rdma_req);