Skip to content

Commit

Permalink
nvme_pcie: Call transport_ctrlr_disconnect_qpair_done() if ctrlr_disa…
Browse files Browse the repository at this point in the history
…ble_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 spdk#2931

Signed-off-by: Shuhei Matsumoto <[email protected]>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17002 (master)

(cherry picked from commit a475aed)
Change-Id: I26cabb94e5744e3a2d975670adbf2e4e48d5bd7a
Signed-off-by: Krzysztof Karas <[email protected]>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17697
Reviewed-by: Konrad Sztyber <[email protected]>
Tested-by: SPDK CI Jenkins <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
  • Loading branch information
shuhei-matsumoto authored and jimharris committed Apr 24, 2023
1 parent a62a5ea commit 7c4369a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/nvme/nvme_pcie_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 7c4369a

Please sign in to comment.