nvme: restore qid in free_io_qids bit array
There is an error when do following sequences: 1. Allocate an I/O queue pair 2. Do controller reset via spdk_nvme_ctrlr_reset 3. Allocate an I/O queue pair becaues the free_io_qids was reset and didn't restore. Fix issue #1621. Change-Id: Icd533f171079c12fe03be07e659e8eed9b082384 Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4698 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
9eefbc5b10
commit
9ae19a413b
@ -1378,6 +1378,8 @@ spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
|
||||
/* I/O Command Set Specific Identify Controller data is invalidated during reset */
|
||||
nvme_ctrlr_free_iocs_specific_data(ctrlr);
|
||||
|
||||
spdk_bit_array_free(&ctrlr->free_io_qids);
|
||||
|
||||
/* Set the state back to INIT to cause a full hardware reset. */
|
||||
nvme_ctrlr_set_state(ctrlr, NVME_CTRLR_STATE_INIT, NVME_TIMEOUT_INFINITE);
|
||||
|
||||
@ -1400,6 +1402,8 @@ spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
|
||||
if (rc == 0 && ctrlr->trid.trtype == SPDK_NVME_TRANSPORT_PCIE) {
|
||||
/* Reinitialize qpairs */
|
||||
TAILQ_FOREACH(qpair, &ctrlr->active_io_qpairs, tailq) {
|
||||
assert(spdk_bit_array_get(ctrlr->free_io_qids, qpair->id));
|
||||
spdk_bit_array_clear(ctrlr->free_io_qids, qpair->id);
|
||||
rc_tmp = nvme_transport_ctrlr_connect_qpair(ctrlr, qpair);
|
||||
if (rc_tmp != 0) {
|
||||
rc = rc_tmp;
|
||||
|
Loading…
x
Reference in New Issue
Block a user