Commit 2a268d7a authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

nvme/tcp: move logic from safe ver of req complete



There is no harm to do an extra check and increment async completion
counter under main req complete function. However, that is behavior
change in the way that abort flows (_admin_qpair_abort_aers,
_qpair_abort_reqs) which used non safe version also modify the async
completion counter now. As abort flows might be triggered outside of
nvme_transport_qpair_process_completions context this actually might
be considered as a fix.

This is needed as a prework for further change where bypass of ordering
flags check is required and async context is still relevant.

Change-Id: I889327a45859b3087603114d460912cb5b19c22b
Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23392


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 8531a41f
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -921,12 +921,6 @@ nvme_tcp_req_complete_safe(struct nvme_tcp_req *tcp_req)
	assert(tcp_req->tqpair != NULL);
	assert(tcp_req->req != NULL);

	SPDK_DEBUGLOG(nvme, "complete tcp_req(%p) on tqpair=%p\n", tcp_req, tcp_req->tqpair);

	if (!tcp_req->tqpair->qpair.in_completion_context) {
		tcp_req->tqpair->async_complete++;
	}

	nvme_tcp_req_complete(tcp_req, tcp_req->tqpair, &tcp_req->rsp, true);
	return true;
}
@@ -1064,6 +1058,12 @@ nvme_tcp_req_complete(struct nvme_tcp_req *tcp_req,
	req = tcp_req->req;
	qpair = req->qpair;

	SPDK_DEBUGLOG(nvme, "complete tcp_req(%p) on tqpair=%p\n", tcp_req, tqpair);

	if (!tcp_req->tqpair->qpair.in_completion_context) {
		tcp_req->tqpair->async_complete++;
	}

	/* Cache arguments to be passed to nvme_complete_request since tcp_req can be zeroed when released */
	memcpy(&cpl, rsp, sizeof(cpl));

+1 −0
Original line number Diff line number Diff line
@@ -1518,6 +1518,7 @@ test_nvme_tcp_ctrlr_disconnect_qpair(void)
	 * operation is completed */
	treq.state = NVME_TCP_REQ_ACTIVE;
	treq.ordering.bits.in_progress_accel = 1;
	tqpair.async_complete = 0;
	qpair->poll_group = NULL;
	qpair->num_outstanding_reqs = 1;
	qpair->state = NVME_QPAIR_DISCONNECTING;