nvme: check is_enabled flag at common layer
Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I85e8289d10b481d3ca1cd125f73bd5abc4d1bf16 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453928 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
4aac975b35
commit
f0be163639
@ -1939,15 +1939,11 @@ nvme_pcie_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_reques
|
||||
|
||||
tr = TAILQ_FIRST(&pqpair->free_tr);
|
||||
|
||||
if (tr == NULL || !qpair->is_enabled) {
|
||||
if (tr == NULL) {
|
||||
/*
|
||||
* No tracker is available, or the qpair is disabled due to
|
||||
* an in-progress controller-level reset.
|
||||
*
|
||||
* Put the request on the qpair's request queue to be
|
||||
* processed when a tracker frees up via a command
|
||||
* completion or when the controller reset is
|
||||
* completed.
|
||||
* completion.
|
||||
*/
|
||||
STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
|
||||
goto exit;
|
||||
|
@ -588,7 +588,15 @@ nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *re
|
||||
req->submit_tick = 0;
|
||||
}
|
||||
|
||||
return nvme_transport_qpair_submit_request(qpair, req);
|
||||
if (spdk_likely(qpair->is_enabled)) {
|
||||
return nvme_transport_qpair_submit_request(qpair, req);
|
||||
} else {
|
||||
/* The controller is being reset - queue this request and
|
||||
* submit it later when the reset is completed.
|
||||
*/
|
||||
STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1558,11 +1558,10 @@ nvme_rdma_qpair_submit_request(struct spdk_nvme_qpair *qpair,
|
||||
assert(req != NULL);
|
||||
|
||||
rdma_req = nvme_rdma_req_get(rqpair);
|
||||
if (!rdma_req || !qpair->is_enabled) {
|
||||
if (!rdma_req) {
|
||||
/*
|
||||
* No rdma_req is available, or the qpair is disabled due to
|
||||
* an in-progress reset. Queue the request to be processed
|
||||
* later.
|
||||
* No rdma_req is available, so queue the request to be
|
||||
* processed later.
|
||||
*/
|
||||
STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
|
||||
return 0;
|
||||
|
@ -704,10 +704,9 @@ nvme_tcp_qpair_submit_request(struct spdk_nvme_qpair *qpair,
|
||||
assert(req != NULL);
|
||||
|
||||
tcp_req = nvme_tcp_req_get(tqpair);
|
||||
if (!tcp_req || !qpair->is_enabled) {
|
||||
if (!tcp_req) {
|
||||
/*
|
||||
* No tcp_req is available, or the qpair is currently disabled
|
||||
* due to an in-progress reset. Queue the request to be
|
||||
* No tcp_req is available, so queue the request to be
|
||||
* processed later.
|
||||
*/
|
||||
STAILQ_INSERT_TAIL(&qpair->queued_req, req, stailq);
|
||||
|
Loading…
Reference in New Issue
Block a user