lib/event: remove fields from spdk_governor_capabilities

The spdk_governor_capabilities added lots of capabilities
which went unused, suposedly to mark which callbacks
a governor had implemented.

This made little sense, since capabilities are per core and
not implmenting this APIs made little sense.
With this patch spdk_governor_capabilities is brought in
line with rte_power_core_capabilities.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I85296fce2999cb41957162b63ee13d86a0be919f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8787
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Tomasz Zawadzki 2021-07-13 06:21:01 -04:00
parent ae74e70eff
commit 7bf66ff5ac
5 changed files with 5 additions and 30 deletions

View File

@ -164,13 +164,6 @@ int spdk_reactor_set_interrupt_mode(uint32_t lcore, bool new_in_interrupt,
struct spdk_thread *_spdk_get_app_thread(void); struct spdk_thread *_spdk_get_app_thread(void);
struct spdk_governor_capabilities { struct spdk_governor_capabilities {
bool freq_change;
bool freq_getset;
bool freq_up;
bool freq_down;
bool freq_max;
bool freq_min;
bool turbo_set;
bool turbo_available; bool turbo_available;
bool priority; bool priority;
}; };

View File

@ -388,7 +388,6 @@ _rpc_framework_get_reactors(void *arg1, void *arg2)
struct spdk_thread *thread; struct spdk_thread *thread;
struct spdk_cpuset tmp_mask = {}; struct spdk_cpuset tmp_mask = {};
struct spdk_governor *governor; struct spdk_governor *governor;
struct spdk_governor_capabilities capabilities;
current_core = spdk_env_get_current_core(); current_core = spdk_env_get_current_core();
reactor = spdk_reactor_get(current_core); reactor = spdk_reactor_get(current_core);
@ -401,13 +400,10 @@ _rpc_framework_get_reactors(void *arg1, void *arg2)
spdk_json_write_named_uint64(ctx->w, "idle", reactor->idle_tsc); spdk_json_write_named_uint64(ctx->w, "idle", reactor->idle_tsc);
governor = _spdk_governor_get(); governor = _spdk_governor_get();
/* We need to check whether governor can return current core frequency. */ /* We need to check whether governor can return current core frequency. */
if (governor->get_core_capabilities && governor->get_core_freqs) { if (governor->get_core_curr_freq != NULL) {
governor->get_core_capabilities(current_core, &capabilities); /* Governor returns core freqs in kHz, we want MHz. */
if (capabilities.freq_getset) { curr_core_freq = governor->get_core_curr_freq(current_core) / 1000;
/* Governor returns core freqs in kHz, we want MHz. */ spdk_json_write_named_uint32(ctx->w, "core_freq", curr_core_freq);
curr_core_freq = governor->get_core_curr_freq(current_core) / 1000;
spdk_json_write_named_uint32(ctx->w, "core_freq", curr_core_freq);
}
} }
spdk_json_write_named_array_begin(ctx->w, "lw_threads"); spdk_json_write_named_array_begin(ctx->w, "lw_threads");

View File

@ -131,13 +131,6 @@ _get_core_capabilities(uint32_t lcore_id, struct spdk_governor_capabilities *cap
capabilities->turbo_available = caps.turbo == 0 ? false : true; capabilities->turbo_available = caps.turbo == 0 ? false : true;
capabilities->priority = caps.priority == 0 ? false : true; capabilities->priority = caps.priority == 0 ? false : true;
capabilities->freq_change = true;
capabilities->freq_getset = true;
capabilities->freq_up = true;
capabilities->freq_down = true;
capabilities->freq_max = true;
capabilities->freq_min = true;
capabilities->turbo_set = true;
return 0; return 0;
} }

View File

@ -87,7 +87,7 @@ balance(struct spdk_scheduler_core_info *cores, int core_count, struct spdk_gove
return; return;
} }
turbo_available = (capabilities.turbo_available && capabilities.turbo_set) ? true : false; turbo_available = (capabilities.turbo_available) ? true : false;
if (core->total_busy_tsc < (core->total_idle_tsc / 1000)) { if (core->total_busy_tsc < (core->total_idle_tsc / 1000)) {
rc = governor->set_core_freq_min(core->lcore); rc = governor->set_core_freq_min(core->lcore);

View File

@ -1475,13 +1475,6 @@ reactor_interrupt_fini(struct spdk_reactor *reactor)
static int static int
_governor_get_capabilities(uint32_t lcore_id, struct spdk_governor_capabilities *capabilities) _governor_get_capabilities(uint32_t lcore_id, struct spdk_governor_capabilities *capabilities)
{ {
capabilities->freq_change = false;
capabilities->freq_getset = false;
capabilities->freq_up = false;
capabilities->freq_down = false;
capabilities->freq_max = false;
capabilities->freq_min = false;
capabilities->turbo_set = false;
capabilities->priority = false; capabilities->priority = false;
capabilities->turbo_available = false; capabilities->turbo_available = false;