Commit 4237d2d8 authored by sunshihao520's avatar sunshihao520 Committed by Tomasz Zawadzki
Browse files

lib/thead: print error log when create mempool or ring failed



Add debug information when call spdk_mempool_create or spdk_ring_create to create resource for spdk failed.

Signed-off-by: default avatarsunshihao <sunshihao@huawei.com>
Signed-off-by: default avatarsuweifeng <suweifeng1@huawei.com>
Change-Id: I0bd99ba473c8cb6f68045e3009db50cf2e392dd3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5019


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent 686401eb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ env_allocator_create(uint32_t size, const char *name)
			     SPDK_ENV_SOCKET_ID_ANY);

	if (!allocator->mempool) {
		SPDK_ERRLOG("mempool creation failed\n");
		free(allocator);
		return NULL;
	}
+4 −1
Original line number Diff line number Diff line
@@ -162,7 +162,10 @@ reactor_construct(struct spdk_reactor *reactor, uint32_t lcore)
	reactor->thread_count = 0;

	reactor->events = spdk_ring_create(SPDK_RING_TYPE_MP_SC, 65536, SPDK_ENV_SOCKET_ID_ANY);
	assert(reactor->events != NULL);
	if (reactor->events == NULL) {
		SPDK_ERRLOG("Failed to allocate events ring\n");
		assert(false);
	}

	if (spdk_interrupt_mode_is_enabled()) {
		reactor_interrupt_init(reactor);
+1 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ _thread_lib_init(size_t ctx_sz)
			     SPDK_ENV_SOCKET_ID_ANY);

	if (!g_spdk_msg_mempool) {
		SPDK_ERRLOG("spdk_msg_mempool creation failed\n");
		return -1;
	}