Commit 8c931ada authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf: move shutdown cleanup to nvmf_tgt app



Change-Id: Ie1f5869dbbea3300d0aeb32e60a95d9a3c7ea535
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 0d2330c2
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
#include "spdk/event.h"

#include "nvmf/transport.h"
#include "nvmf/subsystem.h"

#include "spdk/log.h"
#include "spdk/nvme.h"
@@ -63,9 +64,15 @@ static struct spdk_poller *g_acceptor_poller = NULL;
static void
acceptor_poller_unregistered_event(struct spdk_event *event)
{
	int rc;

	spdk_nvmf_acceptor_fini();
	spdk_nvmf_transport_fini();
	spdk_shutdown_nvmf_subsystems();

	spdk_app_stop(0);
	rc = spdk_nvmf_check_pools();

	spdk_app_stop(rc);
}

static void
+1 −8
Original line number Diff line number Diff line
@@ -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)
{
	int rc = 0;
@@ -153,13 +153,6 @@ nvmf_tgt_subsystem_initialize(void)
static int
nvmf_tgt_subsystem_fini(void)
{
	spdk_shutdown_nvmf_subsystems();
	spdk_nvmf_transport_fini();

	if (spdk_nvmf_check_pools() != 0) {
		return -1;
	}

	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -75,6 +75,8 @@ struct spdk_nvmf_globals {
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);

int spdk_nvmf_check_pools(void);

static inline uint32_t
nvmf_u32log2(uint32_t x)
{