Loading include/spdk/nvmf.h +5 −4 Original line number Diff line number Diff line Loading @@ -137,6 +137,7 @@ struct spdk_nvmf_subsystem { struct spdk_nvme_ctrlr *ctrlr; struct spdk_nvme_qpair *io_qpair; struct spdk_pci_addr pci_addr; struct spdk_poller *admin_poller; } direct; struct { Loading lib/nvmf/direct.c +23 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #include "spdk/nvmf_spec.h" #include "spdk/trace.h" #include "spdk/util.h" #include "spdk/event.h" #include "spdk_internal/log.h" Loading @@ -52,9 +53,26 @@ nvmf_direct_ctrlr_get_data(struct spdk_nvmf_session *session) } static void nvmf_direct_ctrlr_poll_for_completions(struct spdk_nvmf_subsystem *subsystem) nvmf_direct_ctrlr_poll_for_admin_completions(void *arg) { struct spdk_nvmf_subsystem *subsystem = arg; spdk_nvme_ctrlr_process_admin_completions(subsystem->dev.direct.ctrlr); } static void nvmf_direct_ctrlr_poll_for_completions(struct spdk_nvmf_subsystem *subsystem) { if (subsystem->dev.direct.admin_poller == NULL) { int lcore = spdk_app_get_current_core(); spdk_poller_register(&subsystem->dev.direct.admin_poller, nvmf_direct_ctrlr_poll_for_admin_completions, subsystem, lcore, 10000); } nvmf_direct_ctrlr_poll_for_admin_completions(subsystem); spdk_nvme_qpair_process_completions(subsystem->dev.direct.io_qpair, 0); } Loading Loading @@ -244,6 +262,10 @@ static void nvmf_direct_ctrlr_detach(struct spdk_nvmf_subsystem *subsystem) { if (subsystem->dev.direct.ctrlr) { if (subsystem->dev.direct.admin_poller != NULL) { spdk_poller_unregister(&subsystem->dev.direct.admin_poller, NULL); } spdk_nvme_detach(subsystem->dev.direct.ctrlr); } } Loading test/lib/nvmf/direct/direct_ut.c +19 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,25 @@ SPDK_LOG_REGISTER_TRACE_FLAG("nvmf", SPDK_TRACE_NVMF) uint32_t spdk_app_get_current_core(void) { return 0; } void spdk_poller_register(struct spdk_poller **ppoller, spdk_poller_fn fn, void *arg, uint32_t lcore, uint64_t period_microseconds) { return; } void spdk_poller_unregister(struct spdk_poller **ppoller, struct spdk_event *complete) { return; } int32_t spdk_nvme_ctrlr_process_admin_completions(struct spdk_nvme_ctrlr *ctrlr) { Loading Loading
include/spdk/nvmf.h +5 −4 Original line number Diff line number Diff line Loading @@ -137,6 +137,7 @@ struct spdk_nvmf_subsystem { struct spdk_nvme_ctrlr *ctrlr; struct spdk_nvme_qpair *io_qpair; struct spdk_pci_addr pci_addr; struct spdk_poller *admin_poller; } direct; struct { Loading
lib/nvmf/direct.c +23 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #include "spdk/nvmf_spec.h" #include "spdk/trace.h" #include "spdk/util.h" #include "spdk/event.h" #include "spdk_internal/log.h" Loading @@ -52,9 +53,26 @@ nvmf_direct_ctrlr_get_data(struct spdk_nvmf_session *session) } static void nvmf_direct_ctrlr_poll_for_completions(struct spdk_nvmf_subsystem *subsystem) nvmf_direct_ctrlr_poll_for_admin_completions(void *arg) { struct spdk_nvmf_subsystem *subsystem = arg; spdk_nvme_ctrlr_process_admin_completions(subsystem->dev.direct.ctrlr); } static void nvmf_direct_ctrlr_poll_for_completions(struct spdk_nvmf_subsystem *subsystem) { if (subsystem->dev.direct.admin_poller == NULL) { int lcore = spdk_app_get_current_core(); spdk_poller_register(&subsystem->dev.direct.admin_poller, nvmf_direct_ctrlr_poll_for_admin_completions, subsystem, lcore, 10000); } nvmf_direct_ctrlr_poll_for_admin_completions(subsystem); spdk_nvme_qpair_process_completions(subsystem->dev.direct.io_qpair, 0); } Loading Loading @@ -244,6 +262,10 @@ static void nvmf_direct_ctrlr_detach(struct spdk_nvmf_subsystem *subsystem) { if (subsystem->dev.direct.ctrlr) { if (subsystem->dev.direct.admin_poller != NULL) { spdk_poller_unregister(&subsystem->dev.direct.admin_poller, NULL); } spdk_nvme_detach(subsystem->dev.direct.ctrlr); } } Loading
test/lib/nvmf/direct/direct_ut.c +19 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,25 @@ SPDK_LOG_REGISTER_TRACE_FLAG("nvmf", SPDK_TRACE_NVMF) uint32_t spdk_app_get_current_core(void) { return 0; } void spdk_poller_register(struct spdk_poller **ppoller, spdk_poller_fn fn, void *arg, uint32_t lcore, uint64_t period_microseconds) { return; } void spdk_poller_unregister(struct spdk_poller **ppoller, struct spdk_event *complete) { return; } int32_t spdk_nvme_ctrlr_process_admin_completions(struct spdk_nvme_ctrlr *ctrlr) { Loading