From patchwork Thu Sep 9 13:45:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 98435 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DBA35A0547; Thu, 9 Sep 2021 15:46:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90CB641175; Thu, 9 Sep 2021 15:45:34 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 32ABC41162 for ; Thu, 9 Sep 2021 15:45:32 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="243103609" X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="243103609" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 06:45:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="449979553" Received: from silpixa00399952.ir.intel.com ([10.55.129.13]) by orsmga002.jf.intel.com with ESMTP; 09 Sep 2021 06:45:30 -0700 From: David Hunt To: dev@dpdk.org Cc: bruce.richardson@intel.com, David Hunt Date: Thu, 9 Sep 2021 14:45:11 +0100 Message-Id: <20210909134511.18871-7-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210909134511.18871-1-david.hunt@intel.com> References: <20210909134511.18871-1-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v1 6/6] lib/power: switch empty poll to max cores config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" empty poll algorithm uses NUM_NODES as 256, but should really use RTE_MAX_LCORE, which is configurable. Signed-off-by: David Hunt --- lib/power/rte_power_empty_poll.c | 12 ++++++------ lib/power/rte_power_empty_poll.h | 4 +--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c index 975aa92997..fe20b9f7b2 100644 --- a/lib/power/rte_power_empty_poll.c +++ b/lib/power/rte_power_empty_poll.c @@ -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]); diff --git a/lib/power/rte_power_empty_poll.h b/lib/power/rte_power_empty_poll.h index 6ba0a37074..22678b4f4b 100644 --- a/lib/power/rte_power_empty_poll.h +++ b/lib/power/rte_power_empty_poll.h @@ -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;