Skip to contentSkip to conversation

Destroy QP process in nvmf

SPDK Vikas Gupta 1 participant 1 message Jan 1, 2019

lore
Share & tools
lore

Vikas Gupta

author
#0 lore raw

Hi,

I would like to draw attention in destroy QP process in nvmf that there is possibility that requests could be processed even after destroy QP in one of the scenario.

When a disk (hot plug) is removed from the target the related subsystem is paused and in fly requests are queued as below in nvmf/request.c

*/* Check if the subsystem is paused (if there is a subsystem) */*

* if (qpair->ctrlr) {*

* struct spdk_nvmf_subsystem_poll_group *sgroup =
&qpair->group->sgroups[qpair->ctrlr->subsys->id];*

* if (sgroup->state != SPDK_NVMF_SUBSYSTEM_ACTIVE) {*

* /* The subsystem is not currently active. Queue
this request. */*

* TAILQ_INSERT_TAIL(&sgroup->queued, req, link);*

* return;*

* }*

* } *

By the time system is resumed the QP would have been destroyed and we may still process the stale QP`s requests with below code in nvmf.c function spdk_nvmf_poll_group_resume_subsystem().

* /* Release all queued requests */*

* TAILQ_FOREACH_SAFE(req, &sgroup->queued, link, tmp) {*

* TAILQ_REMOVE(&sgroup->queued, req, link);*

* spdk_nvmf_request_exec(req);*

* } *

I think we should remove the stale QP requests from the sgroup`s queue before we destroy the QP.

Please let me know if my understanding is correct.

Thanks,

Vikas