Commit 18498460 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Ben Walker
Browse files

nvmf: use Connect command SQSIZE to manage SQHD



The NVMe submission queue head wraparound point can be determined in the
generic NVMe over Fabrics layer; it should not be using the RDMA
connection queue depth.

Change-Id: I9da8f09e4f057f8fdc1ff4c6cc5f48cea7123e11
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent f279de1f
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -534,7 +534,6 @@ spdk_nvmf_rdma_request_send_completion(struct spdk_nvmf_request *req)
{
	int rc;
	struct spdk_nvmf_conn		*conn = req->conn;
	struct spdk_nvmf_rdma_conn	*rdma_conn = get_rdma_conn(conn);
	struct spdk_nvme_cpl		*rsp = &req->rsp->nvme_cpl;
	struct spdk_nvmf_rdma_session	*rdma_sess;
	struct spdk_nvmf_rdma_buf	*buf;
@@ -550,9 +549,10 @@ spdk_nvmf_rdma_request_send_completion(struct spdk_nvmf_request *req)
	}

	/* Advance our sq_head pointer */
	conn->sq_head++;
	if (conn->sq_head == rdma_conn->max_queue_depth) {
	if (conn->sq_head == conn->sq_head_max) {
		conn->sq_head = 0;
	} else {
		conn->sq_head++;
	}
	rsp->sqhd = conn->sq_head;

@@ -579,9 +579,10 @@ spdk_nvmf_rdma_request_ack_completion(struct spdk_nvmf_request *req)
	struct spdk_nvmf_rdma_conn *rdma_conn = get_rdma_conn(conn);

	/* Advance our sq_head pointer */
	conn->sq_head++;
	if (conn->sq_head == rdma_conn->max_queue_depth) {
	if (conn->sq_head == conn->sq_head_max) {
		conn->sq_head = 0;
	} else {
		conn->sq_head++;
	}

	rdma_conn->cur_queue_depth--;
+2 −0
Original line number Diff line number Diff line
@@ -223,6 +223,8 @@ spdk_nvmf_session_connect(struct spdk_nvmf_conn *conn,
		return;
	}

	conn->sq_head_max = cmd->sqsize;

	if (cmd->qid == 0) {
		conn->type = CONN_TYPE_AQ;

+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ struct spdk_nvmf_conn {
	enum conn_type				type;

	uint16_t				sq_head;
	uint16_t				sq_head_max;

	TAILQ_ENTRY(spdk_nvmf_conn) 		link;
};