Thread (7 messages) 7 messages, 3 authors, 2021-07-10

Re: [dpdk-dev] [PATCH v1] examples/power: add baseline mode to PMD power

From: Burakov, Anatoly <hidden>
Date: 2021-06-02 11:14:54

On 31-May-21 12:30 PM, David Hunt wrote:
quoted hunk ↗ jump to hunk
The PMD Power Management scheme currently has 3 modes,
scale, monitor and pause. However, it would be nice to
have a baseline mode for easy comparison of power savings
with and without these modes.

This patch adds a 'baseline' mode were the pmd power
management is not enabled. Use --pmg-mgmt=baseline.

Signed-off-by: David Hunt <redacted>
---
  examples/l3fwd-power/main.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index f8dfed1634..34b0eaa401 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1617,7 +1617,7 @@ print_usage(const char *prgname)
  		" empty polls, full polls, and core busyness to telemetry\n"
  		" --interrupt-only: enable interrupt-only mode\n"
  		" --pmd-mgmt MODE: enable PMD power management mode. "
-		"Currently supported modes: monitor, pause, scale\n",
+		"Currently supported modes: baseline, monitor, pause, scale\n",
  		prgname);
  }
  
@@ -1714,6 +1714,7 @@ parse_pmd_mgmt_config(const char *name)
  #define PMD_MGMT_MONITOR "monitor"
  #define PMD_MGMT_PAUSE   "pause"
  #define PMD_MGMT_SCALE   "scale"
+#define PMD_MGMT_BASELINE  "baseline"
  
  	if (strncmp(PMD_MGMT_MONITOR, name, sizeof(PMD_MGMT_MONITOR)) == 0) {
  		pmgmt_type = RTE_POWER_MGMT_TYPE_MONITOR;
@@ -1729,6 +1730,10 @@ parse_pmd_mgmt_config(const char *name)
  		pmgmt_type = RTE_POWER_MGMT_TYPE_SCALE;
  		return 0;
  	}
+	if (strncmp(PMD_MGMT_BASELINE, name, sizeof(PMD_MGMT_BASELINE)) == 0) {
+		pmgmt_type = -1;
+		return 0;
+	}
I don't particularly like the enum abuse, type safety exists for a 
reason :) perhaps just add a bool that enables/disables this? you're 
effectively doing that anyway with pmgmt_type >= 0.
quoted hunk ↗ jump to hunk
  	/* unknown PMD power management mode */
  	return -1;
  }
@@ -2767,7 +2772,8 @@ main(int argc, char **argv)
  						 "Fail to add ptype cb\n");
  			}
  
-			if (app_mode == APP_MODE_PMD_MGMT) {
+			if ((app_mode == APP_MODE_PMD_MGMT) &&
+					(pmgmt_type >= 0)) {
  				ret = rte_power_ethdev_pmgmt_queue_enable(
  						lcore_id, portid, queueid,
  						pmgmt_type);

-- 
Thanks,
Anatoly
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help