DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [PATCH v1] examples/power: fix busyness number limed to 50%
@ 2019-07-15 14:07 David Hunt
  2019-07-16 13:50 ` Burakov, Anatoly
  0 siblings, 1 reply; 3+ messages in thread
From: David Hunt @ 2019-07-15 14:07 UTC (permalink / raw)
  To: dev; +Cc: david.hunt

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v1] examples/power: fix busyness number limed to 50%
  2019-07-15 14:07 [dpdk-dev] [PATCH v1] examples/power: fix busyness number limed to 50% David Hunt
@ 2019-07-16 13:50 ` Burakov, Anatoly
  2019-07-17 20:49   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Burakov, Anatoly @ 2019-07-16 13:50 UTC (permalink / raw)
  To: David Hunt, dev

On 15-Jul-19 3:07 PM, David Hunt wrote:
> 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>
> ---

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v1] examples/power: fix busyness number limed to 50%
  2019-07-16 13:50 ` Burakov, Anatoly
@ 2019-07-17 20:49   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2019-07-17 20:49 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Burakov, Anatoly

16/07/2019 15:50, Burakov, Anatoly:
> On 15-Jul-19 3:07 PM, David Hunt wrote:
> > 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>
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 14:07 [dpdk-dev] [PATCH v1] examples/power: fix busyness number limed to 50% David Hunt
2019-07-16 13:50 ` Burakov, Anatoly
2019-07-17 20:49   ` Thomas Monjalon

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

Example config snippet for mirrors

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