test/ioat: ioat_perf app will exit with error code
This change will make sure that ioat_perf application exits with error code 1 whenever there was no test performed. Mainly by checking number of ioat channels available. Other changes made to align with returning 1 on error. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: Id94fa947fd097d5085285d3348aeb41ff280e731 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1672 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
parent
5a48cd9690
commit
454ff1726b
@ -164,7 +164,7 @@ register_workers(void)
|
|||||||
worker = calloc(1, sizeof(*worker));
|
worker = calloc(1, sizeof(*worker));
|
||||||
if (worker == NULL) {
|
if (worker == NULL) {
|
||||||
fprintf(stderr, "Unable to allocate worker\n");
|
fprintf(stderr, "Unable to allocate worker\n");
|
||||||
return -1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
worker->core = i;
|
worker->core = i;
|
||||||
@ -341,7 +341,7 @@ submit_xfers(struct ioat_chan_entry *ioat_chan_entry, uint64_t queue_depth)
|
|||||||
ioat_task = spdk_mempool_get(ioat_chan_entry->task_pool);
|
ioat_task = spdk_mempool_get(ioat_chan_entry->task_pool);
|
||||||
if (!ioat_task) {
|
if (!ioat_task) {
|
||||||
fprintf(stderr, "Unable to get ioat_task\n");
|
fprintf(stderr, "Unable to get ioat_task\n");
|
||||||
return -1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
submit_single_xfer(ioat_chan_entry, ioat_task, dst, src);
|
submit_single_xfer(ioat_chan_entry, ioat_task, dst, src);
|
||||||
@ -365,8 +365,8 @@ work_fn(void *arg)
|
|||||||
/* begin to submit transfers */
|
/* begin to submit transfers */
|
||||||
t->waiting_for_flush = 0;
|
t->waiting_for_flush = 0;
|
||||||
t->flush_threshold = g_user_config.queue_depth / 2;
|
t->flush_threshold = g_user_config.queue_depth / 2;
|
||||||
if (submit_xfers(t, g_user_config.queue_depth) < 0) {
|
if (submit_xfers(t, g_user_config.queue_depth) != 0) {
|
||||||
return -1;
|
return 1;
|
||||||
}
|
}
|
||||||
t = t->next;
|
t = t->next;
|
||||||
}
|
}
|
||||||
@ -403,7 +403,7 @@ init(void)
|
|||||||
opts.name = "ioat_perf";
|
opts.name = "ioat_perf";
|
||||||
opts.core_mask = g_user_config.core_mask;
|
opts.core_mask = g_user_config.core_mask;
|
||||||
if (spdk_env_init(&opts) < 0) {
|
if (spdk_env_init(&opts) < 0) {
|
||||||
return -1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -478,7 +478,7 @@ associate_workers_with_chan(void)
|
|||||||
while (chan != NULL) {
|
while (chan != NULL) {
|
||||||
t = calloc(1, sizeof(struct ioat_chan_entry));
|
t = calloc(1, sizeof(struct ioat_chan_entry));
|
||||||
if (!t) {
|
if (!t) {
|
||||||
return -1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
t->ioat_chan_id = i;
|
t->ioat_chan_id = i;
|
||||||
@ -534,18 +534,18 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (register_workers() != 0) {
|
if (register_workers() != 0) {
|
||||||
rc = -1;
|
rc = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioat_init() != 0) {
|
if (ioat_init() != 0) {
|
||||||
rc = -1;
|
rc = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_ioat_chan_num == 0) {
|
if (g_ioat_chan_num == 0) {
|
||||||
printf("No channels found\n");
|
printf("No channels found\n");
|
||||||
rc = 0;
|
rc = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,7 +560,7 @@ main(int argc, char **argv)
|
|||||||
dump_user_config(&g_user_config);
|
dump_user_config(&g_user_config);
|
||||||
|
|
||||||
if (associate_workers_with_chan() != 0) {
|
if (associate_workers_with_chan() != 0) {
|
||||||
rc = -1;
|
rc = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,7 +580,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
assert(master_worker != NULL);
|
assert(master_worker != NULL);
|
||||||
rc = work_fn(master_worker);
|
rc = work_fn(master_worker);
|
||||||
if (rc < 0) {
|
if (rc != 0) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user