From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C849A0471 for ; Mon, 15 Jul 2019 16:07:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 109F41B9C9; Mon, 15 Jul 2019 16:07:11 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 341411B993 for ; Mon, 15 Jul 2019 16:07:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 07:07:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,493,1557212400"; d="scan'208";a="157825044" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.222.88]) by orsmga007.jf.intel.com with ESMTP; 15 Jul 2019 07:07:06 -0700 From: David Hunt To: dev@dpdk.org Cc: david.hunt@intel.com Date: Mon, 15 Jul 2019 15:07:04 +0100 Message-Id: <20190715140704.27221-1-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] examples/power: fix busyness number limed to 50% X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Current implementation only outputs 3 numbers for busyness, 0, 50 and 100. Fix this so that the 50% is replaced by a curve, more meaningful. This can be replaced in each use case by a suitable calculation for that use case. Fixes: 609e79841fcf ("examples/l3fwd-power: add telemetry mode") Signed-off-by: David Hunt --- examples/l3fwd-power/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 7a95605c4..cbe8f8e3f 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -184,8 +184,8 @@ enum busy_rate { * reference CYCLES to be used to * measure core busyness based on poll count */ -#define MIN_CYCLES 1500000ULL -#define MAX_CYCLES 2500000ULL +#define MIN_CYCLES 1500000ULL +#define MAX_CYCLES 22000000ULL /* (500ms) */ #define TELEMETRY_INTERVALS_PER_SEC 2 @@ -1034,7 +1034,7 @@ main_telemetry_loop(__attribute__((unused)) void *dummy) br = FULL; } else if (diff_tsc > MIN_CYCLES && diff_tsc < MAX_CYCLES) { - br = PARTIAL; + br = (diff_tsc * 100) / MAX_CYCLES; } else { br = ZERO; } -- 2.17.1