DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/power: fix unit test to handle pstate mode
@ 2019-01-07 14:40 David Hunt
  2019-01-14 23:03 ` Thomas Monjalon
  2019-02-06 15:47 ` Kevin Traynor
  0 siblings, 2 replies; 4+ messages in thread
From: David Hunt @ 2019-01-07 14:40 UTC (permalink / raw)
  To: dev; +Cc: david.hunt, liang.j.ma

The cpufreq test breakes when the system is using the intel_pstate
driver for frequency management. The power library has recentyly been
updated to allow use of the intel_pstate driver, this patch fixes the
cpufreq test so that it can now use either acpi or pstate modes.
The library will auto-detect, and set the environment appropriately.

Fixes: ed7c51a6a680 ("app/test: vm power management")

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 test/test/test_power_acpi_cpufreq.c | 38 +++++++++++++++++------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/test/test/test_power_acpi_cpufreq.c b/test/test/test_power_acpi_cpufreq.c
index 6d637cc77..61b1da05a 100644
--- a/test/test/test_power_acpi_cpufreq.c
+++ b/test/test/test_power_acpi_cpufreq.c
@@ -372,18 +372,22 @@ test_power_acpi_cpufreq(void)
 	int ret = -1;
 	enum power_management_env env;
 
-	ret = rte_power_set_env(PM_ENV_ACPI_CPUFREQ);
-	if (ret != 0) {
-		printf("Failed on setting environment to PM_ENV_ACPI_CPUFREQ, this "
-				"may occur if environment is not configured correctly or "
-				" operating in another valid Power management environment\n");
-		return -1;
+	/* Test initialisation of a valid lcore */
+	ret = rte_power_init(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Cannot initialise power management for lcore %u, this "
+				"may occur if environment is not configured "
+				"correctly(APCI cpufreq) or operating in another valid "
+				"Power management environment\n",
+				TEST_POWER_LCORE_ID);
+		rte_power_unset_env();
+		return TEST_SKIPPED;
 	}
 
 	/* Test environment configuration */
 	env = rte_power_get_env();
-	if (env != PM_ENV_ACPI_CPUFREQ) {
-		printf("Unexpectedly got an environment other than ACPI cpufreq\n");
+	if ((env != PM_ENV_ACPI_CPUFREQ) && (env != PM_ENV_PSTATE_CPUFREQ)) {
+		printf("Unexpectedly got an environment other than ACPI/PSTATE\n");
 		goto fail_all;
 	}
 
@@ -424,6 +428,14 @@ test_power_acpi_cpufreq(void)
 		goto fail_all;
 	}
 
