[v2,4/4] test/power: fix turbo test

Message ID 20210512163254.9945-4-david.hunt@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/4] test/power: fix check for cpu frequency |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS

Commit Message

Hunt, David May 12, 2021, 4:32 p.m. UTC
  when turbo is enabled or disabled, the frequency is set to a low non-turbo
frequency, so we need to set to the frequency expected by the test before
checking.

Fixes: aeaeaf5f2d62 ("test/power: add cases for turbo feature")
Cc: stable@dpdk.org

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

---
changes in v2
   none
---
 app/test/test_power_cpufreq.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
  

Comments

Thomas Monjalon May 12, 2021, 8:05 p.m. UTC | #1
12/05/2021 18:32, David Hunt:
> when turbo is enabled or disabled, the frequency is set to a low non-turbo
> frequency, so we need to set to the frequency expected by the test before
> checking.
> 
> Fixes: aeaeaf5f2d62 ("test/power: add cases for turbo feature")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>

Series applied, thanks.
  

Patch

diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index c24b706f4f..0c3adc5f33 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -436,6 +436,12 @@  check_power_turbo(void)
 				TEST_POWER_LCORE_ID);
 		return -1;
 	}
+	ret = rte_power_freq_max(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Fail to scale up the freq to max on lcore %u\n",
+						TEST_POWER_LCORE_ID);
+		return -1;
+	}
 
 	/* Check the current frequency */
 	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0, true);
@@ -455,6 +461,12 @@  check_power_turbo(void)
 				TEST_POWER_LCORE_ID);
 		return -1;
 	}
+	ret = rte_power_freq_max(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Fail to scale up the freq to max on lcore %u\n",
+						TEST_POWER_LCORE_ID);
+		return -1;
+	}
 
 	/* Check the current frequency */
 	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1, false);