Commit 3daf1f00 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

dpdk_governor: use rte_power_set_env() to reduce noisy log messages



If an application doesn't set the power env explicitly, DPDK will
just iterate through them one at a time until it finds one that
works. This clutters the log with error messages about the ones that
didn't work. So use the rte_power_check_env_supported() API to
iterate through them ourselves (just like DPDK does) and set the
first one that we find.

From what I can see, only one can ever work. So SPDK iterates through
the DPDK enum in order, even though DPDK does them out of order when
it needs to find one because the user didn't set one.

While here, set the DPDK rte_power log level to WARNING, which also
eliminates a ton of noisy messages when enabling the governor. While
adding this, we noticed that cryptodev flag here is setting WARNING
but the comment says ERR, so fix that comment while here.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I5cb2552d3b41235884577669bd574f88ca944f2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23408


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent f838343c
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
		return -1;
	}

	/* Lower default CRYPTO loglevel to RTE_LOG_ERR to avoid a ton of init msgs.
	/* Lower default CRYPTO loglevel to RTE_LOG_WARNING to avoid a ton of init msgs.
	 * This can be overridden by specifying the same option in opts->env_context
	 */
	args = push_arg(args, &argcount, strdup("--log-level=lib.cryptodev:5"));
@@ -411,6 +411,14 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
		return -1;
	}

	/* Lower default POWER loglevel to RTE_LOG_WARNING to avoid a ton of init msgs.
	 * This can be overridden by specifying the same option in opts->env_context
	 */
	args = push_arg(args, &argcount, strdup("--log-level=lib.power:5"));
	if (args == NULL) {
		return -1;
	}

	/* `user1` log type is used by rte_vhost, which prints an INFO log for each received
	 * vhost user message. We don't want that. The same log type is also used by a couple
	 * of other DPDK libs, but none of which we make use right now. If necessary, this can
+13 −0
Original line number Diff line number Diff line
@@ -154,6 +154,17 @@ _init(void)
	uint32_t i, j;
	int rc = 0;

#if RTE_VERSION >= RTE_VERSION_NUM(23, 11, 0, 0)
	for (i = PM_ENV_ACPI_CPUFREQ; i <= PM_ENV_AMD_PSTATE_CPUFREQ; i++) {
#else
	for (i = PM_ENV_ACPI_CPUFREQ; i <= PM_ENV_CPPC_CPUFREQ; i++) {
#endif
		if (rte_power_check_env_supported(i) == 1) {
			rte_power_set_env(i);
			break;
		}
	}

	SPDK_ENV_FOREACH_CORE(i) {
		rc = _init_core(i);
		if (rc != 0) {
@@ -175,6 +186,7 @@ _init(void)
			SPDK_ERRLOG("Failed to deinitialize on core%d\n", j);
		}
	}
	rte_power_unset_env();
	return rc;
}

@@ -188,6 +200,7 @@ _deinit(void)
			SPDK_ERRLOG("Failed to deinitialize on core%d\n", i);
		}
	}
	rte_power_unset_env();
}

static struct spdk_governor dpdk_governor = {