+	ret = rte_power_exit(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Cannot exit power management for lcore %u\n",
+						TEST_POWER_LCORE_ID);
+		rte_power_unset_env();
+		return -1;
+	}
+
 	/* test of init power management for an invalid lcore */
 	ret = rte_power_init(TEST_POWER_LCORE_INVALID);
 	if (ret == 0) {
@@ -532,12 +544,6 @@ test_power_acpi_caps(void)
 	struct rte_power_core_capabilities caps;
 	int ret;
 
-	ret = rte_power_set_env(PM_ENV_ACPI_CPUFREQ);
-	if (ret) {
-		printf("Error setting ACPI environment\n");
-		return -1;
-	}
-
 	ret = rte_power_init(TEST_POWER_LCORE_ID);
 	if (ret < 0) {
 		printf("Cannot initialise power management for lcore %u, this "
@@ -550,11 +556,11 @@ test_power_acpi_caps(void)
 
 	ret = rte_power_get_capabilities(TEST_POWER_LCORE_ID, &caps);
 	if (ret) {
-		printf("ACPI: Error getting capabilities\n");
+		printf("POWER: Error getting capabilities\n");
 		return -1;
 	}
 
-	printf("ACPI: Capabilities %"PRIx64"\n", caps.capabilities);
+	printf("POWER: Capabilities %"PRIx64"\n", caps.capabilities);
 
 	rte_power_unset_env();
 	return 0;
-- 
2.17.1

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

* Re: [dpdk-dev] [PATCH] test/power: fix unit test to handle pstate mode
  2019-01-07 14:40 [dpdk-dev] [PATCH] test/power: fix unit test to handle pstate mode David Hunt
@ 2019-01-14 23:03 ` Thomas Monjalon
  2019-02-06 15:47 ` Kevin Traynor
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2019-01-14 23:03 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, liang.j.ma

07/01/2019 15:40, David Hunt:
> The cpufreq test breakes when the system is using the intel_pstate
> driver for frequency management. The power library has recentyly been
> updated to allow use of the intel_pstate driver, this patch fixes the
> cpufreq test so that it can now use either acpi or pstate modes.
> The library will auto-detect, and set the environment appropriately.
> 
> Fixes: ed7c51a6a680 ("app/test: vm power management")
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>

Applied, thanks

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

* Re: [dpdk-dev] [PATCH] test/power: fix unit test to handle pstate mode
  2019-01-07 14:40 [dpdk-dev] [PATCH] test/power: fix unit test to handle pstate mode David Hunt
  2019-01-14 23:03 ` Thomas Monjalon
@ 2019-02-06 15:47 ` Kevin Traynor
  2019-02-06 16:24   ` Hunt, David
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Traynor @ 2019-02-06 15:47 UTC (permalink / raw)
  To: David Hunt, dev; +Cc: liang.j.ma, stable, Thomas Monjalon

On 01/07/2019 02:40 PM, David Hunt wrote:
> The cpufreq test breakes when the system is using the intel_pstate
> driver for frequency management. The power library has recentyly been
> updated to allow use of the intel_pstate driver, this patch fixes the
> cpufreq test so that it can now use either acpi or pstate modes.
> The library will auto-detect, and set the environment appropriately.
> 
> Fixes: ed7c51a6a680 ("app/test: vm power management")
> 

I think this should have been:
Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Presumably based on the Fixes tag, it got a stable tag added also, but
it does not look correct for 18.11 and breaks the build. If that's
incorrect, please let me know.

> Signed-off-by: David Hunt <david.hunt@intel.com>

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

* Re: [dpdk-dev] [PATCH] test/power: fix unit test to handle pstate mode
  2019-02-06 15:47 ` Kevin Traynor
@ 2019-02-06 16:24   ` Hunt, David
  0 siblings, 0 replies; 4+ messages in thread
From: Hunt, David @ 2019-02-06 16:24 UTC (permalink / raw)
  To: Kevin Traynor, dev; +Cc: liang.j.ma, stable, Thomas Monjalon

Hi Kevin,

On 6/2/2019 3:47 PM, Kevin Traynor wrote:
> On 01/07/2019 02:40 PM, David Hunt wrote:
>> The cpufreq test breakes when the system is using the intel_pstate
>> driver for frequency management. The power library has recentyly been
>> updated to allow use of the intel_pstate driver, this patch fixes the
>> cpufreq test so that it can now use either acpi or pstate modes.
>> The library will auto-detect, and set the environment appropriately.
>>
>> Fixes: ed7c51a6a680 ("app/test: vm power management")
>>
> I think this should have been:
> Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")
>
> Presumably based on the Fixes tag, it got a stable tag added also, but
> it does not look correct for 18.11 and breaks the build. If that's
> incorrect, please let me know.
>
>> Signed-off-by: David Hunt <david.hunt@intel.com>


You are correct. Your suggested Fixes: line is the correct one. It's 
only relevant after the pstate compatibility was added.

Regards,
Dave.

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

end of thread, other threads:[~2019-02-06 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07 14:40 [dpdk-dev] [PATCH] test/power: fix unit test to handle pstate mode David Hunt
2019-01-14 23:03 ` Thomas Monjalon
2019-02-06 15:47 ` Kevin Traynor
2019-02-06 16:24   ` Hunt, David

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).