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: sunshihao <sunshihao@huawei.com>
Signed-off-by: suweifeng <suweifeng1@huawei.com>
Change-Id: I0bd99ba473c8cb6f68045e3009db50cf2e392dd3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5019
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
sunshihao520 2020-11-04 15:48:46 +08:00 committed by Tomasz Zawadzki
parent 686401ebf2
commit 4237d2d8cb
3 changed files with 6 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}