bdevperf: Allocate io_channel when job is constructed
No reason to delay until the I/O submit function. Do it up front and fail if it can't get one. Signed-off-by: Ben Walker <benjamin.walker@intel.com> Change-Id: I646bc68f8dd7207667e546f7be44464909fa2cc4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1511 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
bc2fdcb280
commit
5eb39c80ad
@ -851,16 +851,6 @@ bdevperf_submit_on_reactor(struct spdk_io_channel_iter *i)
|
||||
/* Submit initial I/O for each block device. Each time one
|
||||
* completes, another will be submitted. */
|
||||
TAILQ_FOREACH(job, &reactor->jobs, link) {
|
||||
job->ch = spdk_bdev_get_io_channel(job->bdev_desc);
|
||||
if (!job->ch) {
|
||||
printf("Skip this device (%s) as IO channel not setup.\n",
|
||||
spdk_bdev_get_name(job->bdev));
|
||||
g_bdevperf.running_jobs--;
|
||||
g_run_rc = -1;
|
||||
spdk_bdev_close(job->bdev_desc);
|
||||
continue;
|
||||
}
|
||||
|
||||
bdevperf_job_run(job);
|
||||
}
|
||||
|
||||
@ -1050,9 +1040,18 @@ _bdevperf_construct_job(void *ctx)
|
||||
if (rc != 0) {
|
||||
SPDK_ERRLOG("Could not open leaf bdev %s, error=%d\n", spdk_bdev_get_name(job->bdev), rc);
|
||||
g_run_rc = -EINVAL;
|
||||
return;
|
||||
goto end;
|
||||
}
|
||||
|
||||
job->ch = spdk_bdev_get_io_channel(job->bdev_desc);
|
||||
if (!job->ch) {
|
||||
SPDK_ERRLOG("Could not get io_channel for device %s, error=%d\n", spdk_bdev_get_name(job->bdev),
|
||||
rc);
|
||||
g_run_rc = -ENOMEM;
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
spdk_thread_send_msg(g_master_thread, _bdevperf_construct_job_done, NULL);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user