test/bdev: handle the error case the IO channel is not setup

This issue may be hit under some large IO and large queue
depth cases where much memory will be consumed and the channel
may be failed to create due to insufficient memory.

The general fix here is that we need to properly handle
the error case that the channel is not created due to this
or that reason.

Change-Id: Icf58a7c8a9cba625ef1b8da6b8bf68ef72ef5546
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/386051
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
GangCao 2017-11-07 01:30:09 -05:00 committed by Jim Harris
parent 24c8d965b0
commit 5aae23aa08

View File

@ -495,6 +495,16 @@ bdevperf_submit_on_core(void *arg1, void *arg2)
* completes, another will be submitted. */ * completes, another will be submitted. */
while (target != NULL) { while (target != NULL) {
target->ch = spdk_bdev_get_io_channel(target->bdev_desc); target->ch = spdk_bdev_get_io_channel(target->bdev_desc);
if (!target->ch) {
printf("Skip this device (%s) as IO channel not setup.\n",
spdk_bdev_get_name(target->bdev));
g_target_count--;
g_run_failed = true;
spdk_bdev_close(target->bdev_desc);
target = target->next;
continue;
}
/* Start a timer to stop this I/O chain when the run is over */ /* Start a timer to stop this I/O chain when the run is over */
target->run_timer = spdk_poller_register(end_target, target, target->run_timer = spdk_poller_register(end_target, target,