Commit 120a6c1c authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

nvmf: do not encode core number into thread name



The nvmf subsystem cannot control which core its
threads get scheduled on.  Even in the normal, default
case, the app thread has already been scheduled on the
first core, so the first nvmf thread will get
scheduled on the second core, etc.

So instead, always use a 0-based index for the names
of the nvmf threads.

Reported-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I8a0f161860b985f36920845de28b39dbae9fdca5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11351


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
parent 236cc3a1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -209,18 +209,18 @@ nvmf_tgt_create_poll_group(void *ctx)
static void
nvmf_tgt_create_poll_groups(void)
{
	uint32_t i;
	uint32_t cpu, count = 0;
	char thread_name[32];
	struct spdk_thread *thread;

	g_tgt_init_thread = spdk_get_thread();
	assert(g_tgt_init_thread != NULL);

	SPDK_ENV_FOREACH_CORE(i) {
		if (g_poll_groups_mask && !spdk_cpuset_get_cpu(g_poll_groups_mask, i)) {
	SPDK_ENV_FOREACH_CORE(cpu) {
		if (g_poll_groups_mask && !spdk_cpuset_get_cpu(g_poll_groups_mask, cpu)) {
			continue;
		}
		snprintf(thread_name, sizeof(thread_name), "nvmf_tgt_poll_group_%u", i);
		snprintf(thread_name, sizeof(thread_name), "nvmf_tgt_poll_group_%u", count++);

		thread = spdk_thread_create(thread_name, g_poll_groups_mask);
		assert(thread != NULL);