Commit 78a2b8a8 authored by Krishna Kanth Reddy's avatar Krishna Kanth Reddy Committed by Tomasz Zawadzki
Browse files

module/scheduler: macro for max lcore frquencies



Added a new macro for max lcore frequencies instead of using
local variables to hold this value. This matches the DPDK macro
RTE_MAX_LCORE_FREQS.

Change-Id: Id8a893c9826d9f2df4b029bbb24e8ed813e44653
Signed-off-by: default avatarKrishna Kanth Reddy <krish.reddy@samsung.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23637


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent dfb2950f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -17,6 +17,11 @@ extern "C" {
#include "spdk/thread.h"
#include "spdk/util.h"

/**
 * This matches the DPDK macro RTE_MAX_LCORE_FREQS
 */
#define	SPDK_MAX_LCORE_FREQS	64

struct spdk_governor_capabilities {
	bool priority; /* Core with higher base frequency */
};
+3 −4
Original line number Diff line number Diff line
@@ -16,19 +16,18 @@
static uint32_t
_get_core_curr_freq(uint32_t lcore_id)
{
	const uint32_t MAX_CORE_FREQ_NUM = 64;
	uint32_t freqs[MAX_CORE_FREQ_NUM];
	uint32_t freqs[SPDK_MAX_LCORE_FREQS];
	uint32_t freq_index;
	int rc;

	rc = rte_power_freqs(lcore_id, freqs, MAX_CORE_FREQ_NUM);
	rc = rte_power_freqs(lcore_id, freqs, SPDK_MAX_LCORE_FREQS);
	if (!rc) {
		SPDK_ERRLOG("Unable to get current core frequency array for core %d\n.", lcore_id);

		return 0;
	}
	freq_index = rte_power_get_freq(lcore_id);
	if (freq_index >= MAX_CORE_FREQ_NUM) {
	if (freq_index >= SPDK_MAX_LCORE_FREQS) {
		SPDK_ERRLOG("Unable to get current core frequency for core %d\n.", lcore_id);

		return 0;