[v1,6/6] lib/power: switch empty poll to max cores config
Checks
Commit Message
empty poll algorithm uses NUM_NODES as 256, but should really use
RTE_MAX_LCORE, which is configurable.
Signed-off-by: David Hunt <david.hunt@intel.com>
---
lib/power/rte_power_empty_poll.c | 12 ++++++------
lib/power/rte_power_empty_poll.h | 4 +---
2 files changed, 7 insertions(+), 9 deletions(-)
@@ -373,7 +373,7 @@ rte_empty_poll_detection(struct rte_timer *tim, void *arg)
RTE_SET_USED(arg);
- for (i = 0; i < NUM_NODES; i++) {
+ for (i = 0; i < RTE_MAX_LCORE; i++) {
poll_stats = &(ep_params->wrk_data.wrk_stats[i]);
@@ -436,7 +436,7 @@ rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,
*eptr = ep_params;
/* initialize all wrk_stats state */
- for (i = 0; i < NUM_NODES; i++) {
+ for (i = 0; i < RTE_MAX_LCORE; i++) {
if (rte_lcore_is_enabled(i) == 0)
continue;
@@ -476,7 +476,7 @@ rte_power_empty_poll_stat_update(unsigned int lcore_id)
{
struct priority_worker *poll_stats;
- if (lcore_id >= NUM_NODES)
+ if (lcore_id >= RTE_MAX_LCORE)
return -1;
poll_stats = &(ep_params->wrk_data.wrk_stats[lcore_id]);
@@ -495,7 +495,7 @@ rte_power_poll_stat_update(unsigned int lcore_id, uint8_t nb_pkt)
struct priority_worker *poll_stats;
- if (lcore_id >= NUM_NODES)
+ if (lcore_id >= RTE_MAX_LCORE)
return -1;
poll_stats = &(ep_params->wrk_data.wrk_stats[lcore_id]);
@@ -514,7 +514,7 @@ rte_power_empty_poll_stat_fetch(unsigned int lcore_id)
{
struct priority_worker *poll_stats;
- if (lcore_id >= NUM_NODES)
+ if (lcore_id >= RTE_MAX_LCORE)
return -1;
poll_stats = &(ep_params->wrk_data.wrk_stats[lcore_id]);
@@ -530,7 +530,7 @@ rte_power_poll_stat_fetch(unsigned int lcore_id)
{
struct priority_worker *poll_stats;
- if (lcore_id >= NUM_NODES)
+ if (lcore_id >= RTE_MAX_LCORE)
return -1;
poll_stats = &(ep_params->wrk_data.wrk_stats[lcore_id]);
@@ -31,8 +31,6 @@ extern "C" {
#define NUM_PRIORITIES 2
-#define NUM_NODES 256 /* Max core number*/
-
/* Processor Power State */
enum freq_val {
LOW,
@@ -98,7 +96,7 @@ struct priority_worker {
struct stats_data {
- struct priority_worker wrk_stats[NUM_NODES];
+ struct priority_worker wrk_stats[RTE_MAX_LCORE];
/* flag to stop rx threads processing packets until training over */
bool start_rx;