nvmf: move shutdown cleanup to nvmf_tgt app
Change-Id: Ie1f5869dbbea3300d0aeb32e60a95d9a3c7ea535 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
0d2330c2df
commit
8c931adaa4
@ -47,6 +47,7 @@
|
|||||||
#include "spdk/event.h"
|
#include "spdk/event.h"
|
||||||
|
|
||||||
#include "nvmf/transport.h"
|
#include "nvmf/transport.h"
|
||||||
|
#include "nvmf/subsystem.h"
|
||||||
|
|
||||||
#include "spdk/log.h"
|
#include "spdk/log.h"
|
||||||
#include "spdk/nvme.h"
|
#include "spdk/nvme.h"
|
||||||
@ -63,9 +64,15 @@ static struct spdk_poller *g_acceptor_poller = NULL;
|
|||||||
static void
|
static void
|
||||||
acceptor_poller_unregistered_event(struct spdk_event *event)
|
acceptor_poller_unregistered_event(struct spdk_event *event)
|
||||||
{
|
{
|
||||||
spdk_nvmf_acceptor_fini();
|
int rc;
|
||||||
|
|
||||||
spdk_app_stop(0);
|
spdk_nvmf_acceptor_fini();
|
||||||
|
spdk_nvmf_transport_fini();
|
||||||
|
spdk_shutdown_nvmf_subsystems();
|
||||||
|
|
||||||
|
rc = spdk_nvmf_check_pools();
|
||||||
|
|
||||||
|
spdk_app_stop(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -100,7 +100,7 @@ static int spdk_nvmf_check_pool(struct rte_mempool *pool, uint32_t count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
spdk_nvmf_check_pools(void)
|
spdk_nvmf_check_pools(void)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
@ -153,13 +153,6 @@ nvmf_tgt_subsystem_initialize(void)
|
|||||||
static int
|
static int
|
||||||
nvmf_tgt_subsystem_fini(void)
|
nvmf_tgt_subsystem_fini(void)
|
||||||
{
|
{
|
||||||
spdk_shutdown_nvmf_subsystems();
|
|
||||||
spdk_nvmf_transport_fini();
|
|
||||||
|
|
||||||
if (spdk_nvmf_check_pools() != 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,8 @@ struct spdk_nvmf_globals {
|
|||||||
int nvmf_tgt_init(uint16_t max_queue_depth, uint16_t max_conn_per_sess,
|
int nvmf_tgt_init(uint16_t max_queue_depth, uint16_t max_conn_per_sess,
|
||||||
uint32_t in_capsule_data_size, uint32_t max_io_size);
|
uint32_t in_capsule_data_size, uint32_t max_io_size);
|
||||||
|
|
||||||
|
int spdk_nvmf_check_pools(void);
|
||||||
|
|
||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
nvmf_u32log2(uint32_t x)
|
nvmf_u32log2(uint32_t x)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user