Commit a424dcbc authored by GangCao's avatar GangCao Committed by Jim Harris
Browse files

bdevperf: enable multi-core running for less bdevs



If number of bdev is smaller than number of configured
cores, the bdevperf tool will exit abnormally.

Change-Id: I88e08d1bc71af8b927c701c80f6ddd2bf22c659c
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469669


Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 31e77a73
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ struct io_target {

struct io_target **g_head;
uint32_t *g_coremap;
static int g_target_count = 0;
static uint32_t g_target_count = 0;

/*
 * Used to determine how the I/O buffers should be aligned.
@@ -1252,6 +1252,7 @@ bdevperf_test(void)
	struct io_target *target;
	struct spdk_event *event;
	int rc;
	uint32_t core_count = spdk_min(g_target_count, spdk_env_get_core_count());

	rc = bdevperf_construct_targets_tasks();
	if (rc) {
@@ -1269,7 +1270,7 @@ bdevperf_test(void)
	}

	/* Send events to start all I/O */
	for (i = 0; i < spdk_env_get_core_count(); i++) {
	for (i = 0; i < core_count; i++) {
		target = g_head[i];
		if (target == NULL) {
			return -1;