nvme: Fail the qpair if it is marked as failure when process the completion queue.
This make sure the qpair failure could be started from upper level application. Change-Id: I7e04fe36929cc634ddf0078db96fbc40afb38f8c Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
This commit is contained in:
parent
919c4b540e
commit
5f3e922a6a
@ -346,16 +346,14 @@ nvme_ctrlr_set_supported_features(struct spdk_nvme_ctrlr *ctrlr)
|
|||||||
void
|
void
|
||||||
nvme_ctrlr_fail(struct spdk_nvme_ctrlr *ctrlr, bool hot_remove)
|
nvme_ctrlr_fail(struct spdk_nvme_ctrlr *ctrlr, bool hot_remove)
|
||||||
{
|
{
|
||||||
struct spdk_nvme_qpair *qpair;
|
/*
|
||||||
|
* Set the flag here and leave the work failure of qpairs to
|
||||||
|
* spdk_nvme_qpair_process_completions().
|
||||||
|
*/
|
||||||
if (hot_remove) {
|
if (hot_remove) {
|
||||||
ctrlr->is_removed = true;
|
ctrlr->is_removed = true;
|
||||||
}
|
}
|
||||||
ctrlr->is_failed = true;
|
ctrlr->is_failed = true;
|
||||||
nvme_qpair_fail(ctrlr->adminq);
|
|
||||||
TAILQ_FOREACH(qpair, &ctrlr->active_io_qpairs, tailq) {
|
|
||||||
nvme_qpair_fail(qpair);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1866,6 +1866,11 @@ nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
|
|||||||
uint32_t num_completions = 0;
|
uint32_t num_completions = 0;
|
||||||
struct spdk_nvme_ctrlr *ctrlr = qpair->ctrlr;
|
struct spdk_nvme_ctrlr *ctrlr = qpair->ctrlr;
|
||||||
|
|
||||||
|
if (qpair->ctrlr->is_failed) {
|
||||||
|
nvme_qpair_fail(qpair);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!nvme_pcie_qpair_check_enabled(qpair)) {
|
if (!nvme_pcie_qpair_check_enabled(qpair)) {
|
||||||
/*
|
/*
|
||||||
* qpair is not enabled, likely because a controller reset is
|
* qpair is not enabled, likely because a controller reset is
|
||||||
|
@ -65,6 +65,11 @@ struct io_request {
|
|||||||
bool invalid_second_addr;
|
bool invalid_second_addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
nvme_qpair_fail(struct spdk_nvme_qpair *qpair)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nvme_ctrlr_fail(struct spdk_nvme_ctrlr *ctrlr, bool hot_remove)
|
nvme_ctrlr_fail(struct spdk_nvme_ctrlr *ctrlr, bool hot_remove)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user