nvme_pcie: Call transport_ctrlr_disconnect_qpair_done() if ctrlr_disable_poll() failed

nvme_ctrlr_disable_poll() continued to be called until it returned 0.
However, if the corresponding drive was unresponsive, the continuous
calls consumed CPU and affected other operations.

If the corresponding drive is unresponsive, we cannot complete disabling
the controller. Hence, call nvme_transport_ctrlr_disconnect_qpair_done()
if nvme_ctrlr_disable_poll() returned any value other than -EAGAIN.

Even before this patch, nvme_ctrlr_disable_poll() collected an error log
if it failed. Hence, we do not have to add more error logs.

Fixes issue #2931

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I26cabb94e5744e3a2d975670adbf2e4e48d5bd7a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17002
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Shuhei Matsumoto 2023-03-01 21:30:22 +09:00 committed by Jim Harris
parent cb2a73304b
commit a475aed55d

View File

@ -973,7 +973,7 @@ nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
if (nvme_qpair_get_state(qpair) == NVME_QPAIR_DISCONNECTING) {
rc = nvme_ctrlr_disable_poll(qpair->ctrlr);
if (rc == 0) {
if (rc != -EAGAIN) {
nvme_transport_ctrlr_disconnect_qpair_done(qpair);
}
}