lib/nvme: update io msg producers on ns manage
Change-Id: I20adb92ae4e13e775b5e70617c705afd32e16c9e Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/681 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
2b9a331d0b
commit
550d4867a0
@ -1223,6 +1223,15 @@ out:
|
||||
|
||||
nvme_robust_mutex_unlock(&ctrlr->ctrlr_lock);
|
||||
|
||||
if (!ctrlr->cdata.oaes.ns_attribute_notices) {
|
||||
/*
|
||||
* If controller doesn't support ns_attribute_notices and
|
||||
* namespace attributes change (e.g. number of namespaces)
|
||||
* we need to update system handling device reset.
|
||||
*/
|
||||
nvme_io_msg_ctrlr_update(ctrlr);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -2066,6 +2075,7 @@ nvme_ctrlr_async_event_cb(void *arg, const struct spdk_nvme_cpl *cpl)
|
||||
return;
|
||||
}
|
||||
nvme_ctrlr_update_namespaces(ctrlr);
|
||||
nvme_io_msg_ctrlr_update(ctrlr);
|
||||
}
|
||||
|
||||
active_proc = nvme_ctrlr_get_current_process(ctrlr);
|
||||
|
@ -1006,6 +1006,7 @@ nvme_cuse_update(struct spdk_nvme_ctrlr *ctrlr)
|
||||
static struct nvme_io_msg_producer cuse_nvme_io_msg_producer = {
|
||||
.name = "cuse",
|
||||
.stop = nvme_cuse_stop,
|
||||
.update = nvme_cuse_update,
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -164,6 +164,17 @@ nvme_io_msg_ctrlr_register(struct spdk_nvme_ctrlr *ctrlr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
nvme_io_msg_ctrlr_update(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
struct nvme_io_msg_producer *io_msg_producer;
|
||||
|
||||
/* Update all producers */
|
||||
STAILQ_FOREACH(io_msg_producer, &ctrlr->io_producers, link) {
|
||||
io_msg_producer->update(ctrlr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nvme_io_msg_ctrlr_detach(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
|
@ -52,6 +52,7 @@ struct spdk_nvme_io_msg {
|
||||
|
||||
struct nvme_io_msg_producer {
|
||||
const char *name;
|
||||
void (*update)(struct spdk_nvme_ctrlr *ctrlr);
|
||||
void (*stop)(struct spdk_nvme_ctrlr *ctrlr);
|
||||
STAILQ_ENTRY(nvme_io_msg_producer) link;
|
||||
};
|
||||
@ -84,5 +85,6 @@ int nvme_io_msg_ctrlr_register(struct spdk_nvme_ctrlr *ctrlr,
|
||||
void nvme_io_msg_ctrlr_unregister(struct spdk_nvme_ctrlr *ctrlr,
|
||||
struct nvme_io_msg_producer *io_msg_producer);
|
||||
void nvme_io_msg_ctrlr_detach(struct spdk_nvme_ctrlr *ctrlr);
|
||||
void nvme_io_msg_ctrlr_update(struct spdk_nvme_ctrlr *ctrlr);
|
||||
|
||||
#endif /* SPDK_NVME_IO_MSG_H_ */
|
||||
|
@ -70,6 +70,7 @@ DEFINE_STUB_V(nvme_ns_set_identify_data, (struct spdk_nvme_ns *ns));
|
||||
DEFINE_STUB_V(nvme_qpair_abort_reqs, (struct spdk_nvme_qpair *qpair, uint32_t dnr));
|
||||
DEFINE_STUB(spdk_nvme_poll_group_remove, int, (struct spdk_nvme_poll_group *group,
|
||||
struct spdk_nvme_qpair *qpair), 0);
|
||||
DEFINE_STUB_V(nvme_io_msg_ctrlr_update, (struct spdk_nvme_ctrlr *ctrlr));
|
||||
|
||||
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
|
Loading…
Reference in New Issue
Block a user