nvmf: make the qpair disconnnect in the right order.
Reason: Initiator sends the qpair deletion in wrong order. The correct order should be all io qpairs deletion and then the admin qpair deletion. However, nvme perf does not follow this since we did not catch ctrlr + c. If we catch ctrlr + c, we need to use the spdk app framework, or other methods. We should support this in another patch. Morever, to prevent the incorrect behavior causing the coredump of target, we need also consider such case in our NVMe-oF target design. And this patch, can solve this issue, it will defer the admin qpair deletion when there are still active io qpairs. Change-Id: Iec9b88c1d6254f36963c92402ebfe8bd99abaea5 Signed-off-by: Ziye Yang <ziye.yang@intel.com> Reviewed-on: https://review.gerrithub.io/407771 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
a3f8876777
commit
27d47b9a10
@ -281,6 +281,12 @@ ctrlr_delete_qpair(void *ctx)
|
||||
struct spdk_nvmf_ctrlr *ctrlr = qpair->ctrlr;
|
||||
|
||||
assert(ctrlr != NULL);
|
||||
assert(ctrlr->num_qpairs > 0);
|
||||
/* Defer the admin qpair deletion since there are still io qpairs */
|
||||
if ((ctrlr->num_qpairs > 1) && (qpair == ctrlr->admin_qpair)) {
|
||||
spdk_thread_send_msg(qpair->group->thread, ctrlr_delete_qpair, qpair);
|
||||
return;
|
||||
}
|
||||
|
||||
ctrlr->num_qpairs--;
|
||||
TAILQ_REMOVE(&ctrlr->qpairs, qpair, link);
|
||||
|
Loading…
Reference in New Issue
Block a user