DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: David Hunt <david.hunt@intel.com>
To: dev@dpdk.org
Cc: david.hunt@intel.com
Subject: [dpdk-dev] [PATCH v1] examples/power: fix busyness number limed to 50%
Date: Mon, 15 Jul 2019 15:07:04 +0100
Message-ID: <20190715140704.27221-1-david.hunt@intel.com> (raw)

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 <david.hunt@intel.com>
---
 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


             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 14:07 David Hunt [this message]
2019-07-16 13:50 ` Burakov, Anatoly
2019-07-17 20:49   ` Thomas Monjalon

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190715140704.27221-1-david.hunt@intel.com \
    --to=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox