DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] test: improve test coverage for power library
@ 2019-03-07 13:59 Lukasz Krakowiak
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-03-07 13:59 UTC (permalink / raw)
  To: david.hunt; +Cc: dev, Lukasz Krakowiak

This patch rename test_power_acpi_cpufreq.c to test_power_cpufreq.c,
remove prefix _acpi from UT power functions/test names,
add UT for power turbo feature.

Lukasz Krakowiak (3):
  test: rename test_power_acpi_cpufreq.c ->
    app/test/test_power_cpufreq.c
  test: remove prefix _acpi from UT power function/test names
  test: add UT for power turbo feature

 app/test/Makefile                             |  2 +-
 app/test/autotest_data.py                     |  4 +-
 app/test/meson.build                          |  4 +-
 ...er_acpi_cpufreq.c => test_power_cpufreq.c} | 84 +++++++++++++++++--
 4 files changed, 83 insertions(+), 11 deletions(-)
 rename app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} (86%)

-- 
2.17.2

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

* [dpdk-dev] [PATCH 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c
  2019-03-07 13:59 [dpdk-dev] [PATCH 0/3] test: improve test coverage for power library Lukasz Krakowiak
@ 2019-03-07 13:59 ` Lukasz Krakowiak
  2019-03-27 15:05   ` Burakov, Anatoly
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-03-07 13:59 UTC (permalink / raw)
  To: david.hunt; +Cc: dev, Lukasz Krakowiak

This patch rename file test_power_acpi_cpufreq.c ->
 app/test/test_power_cpufreq.c.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/Makefile                                            | 2 +-
 app/test/meson.build                                         | 2 +-
 app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} (100%)

diff --git a/app/test/Makefile b/app/test/Makefile
index 89949c2bb..d1bcfd456 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -158,7 +158,7 @@ endif
 
 SRCS-$(CONFIG_RTE_LIBRTE_METER) += test_meter.c
 SRCS-$(CONFIG_RTE_LIBRTE_KNI) += test_kni.c
-SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power.c test_power_acpi_cpufreq.c
+SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power.c test_power_cpufreq.c
 SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power_kvm_vm.c
 SRCS-y += test_common.c
 
diff --git a/app/test/meson.build b/app/test/meson.build
index 05e5ddeb0..4ae3dffea 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -82,7 +82,7 @@ test_sources = files('commands.c',
 	'test_pmd_ring.c',
 	'test_pmd_ring_perf.c',
 	'test_power.c',
-	'test_power_acpi_cpufreq.c',
+	'test_power_cpufreq.c',
 	'test_power_kvm_vm.c',
 	'test_prefetch.c',
 	'test_reciprocal_division.c',
diff --git a/app/test/test_power_acpi_cpufreq.c b/app/test/test_power_cpufreq.c
similarity index 100%
rename from app/test/test_power_acpi_cpufreq.c
rename to app/test/test_power_cpufreq.c
-- 
2.17.2

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

* [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names
  2019-03-07 13:59 [dpdk-dev] [PATCH 0/3] test: improve test coverage for power library Lukasz Krakowiak
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
@ 2019-03-07 13:59 ` Lukasz Krakowiak
  2019-03-27 15:07   ` Burakov, Anatoly
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature Lukasz Krakowiak
  2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
  3 siblings, 1 reply; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-03-07 13:59 UTC (permalink / raw)
  To: david.hunt; +Cc: dev, Lukasz Krakowiak

This patch remove prefix _acpi from power UT function/test names.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/autotest_data.py     |  4 ++--
 app/test/meson.build          |  2 +-
 app/test/test_power_cpufreq.c | 12 ++++++------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py
index 5f87bb94d..c80801b20 100644
--- a/app/test/autotest_data.py
+++ b/app/test/autotest_data.py
@@ -622,8 +622,8 @@
         "Report":      None,
     },
     {
-        "Name":       "Power ACPI cpufreq autotest",
-        "Command":    "power_acpi_cpufreq_autotest",
+        "Name":       "Power cpufreq autotest",
+        "Command":    "power_cpufreq_autotest",
         "Func":       default_autotest,
         "Report":     None,
     },
diff --git a/app/test/meson.build b/app/test/meson.build
index 4ae3dffea..a389a2b10 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -205,7 +205,7 @@ fast_non_parallel_test_names = [
         'member_autotest',
         'metrics_autotest',
         'pdump_autotest',
-        'power_acpi_cpufreq_autotest',
+        'power_cpufreq_autotest',
         'power_autotest',
         'power_kvm_vm_autotest',
         'reorder_autotest',
diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index 61b1da05a..d099f2f47 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -14,14 +14,14 @@
 #ifndef RTE_LIBRTE_POWER
 
 static int
-test_power_acpi_cpufreq(void)
+test_power_cpufreq(void)
 {
 	printf("Power management library not supported, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
-test_power_acpi_caps(void)
+test_power_caps(void)
 {
 	printf("Power management library not supported, skipping test\n");
 	return TEST_SKIPPED;
@@ -367,7 +367,7 @@ check_power_freq_min(void)
 }
 
 static int
-test_power_acpi_cpufreq(void)
+test_power_cpufreq(void)
 {
 	int ret = -1;
 	enum power_management_env env;
@@ -539,7 +539,7 @@ test_power_acpi_cpufreq(void)
 }
 
 static int
-test_power_acpi_caps(void)
+test_power_caps(void)
 {
 	struct rte_power_core_capabilities caps;
 	int ret;
@@ -568,5 +568,5 @@ test_power_acpi_caps(void)
 
 #endif
 
-REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq);
-REGISTER_TEST_COMMAND(power_acpi_caps_autotest, test_power_acpi_caps);
+REGISTER_TEST_COMMAND(power_cpufreq_autotest, test_power_cpufreq);
+REGISTER_TEST_COMMAND(power_caps_autotest, test_power_caps);
-- 
2.17.2

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

* [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature
  2019-03-07 13:59 [dpdk-dev] [PATCH 0/3] test: improve test coverage for power library Lukasz Krakowiak
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
@ 2019-03-07 13:59 ` Lukasz Krakowiak
  2019-03-27 15:13   ` Burakov, Anatoly
  2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
  3 siblings, 1 reply; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-03-07 13:59 UTC (permalink / raw)
  To: david.hunt; +Cc: dev, Lukasz Krakowiak

Add UT check_power_turbo.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/test_power_cpufreq.c | 72 +++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index d099f2f47..c75c9bf1c 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -366,6 +366,59 @@ check_power_freq_min(void)
 	return 0;
 }
 
+/* Check rte_power_turbo() */
+static int
+check_power_turbo(void)
+{
+	int ret;
+
+	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
+		printf("Turbo not available on lcore %u, skipping test\n",
+		TEST_POWER_LCORE_ID);
+		return 0;
+	}
+
+	/* test with an invalid lcore id */
+	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
+	if (ret >= 0) {
+		printf("Unexpectedly enable turbo successfully "
+				"on lcore %u\n", TEST_POWER_LCORE_INVALID);
+		return -1;
+	}
+	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Fail to enable turbo on lcore %u\n",
+							TEST_POWER_LCORE_ID);
+		return -1;
+	}
+
+	/* Check the current frequency */
+	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
+	if (ret < 0)
+		return -1;
+
+	/* test with an invalid lcore id */
+	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
+	if (ret >= 0) {
+		printf("Unexpectedly disable turbo successfully "
+				"on lcore %u\n", TEST_POWER_LCORE_INVALID);
+		return -1;
+	}
+	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Fail to disable turbo on lcore %u\n",
+							TEST_POWER_LCORE_ID);
+		return -1;
+	}
+
+	/* Check the current frequency */
+	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
+	if (ret < 0)
+		return -1;
+
+	return 0;
+}
+
 static int
 test_power_cpufreq(void)
 {
@@ -427,6 +480,21 @@ test_power_cpufreq(void)
 				"been initialised\n");
 		goto fail_all;
 	}
+	if (rte_power_turbo_status == NULL) {
+		printf("rte_power_turbo_status should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
+	if (rte_power_freq_enable_turbo == NULL) {
+		printf("rte_power_freq_enable_turbo should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
+	if (rte_power_freq_disable_turbo == NULL) {
+		printf("rte_power_freq_disable_turbo should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
 
 	ret = rte_power_exit(TEST_POWER_LCORE_ID);
 	if (ret < 0) {
@@ -502,6 +570,10 @@ test_power_cpufreq(void)
 	if (ret < 0)
 		goto fail_all;
 
+	ret = check_power_turbo();
+	if (ret < 0)
+		goto fail_all;
+
 	ret = rte_power_exit(TEST_POWER_LCORE_ID);
 	if (ret < 0) {
 		printf("Cannot exit power management for lcore %u\n",
-- 
2.17.2

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

* Re: [dpdk-dev] [PATCH 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
@ 2019-03-27 15:05   ` Burakov, Anatoly
  2019-03-27 15:05     ` Burakov, Anatoly
  0 siblings, 1 reply; 34+ messages in thread
From: Burakov, Anatoly @ 2019-03-27 15:05 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: dev

On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> This patch rename file test_power_acpi_cpufreq.c ->
>   app/test/test_power_cpufreq.c.
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

Subject line is too long. Perhaps just say "test/power: rename cpufreq 
autotest" ?

Otherwise

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

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c
  2019-03-27 15:05   ` Burakov, Anatoly
@ 2019-03-27 15:05     ` Burakov, Anatoly
  0 siblings, 0 replies; 34+ messages in thread
From: Burakov, Anatoly @ 2019-03-27 15:05 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: dev

On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> This patch rename file test_power_acpi_cpufreq.c ->
>   app/test/test_power_cpufreq.c.
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

Subject line is too long. Perhaps just say "test/power: rename cpufreq 
autotest" ?

Otherwise

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

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
@ 2019-03-27 15:07   ` Burakov, Anatoly
  2019-03-27 15:07     ` Burakov, Anatoly
  2019-03-29 22:40     ` Thomas Monjalon
  0 siblings, 2 replies; 34+ messages in thread
From: Burakov, Anatoly @ 2019-03-27 15:07 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: dev

On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> This patch remove prefix _acpi from power UT function/test names.

Again, subject line is IMO too long. How about:

"test/power: remove _acpi prefix from test names"

?

Otherwise,

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

> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names
  2019-03-27 15:07   ` Burakov, Anatoly
@ 2019-03-27 15:07     ` Burakov, Anatoly
  2019-03-29 22:40     ` Thomas Monjalon
  1 sibling, 0 replies; 34+ messages in thread
From: Burakov, Anatoly @ 2019-03-27 15:07 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: dev

On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> This patch remove prefix _acpi from power UT function/test names.

Again, subject line is IMO too long. How about:

"test/power: remove _acpi prefix from test names"

?

Otherwise,

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

> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature Lukasz Krakowiak
@ 2019-03-27 15:13   ` Burakov, Anatoly
  2019-03-27 15:13     ` Burakov, Anatoly
  2019-04-03  9:07     ` Krakowiak, LukaszX
  0 siblings, 2 replies; 34+ messages in thread
From: Burakov, Anatoly @ 2019-03-27 15:13 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: dev

On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> Add UT check_power_turbo.
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---
>   app/test/test_power_cpufreq.c | 72 +++++++++++++++++++++++++++++++++++
>   1 file changed, 72 insertions(+)
> 
> diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
> index d099f2f47..c75c9bf1c 100644
> --- a/app/test/test_power_cpufreq.c
> +++ b/app/test/test_power_cpufreq.c
> @@ -366,6 +366,59 @@ check_power_freq_min(void)
>   	return 0;
>   }
>   
> +/* Check rte_power_turbo() */
> +static int
> +check_power_turbo(void)
> +{
> +	int ret;
> +
> +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
> +		printf("Turbo not available on lcore %u, skipping test\n",
> +		TEST_POWER_LCORE_ID);

Misleading indentation, please add two tabs to the second line of 
printf() statement.

> +		return 0;
> +	}
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly enable turbo successfully "
> +				"on lcore %u\n", TEST_POWER_LCORE_INVALID);

Please don't break up strings to multiple lines.

> +		return -1;
> +	}
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to enable turbo on lcore %u\n",
> +							TEST_POWER_LCORE_ID);

I wish there was a middle ground between no indentation and way too much 
indentation...

> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
> +	if (ret < 0)
> +		return -1;
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly disable turbo successfully "
> +				"on lcore %u\n", TEST_POWER_LCORE_INVALID);

Same as above, don't break up strings.

> +		return -1;
> +	}
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to disable turbo on lcore %u\n",
> +							TEST_POWER_LCORE_ID);

Same as above, two tabs is enough indentation.

> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
> +	if (ret < 0)
> +		return -1;
> +
> +	return 0;
> +}
> +
>   static int
>   test_power_cpufreq(void)
>   {
> @@ -427,6 +480,21 @@ test_power_cpufreq(void)
>   				"been initialised\n");
>   		goto fail_all;
>   	}
> +	if (rte_power_turbo_status == NULL) {
> +		printf("rte_power_turbo_status should not be NULL, environment has not "
> +				"been initialised\n");

Here and below:

I don't think saying *why* it should not be NULL - just saying that it 
shouldn't be NULL is enough. Maybe mention why it's supposed to be not 
NULL in comments here.

Also, i have a suspicion that the message is wrong - why would status be 
null if the environment was initialized? Presumably it's the other way 
around?

> +		goto fail_all;
> +	}
> +	if (rte_power_freq_enable_turbo == NULL) {
> +		printf("rte_power_freq_enable_turbo should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> +	if (rte_power_freq_disable_turbo == NULL) {
> +		printf("rte_power_freq_disable_turbo should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
>   
>   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>   	if (ret < 0) {
> @@ -502,6 +570,10 @@ test_power_cpufreq(void)
>   	if (ret < 0)
>   		goto fail_all;
>   
> +	ret = check_power_turbo();
> +	if (ret < 0)
> +		goto fail_all;
> +
>   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>   	if (ret < 0) {
>   		printf("Cannot exit power management for lcore %u\n",
> 


-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature
  2019-03-27 15:13   ` Burakov, Anatoly
@ 2019-03-27 15:13     ` Burakov, Anatoly
  2019-04-03  9:07     ` Krakowiak, LukaszX
  1 sibling, 0 replies; 34+ messages in thread
From: Burakov, Anatoly @ 2019-03-27 15:13 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: dev

On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> Add UT check_power_turbo.
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---
>   app/test/test_power_cpufreq.c | 72 +++++++++++++++++++++++++++++++++++
>   1 file changed, 72 insertions(+)
> 
> diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
> index d099f2f47..c75c9bf1c 100644
> --- a/app/test/test_power_cpufreq.c
> +++ b/app/test/test_power_cpufreq.c
> @@ -366,6 +366,59 @@ check_power_freq_min(void)
>   	return 0;
>   }
>   
> +/* Check rte_power_turbo() */
> +static int
> +check_power_turbo(void)
> +{
> +	int ret;
> +
> +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
> +		printf("Turbo not available on lcore %u, skipping test\n",
> +		TEST_POWER_LCORE_ID);

Misleading indentation, please add two tabs to the second line of 
printf() statement.

> +		return 0;
> +	}
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly enable turbo successfully "
> +				"on lcore %u\n", TEST_POWER_LCORE_INVALID);

Please don't break up strings to multiple lines.

> +		return -1;
> +	}
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to enable turbo on lcore %u\n",
> +							TEST_POWER_LCORE_ID);

I wish there was a middle ground between no indentation and way too much 
indentation...

> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
> +	if (ret < 0)
> +		return -1;
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly disable turbo successfully "
> +				"on lcore %u\n", TEST_POWER_LCORE_INVALID);

Same as above, don't break up strings.

> +		return -1;
> +	}
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to disable turbo on lcore %u\n",
> +							TEST_POWER_LCORE_ID);

Same as above, two tabs is enough indentation.

> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
> +	if (ret < 0)
> +		return -1;
> +
> +	return 0;
> +}
> +
>   static int
>   test_power_cpufreq(void)
>   {
> @@ -427,6 +480,21 @@ test_power_cpufreq(void)
>   				"been initialised\n");
>   		goto fail_all;
>   	}
> +	if (rte_power_turbo_status == NULL) {
> +		printf("rte_power_turbo_status should not be NULL, environment has not "
> +				"been initialised\n");

Here and below:

I don't think saying *why* it should not be NULL - just saying that it 
shouldn't be NULL is enough. Maybe mention why it's supposed to be not 
NULL in comments here.

Also, i have a suspicion that the message is wrong - why would status be 
null if the environment was initialized? Presumably it's the other way 
around?

> +		goto fail_all;
> +	}
> +	if (rte_power_freq_enable_turbo == NULL) {
> +		printf("rte_power_freq_enable_turbo should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> +	if (rte_power_freq_disable_turbo == NULL) {
> +		printf("rte_power_freq_disable_turbo should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
>   
>   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>   	if (ret < 0) {
> @@ -502,6 +570,10 @@ test_power_cpufreq(void)
>   	if (ret < 0)
>   		goto fail_all;
>   
> +	ret = check_power_turbo();
> +	if (ret < 0)
> +		goto fail_all;
> +
>   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>   	if (ret < 0) {
>   		printf("Cannot exit power management for lcore %u\n",
> 


-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names
  2019-03-27 15:07   ` Burakov, Anatoly
  2019-03-27 15:07     ` Burakov, Anatoly
@ 2019-03-29 22:40     ` Thomas Monjalon
  2019-03-29 22:40       ` Thomas Monjalon
  1 sibling, 1 reply; 34+ messages in thread
From: Thomas Monjalon @ 2019-03-29 22:40 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: dev, Burakov, Anatoly, david.hunt

27/03/2019 16:07, Burakov, Anatoly:
> On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> > This patch remove prefix _acpi from power UT function/test names.

I think it can be merged with patch renaming the file.

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

* Re: [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names
  2019-03-29 22:40     ` Thomas Monjalon
@ 2019-03-29 22:40       ` Thomas Monjalon
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Monjalon @ 2019-03-29 22:40 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: dev, Burakov, Anatoly, david.hunt

27/03/2019 16:07, Burakov, Anatoly:
> On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> > This patch remove prefix _acpi from power UT function/test names.

I think it can be merged with patch renaming the file.




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

* Re: [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature
  2019-03-27 15:13   ` Burakov, Anatoly
  2019-03-27 15:13     ` Burakov, Anatoly
@ 2019-04-03  9:07     ` Krakowiak, LukaszX
  2019-04-03  9:07       ` Krakowiak, LukaszX
  2019-04-03 10:01       ` Burakov, Anatoly
  1 sibling, 2 replies; 34+ messages in thread
From: Krakowiak, LukaszX @ 2019-04-03  9:07 UTC (permalink / raw)
  To: Burakov, Anatoly, Hunt, David; +Cc: dev

Hi, 

> On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> > Add UT check_power_turbo.
> >
> > Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> > ---
> >   app/test/test_power_cpufreq.c | 72
> +++++++++++++++++++++++++++++++++++
> >   1 file changed, 72 insertions(+)
> >
> > diff --git a/app/test/test_power_cpufreq.c
> > b/app/test/test_power_cpufreq.c index d099f2f47..c75c9bf1c 100644
> > --- a/app/test/test_power_cpufreq.c
> > +++ b/app/test/test_power_cpufreq.c
> > @@ -366,6 +366,59 @@ check_power_freq_min(void)
> >   	return 0;
> >   }
> >
> > +/* Check rte_power_turbo() */
> > +static int
> > +check_power_turbo(void)
> > +{
> > +	int ret;
> > +
> > +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
> > +		printf("Turbo not available on lcore %u, skipping test\n",
> > +		TEST_POWER_LCORE_ID);
> 
> Misleading indentation, please add two tabs to the second line of
> printf() statement.
> 
> > +		return 0;
> > +	}
> > +
> > +	/* test with an invalid lcore id */
> > +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
> > +	if (ret >= 0) {
> > +		printf("Unexpectedly enable turbo successfully "
> > +				"on lcore %u\n",
> TEST_POWER_LCORE_INVALID);
> 
> Please don't break up strings to multiple lines.
> 
> > +		return -1;
> > +	}
> > +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
> > +	if (ret < 0) {
> > +		printf("Fail to enable turbo on lcore %u\n",
> > +
> 	TEST_POWER_LCORE_ID);
> 
> I wish there was a middle ground between no indentation and way too much
> indentation...
> 
> > +		return -1;
> > +	}
> > +
> > +	/* Check the current frequency */
> > +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
> > +	if (ret < 0)
> > +		return -1;
> > +
> > +	/* test with an invalid lcore id */
> > +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
> > +	if (ret >= 0) {
> > +		printf("Unexpectedly disable turbo successfully "
> > +				"on lcore %u\n",
> TEST_POWER_LCORE_INVALID);
> 
> Same as above, don't break up strings.
> 
> > +		return -1;
> > +	}
> > +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
> > +	if (ret < 0) {
> > +		printf("Fail to disable turbo on lcore %u\n",
> > +
> 	TEST_POWER_LCORE_ID);
> 
> Same as above, two tabs is enough indentation.
> 
> > +		return -1;
> > +	}
> > +
> > +	/* Check the current frequency */
> > +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
> > +	if (ret < 0)
> > +		return -1;
> > +
> > +	return 0;
> > +}
> > +
> >   static int
> >   test_power_cpufreq(void)
> >   {
> > @@ -427,6 +480,21 @@ test_power_cpufreq(void)
> >   				"been initialised\n");
> >   		goto fail_all;
> >   	}
> > +	if (rte_power_turbo_status == NULL) {
> > +		printf("rte_power_turbo_status should not be NULL,
> environment has not "
> > +				"been initialised\n");
> 
> Here and below:
> 
> I don't think saying *why* it should not be NULL - just saying that it shouldn't be
> NULL is enough. Maybe mention why it's supposed to be not NULL in comments
> here.
> 
> Also, i have a suspicion that the message is wrong - why would status be null if
> the environment was initialized? Presumably it's the other way around?

I think this is correctly: if env was initialized, pointer != NULL, otherwise env wasn't initialized.
Rest of all, you are right: coding style issues. Thanks.
> 
> > +		goto fail_all;
> > +	}
> > +	if (rte_power_freq_enable_turbo == NULL) {
> > +		printf("rte_power_freq_enable_turbo should not be NULL,
> environment has not "
> > +				"been initialised\n");
> > +		goto fail_all;
> > +	}
> > +	if (rte_power_freq_disable_turbo == NULL) {
> > +		printf("rte_power_freq_disable_turbo should not be NULL,
> environment has not "
> > +				"been initialised\n");
> > +		goto fail_all;
> > +	}
> >
> >   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
> >   	if (ret < 0) {
> > @@ -502,6 +570,10 @@ test_power_cpufreq(void)
> >   	if (ret < 0)
> >   		goto fail_all;
> >
> > +	ret = check_power_turbo();
> > +	if (ret < 0)
> > +		goto fail_all;
> > +
> >   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
> >   	if (ret < 0) {
> >   		printf("Cannot exit power management for lcore %u\n",
> >
> 
> 
> --
> Thanks,
> Anatoly

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

* Re: [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature
  2019-04-03  9:07     ` Krakowiak, LukaszX
@ 2019-04-03  9:07       ` Krakowiak, LukaszX
  2019-04-03 10:01       ` Burakov, Anatoly
  1 sibling, 0 replies; 34+ messages in thread
From: Krakowiak, LukaszX @ 2019-04-03  9:07 UTC (permalink / raw)
  To: Burakov, Anatoly, Hunt, David; +Cc: dev

Hi, 

> On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
> > Add UT check_power_turbo.
> >
> > Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> > ---
> >   app/test/test_power_cpufreq.c | 72
> +++++++++++++++++++++++++++++++++++
> >   1 file changed, 72 insertions(+)
> >
> > diff --git a/app/test/test_power_cpufreq.c
> > b/app/test/test_power_cpufreq.c index d099f2f47..c75c9bf1c 100644
> > --- a/app/test/test_power_cpufreq.c
> > +++ b/app/test/test_power_cpufreq.c
> > @@ -366,6 +366,59 @@ check_power_freq_min(void)
> >   	return 0;
> >   }
> >
> > +/* Check rte_power_turbo() */
> > +static int
> > +check_power_turbo(void)
> > +{
> > +	int ret;
> > +
> > +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
> > +		printf("Turbo not available on lcore %u, skipping test\n",
> > +		TEST_POWER_LCORE_ID);
> 
> Misleading indentation, please add two tabs to the second line of
> printf() statement.
> 
> > +		return 0;
> > +	}
> > +
> > +	/* test with an invalid lcore id */
> > +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
> > +	if (ret >= 0) {
> > +		printf("Unexpectedly enable turbo successfully "
> > +				"on lcore %u\n",
> TEST_POWER_LCORE_INVALID);
> 
> Please don't break up strings to multiple lines.
> 
> > +		return -1;
> > +	}
> > +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
> > +	if (ret < 0) {
> > +		printf("Fail to enable turbo on lcore %u\n",
> > +
> 	TEST_POWER_LCORE_ID);
> 
> I wish there was a middle ground between no indentation and way too much
> indentation...
> 
> > +		return -1;
> > +	}
> > +
> > +	/* Check the current frequency */
> > +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
> > +	if (ret < 0)
> > +		return -1;
> > +
> > +	/* test with an invalid lcore id */
> > +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
> > +	if (ret >= 0) {
> > +		printf("Unexpectedly disable turbo successfully "
> > +				"on lcore %u\n",
> TEST_POWER_LCORE_INVALID);
> 
> Same as above, don't break up strings.
> 
> > +		return -1;
> > +	}
> > +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
> > +	if (ret < 0) {
> > +		printf("Fail to disable turbo on lcore %u\n",
> > +
> 	TEST_POWER_LCORE_ID);
> 
> Same as above, two tabs is enough indentation.
> 
> > +		return -1;
> > +	}
> > +
> > +	/* Check the current frequency */
> > +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
> > +	if (ret < 0)
> > +		return -1;
> > +
> > +	return 0;
> > +}
> > +
> >   static int
> >   test_power_cpufreq(void)
> >   {
> > @@ -427,6 +480,21 @@ test_power_cpufreq(void)
> >   				"been initialised\n");
> >   		goto fail_all;
> >   	}
> > +	if (rte_power_turbo_status == NULL) {
> > +		printf("rte_power_turbo_status should not be NULL,
> environment has not "
> > +				"been initialised\n");
> 
> Here and below:
> 
> I don't think saying *why* it should not be NULL - just saying that it shouldn't be
> NULL is enough. Maybe mention why it's supposed to be not NULL in comments
> here.
> 
> Also, i have a suspicion that the message is wrong - why would status be null if
> the environment was initialized? Presumably it's the other way around?

I think this is correctly: if env was initialized, pointer != NULL, otherwise env wasn't initialized.
Rest of all, you are right: coding style issues. Thanks.
> 
> > +		goto fail_all;
> > +	}
> > +	if (rte_power_freq_enable_turbo == NULL) {
> > +		printf("rte_power_freq_enable_turbo should not be NULL,
> environment has not "
> > +				"been initialised\n");
> > +		goto fail_all;
> > +	}
> > +	if (rte_power_freq_disable_turbo == NULL) {
> > +		printf("rte_power_freq_disable_turbo should not be NULL,
> environment has not "
> > +				"been initialised\n");
> > +		goto fail_all;
> > +	}
> >
> >   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
> >   	if (ret < 0) {
> > @@ -502,6 +570,10 @@ test_power_cpufreq(void)
> >   	if (ret < 0)
> >   		goto fail_all;
> >
> > +	ret = check_power_turbo();
> > +	if (ret < 0)
> > +		goto fail_all;
> > +
> >   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
> >   	if (ret < 0) {
> >   		printf("Cannot exit power management for lcore %u\n",
> >
> 
> 
> --
> Thanks,
> Anatoly

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

* Re: [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature
  2019-04-03  9:07     ` Krakowiak, LukaszX
  2019-04-03  9:07       ` Krakowiak, LukaszX
@ 2019-04-03 10:01       ` Burakov, Anatoly
  2019-04-03 10:01         ` Burakov, Anatoly
  1 sibling, 1 reply; 34+ messages in thread
From: Burakov, Anatoly @ 2019-04-03 10:01 UTC (permalink / raw)
  To: Krakowiak, LukaszX, Hunt, David; +Cc: dev

On 03-Apr-19 10:07 AM, Krakowiak, LukaszX wrote:
> Hi,
> 
>> On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
>>> Add UT check_power_turbo.
>>>
>>> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
>>> ---
>>>    app/test/test_power_cpufreq.c | 72
>> +++++++++++++++++++++++++++++++++++
>>>    1 file changed, 72 insertions(+)
>>>
>>> diff --git a/app/test/test_power_cpufreq.c
>>> b/app/test/test_power_cpufreq.c index d099f2f47..c75c9bf1c 100644
>>> --- a/app/test/test_power_cpufreq.c
>>> +++ b/app/test/test_power_cpufreq.c
>>> @@ -366,6 +366,59 @@ check_power_freq_min(void)
>>>    	return 0;
>>>    }
>>>
>>> +/* Check rte_power_turbo() */
>>> +static int
>>> +check_power_turbo(void)
>>> +{
>>> +	int ret;
>>> +
>>> +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
>>> +		printf("Turbo not available on lcore %u, skipping test\n",
>>> +		TEST_POWER_LCORE_ID);
>>
>> Misleading indentation, please add two tabs to the second line of
>> printf() statement.
>>
>>> +		return 0;
>>> +	}
>>> +
>>> +	/* test with an invalid lcore id */
>>> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
>>> +	if (ret >= 0) {
>>> +		printf("Unexpectedly enable turbo successfully "
>>> +				"on lcore %u\n",
>> TEST_POWER_LCORE_INVALID);
>>
>> Please don't break up strings to multiple lines.
>>
>>> +		return -1;
>>> +	}
>>> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
>>> +	if (ret < 0) {
>>> +		printf("Fail to enable turbo on lcore %u\n",
>>> +
>> 	TEST_POWER_LCORE_ID);
>>
>> I wish there was a middle ground between no indentation and way too much
>> indentation...
>>
>>> +		return -1;
>>> +	}
>>> +
>>> +	/* Check the current frequency */
>>> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
>>> +	if (ret < 0)
>>> +		return -1;
>>> +
>>> +	/* test with an invalid lcore id */
>>> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
>>> +	if (ret >= 0) {
>>> +		printf("Unexpectedly disable turbo successfully "
>>> +				"on lcore %u\n",
>> TEST_POWER_LCORE_INVALID);
>>
>> Same as above, don't break up strings.
>>
>>> +		return -1;
>>> +	}
>>> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
>>> +	if (ret < 0) {
>>> +		printf("Fail to disable turbo on lcore %u\n",
>>> +
>> 	TEST_POWER_LCORE_ID);
>>
>> Same as above, two tabs is enough indentation.
>>
>>> +		return -1;
>>> +	}
>>> +
>>> +	/* Check the current frequency */
>>> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
>>> +	if (ret < 0)
>>> +		return -1;
>>> +
>>> +	return 0;
>>> +}
>>> +
>>>    static int
>>>    test_power_cpufreq(void)
>>>    {
>>> @@ -427,6 +480,21 @@ test_power_cpufreq(void)
>>>    				"been initialised\n");
>>>    		goto fail_all;
>>>    	}
>>> +	if (rte_power_turbo_status == NULL) {
>>> +		printf("rte_power_turbo_status should not be NULL,
>> environment has not "
>>> +				"been initialised\n");
>>
>> Here and below:
>>
>> I don't think saying *why* it should not be NULL - just saying that it shouldn't be
>> NULL is enough. Maybe mention why it's supposed to be not NULL in comments
>> here.
>>
>> Also, i have a suspicion that the message is wrong - why would status be null if
>> the environment was initialized? Presumably it's the other way around?
> 
> I think this is correctly: if env was initialized, pointer != NULL, otherwise env wasn't initialized.
> Rest of all, you are right: coding style issues. Thanks.

The check is if rte_power_turbo_status is equal to NULL. If the check 
fails (i.e. rte_power_turbo_status is not NULL), we get an error message 
saying that rte_power_turbo_status should not be NULL. That doesn't 
compute :) Either it should not be NULL and the check is wrong, or it 
should be NULL and the error message is wrong.

>>
>>> +		goto fail_all;
>>> +	}
>>> +	if (rte_power_freq_enable_turbo == NULL) {
>>> +		printf("rte_power_freq_enable_turbo should not be NULL,
>> environment has not "
>>> +				"been initialised\n");
>>> +		goto fail_all;
>>> +	}
>>> +	if (rte_power_freq_disable_turbo == NULL) {
>>> +		printf("rte_power_freq_disable_turbo should not be NULL,
>> environment has not "
>>> +				"been initialised\n");
>>> +		goto fail_all;
>>> +	}
>>>
>>>    	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>>>    	if (ret < 0) {
>>> @@ -502,6 +570,10 @@ test_power_cpufreq(void)
>>>    	if (ret < 0)
>>>    		goto fail_all;
>>>
>>> +	ret = check_power_turbo();
>>> +	if (ret < 0)
>>> +		goto fail_all;
>>> +
>>>    	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>>>    	if (ret < 0) {
>>>    		printf("Cannot exit power management for lcore %u\n",
>>>
>>
>>
>> --
>> Thanks,
>> Anatoly


-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature
  2019-04-03 10:01       ` Burakov, Anatoly
@ 2019-04-03 10:01         ` Burakov, Anatoly
  0 siblings, 0 replies; 34+ messages in thread
From: Burakov, Anatoly @ 2019-04-03 10:01 UTC (permalink / raw)
  To: Krakowiak, LukaszX, Hunt, David; +Cc: dev

On 03-Apr-19 10:07 AM, Krakowiak, LukaszX wrote:
> Hi,
> 
>> On 07-Mar-19 1:59 PM, Lukasz Krakowiak wrote:
>>> Add UT check_power_turbo.
>>>
>>> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
>>> ---
>>>    app/test/test_power_cpufreq.c | 72
>> +++++++++++++++++++++++++++++++++++
>>>    1 file changed, 72 insertions(+)
>>>
>>> diff --git a/app/test/test_power_cpufreq.c
>>> b/app/test/test_power_cpufreq.c index d099f2f47..c75c9bf1c 100644
>>> --- a/app/test/test_power_cpufreq.c
>>> +++ b/app/test/test_power_cpufreq.c
>>> @@ -366,6 +366,59 @@ check_power_freq_min(void)
>>>    	return 0;
>>>    }
>>>
>>> +/* Check rte_power_turbo() */
>>> +static int
>>> +check_power_turbo(void)
>>> +{
>>> +	int ret;
>>> +
>>> +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
>>> +		printf("Turbo not available on lcore %u, skipping test\n",
>>> +		TEST_POWER_LCORE_ID);
>>
>> Misleading indentation, please add two tabs to the second line of
>> printf() statement.
>>
>>> +		return 0;
>>> +	}
>>> +
>>> +	/* test with an invalid lcore id */
>>> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
>>> +	if (ret >= 0) {
>>> +		printf("Unexpectedly enable turbo successfully "
>>> +				"on lcore %u\n",
>> TEST_POWER_LCORE_INVALID);
>>
>> Please don't break up strings to multiple lines.
>>
>>> +		return -1;
>>> +	}
>>> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
>>> +	if (ret < 0) {
>>> +		printf("Fail to enable turbo on lcore %u\n",
>>> +
>> 	TEST_POWER_LCORE_ID);
>>
>> I wish there was a middle ground between no indentation and way too much
>> indentation...
>>
>>> +		return -1;
>>> +	}
>>> +
>>> +	/* Check the current frequency */
>>> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
>>> +	if (ret < 0)
>>> +		return -1;
>>> +
>>> +	/* test with an invalid lcore id */
>>> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
>>> +	if (ret >= 0) {
>>> +		printf("Unexpectedly disable turbo successfully "
>>> +				"on lcore %u\n",
>> TEST_POWER_LCORE_INVALID);
>>
>> Same as above, don't break up strings.
>>
>>> +		return -1;
>>> +	}
>>> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
>>> +	if (ret < 0) {
>>> +		printf("Fail to disable turbo on lcore %u\n",
>>> +
>> 	TEST_POWER_LCORE_ID);
>>
>> Same as above, two tabs is enough indentation.
>>
>>> +		return -1;
>>> +	}
>>> +
>>> +	/* Check the current frequency */
>>> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
>>> +	if (ret < 0)
>>> +		return -1;
>>> +
>>> +	return 0;
>>> +}
>>> +
>>>    static int
>>>    test_power_cpufreq(void)
>>>    {
>>> @@ -427,6 +480,21 @@ test_power_cpufreq(void)
>>>    				"been initialised\n");
>>>    		goto fail_all;
>>>    	}
>>> +	if (rte_power_turbo_status == NULL) {
>>> +		printf("rte_power_turbo_status should not be NULL,
>> environment has not "
>>> +				"been initialised\n");
>>
>> Here and below:
>>
>> I don't think saying *why* it should not be NULL - just saying that it shouldn't be
>> NULL is enough. Maybe mention why it's supposed to be not NULL in comments
>> here.
>>
>> Also, i have a suspicion that the message is wrong - why would status be null if
>> the environment was initialized? Presumably it's the other way around?
> 
> I think this is correctly: if env was initialized, pointer != NULL, otherwise env wasn't initialized.
> Rest of all, you are right: coding style issues. Thanks.

The check is if rte_power_turbo_status is equal to NULL. If the check 
fails (i.e. rte_power_turbo_status is not NULL), we get an error message 
saying that rte_power_turbo_status should not be NULL. That doesn't 
compute :) Either it should not be NULL and the check is wrong, or it 
should be NULL and the error message is wrong.

>>
>>> +		goto fail_all;
>>> +	}
>>> +	if (rte_power_freq_enable_turbo == NULL) {
>>> +		printf("rte_power_freq_enable_turbo should not be NULL,
>> environment has not "
>>> +				"been initialised\n");
>>> +		goto fail_all;
>>> +	}
>>> +	if (rte_power_freq_disable_turbo == NULL) {
>>> +		printf("rte_power_freq_disable_turbo should not be NULL,
>> environment has not "
>>> +				"been initialised\n");
>>> +		goto fail_all;
>>> +	}
>>>
>>>    	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>>>    	if (ret < 0) {
>>> @@ -502,6 +570,10 @@ test_power_cpufreq(void)
>>>    	if (ret < 0)
>>>    		goto fail_all;
>>>
>>> +	ret = check_power_turbo();
>>> +	if (ret < 0)
>>> +		goto fail_all;
>>> +
>>>    	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>>>    	if (ret < 0) {
>>>    		printf("Cannot exit power management for lcore %u\n",
>>>
>>
>>
>> --
>> Thanks,
>> Anatoly


-- 
Thanks,
Anatoly

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

* [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library
  2019-03-07 13:59 [dpdk-dev] [PATCH 0/3] test: improve test coverage for power library Lukasz Krakowiak
                   ` (2 preceding siblings ...)
  2019-03-07 13:59 ` [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature Lukasz Krakowiak
@ 2019-04-03 10:32 ` Lukasz Krakowiak
  2019-04-03 10:32   ` Lukasz Krakowiak
                     ` (5 more replies)
  3 siblings, 6 replies; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-04-03 10:32 UTC (permalink / raw)
  To: david.hunt; +Cc: anatoly.burakov, dev, Lukasz Krakowiak

This patch rename test_power_acpi_cpufreq.c to test_power_cpufreq.c,
remove prefix _acpi from UT power functions/test names,
add UT for power turbo feature.

---
v2:
* coding style improved

Lukasz Krakowiak (3):
  test: rename test_power_acpi_cpufreq.c ->
    app/test/test_power_cpufreq.c
  test: remove prefix _acpi from UT power function/test names
  test: add UT for power turbo feature

 app/test/Makefile                             |  2 +-
 app/test/autotest_data.py                     |  4 +-
 app/test/meson.build                          |  4 +-
 ...er_acpi_cpufreq.c => test_power_cpufreq.c} | 84 +++++++++++++++++--
 4 files changed, 83 insertions(+), 11 deletions(-)
 rename app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} (86%)

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

* [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library
  2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
@ 2019-04-03 10:32   ` Lukasz Krakowiak
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-04-03 10:32 UTC (permalink / raw)
  To: david.hunt; +Cc: anatoly.burakov, dev, Lukasz Krakowiak

This patch rename test_power_acpi_cpufreq.c to test_power_cpufreq.c,
remove prefix _acpi from UT power functions/test names,
add UT for power turbo feature.

---
v2:
* coding style improved

Lukasz Krakowiak (3):
  test: rename test_power_acpi_cpufreq.c ->
    app/test/test_power_cpufreq.c
  test: remove prefix _acpi from UT power function/test names
  test: add UT for power turbo feature

 app/test/Makefile                             |  2 +-
 app/test/autotest_data.py                     |  4 +-
 app/test/meson.build                          |  4 +-
 ...er_acpi_cpufreq.c => test_power_cpufreq.c} | 84 +++++++++++++++++--
 4 files changed, 83 insertions(+), 11 deletions(-)
 rename app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} (86%)

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

* [dpdk-dev] [PATCH v2 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c
  2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
  2019-04-03 10:32   ` Lukasz Krakowiak
@ 2019-04-03 10:32   ` Lukasz Krakowiak
  2019-04-03 10:32     ` Lukasz Krakowiak
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-04-03 10:32 UTC (permalink / raw)
  To: david.hunt; +Cc: anatoly.burakov, dev, Lukasz Krakowiak

This patch rename file test_power_acpi_cpufreq.c ->
 app/test/test_power_cpufreq.c.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/Makefile                                            | 2 +-
 app/test/meson.build                                         | 2 +-
 app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} (100%)

diff --git a/app/test/Makefile b/app/test/Makefile
index 89949c2bb..d1bcfd456 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -158,7 +158,7 @@ endif
 
 SRCS-$(CONFIG_RTE_LIBRTE_METER) += test_meter.c
 SRCS-$(CONFIG_RTE_LIBRTE_KNI) += test_kni.c
-SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power.c test_power_acpi_cpufreq.c
+SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power.c test_power_cpufreq.c
 SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power_kvm_vm.c
 SRCS-y += test_common.c
 
diff --git a/app/test/meson.build b/app/test/meson.build
index 05e5ddeb0..4ae3dffea 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -82,7 +82,7 @@ test_sources = files('commands.c',
 	'test_pmd_ring.c',
 	'test_pmd_ring_perf.c',
 	'test_power.c',
-	'test_power_acpi_cpufreq.c',
+	'test_power_cpufreq.c',
 	'test_power_kvm_vm.c',
 	'test_prefetch.c',
 	'test_reciprocal_division.c',
diff --git a/app/test/test_power_acpi_cpufreq.c b/app/test/test_power_cpufreq.c
similarity index 100%
rename from app/test/test_power_acpi_cpufreq.c
rename to app/test/test_power_cpufreq.c
-- 
2.19.2.windows.1

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

* [dpdk-dev] [PATCH v2 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
@ 2019-04-03 10:32     ` Lukasz Krakowiak
  0 siblings, 0 replies; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-04-03 10:32 UTC (permalink / raw)
  To: david.hunt; +Cc: anatoly.burakov, dev, Lukasz Krakowiak

This patch rename file test_power_acpi_cpufreq.c ->
 app/test/test_power_cpufreq.c.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/Makefile                                            | 2 +-
 app/test/meson.build                                         | 2 +-
 app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename app/test/{test_power_acpi_cpufreq.c => test_power_cpufreq.c} (100%)

diff --git a/app/test/Makefile b/app/test/Makefile
index 89949c2bb..d1bcfd456 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -158,7 +158,7 @@ endif
 
 SRCS-$(CONFIG_RTE_LIBRTE_METER) += test_meter.c
 SRCS-$(CONFIG_RTE_LIBRTE_KNI) += test_kni.c
-SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power.c test_power_acpi_cpufreq.c
+SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power.c test_power_cpufreq.c
 SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power_kvm_vm.c
 SRCS-y += test_common.c
 
diff --git a/app/test/meson.build b/app/test/meson.build
index 05e5ddeb0..4ae3dffea 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -82,7 +82,7 @@ test_sources = files('commands.c',
 	'test_pmd_ring.c',
 	'test_pmd_ring_perf.c',
 	'test_power.c',
-	'test_power_acpi_cpufreq.c',
+	'test_power_cpufreq.c',
 	'test_power_kvm_vm.c',
 	'test_prefetch.c',
 	'test_reciprocal_division.c',
diff --git a/app/test/test_power_acpi_cpufreq.c b/app/test/test_power_cpufreq.c
similarity index 100%
rename from app/test/test_power_acpi_cpufreq.c
rename to app/test/test_power_cpufreq.c
-- 
2.19.2.windows.1


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

* [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names
  2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
  2019-04-03 10:32   ` Lukasz Krakowiak
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
@ 2019-04-03 10:32   ` Lukasz Krakowiak
  2019-04-03 10:32     ` Lukasz Krakowiak
                       ` (2 more replies)
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature Lukasz Krakowiak
                     ` (2 subsequent siblings)
  5 siblings, 3 replies; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-04-03 10:32 UTC (permalink / raw)
  To: david.hunt; +Cc: anatoly.burakov, dev, Lukasz Krakowiak

This patch remove prefix _acpi from power UT function/test names.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/autotest_data.py     |  4 ++--
 app/test/meson.build          |  2 +-
 app/test/test_power_cpufreq.c | 12 ++++++------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py
index 5f87bb94d..c80801b20 100644
--- a/app/test/autotest_data.py
+++ b/app/test/autotest_data.py
@@ -622,8 +622,8 @@
         "Report":      None,
     },
     {
-        "Name":       "Power ACPI cpufreq autotest",
-        "Command":    "power_acpi_cpufreq_autotest",
+        "Name":       "Power cpufreq autotest",
+        "Command":    "power_cpufreq_autotest",
         "Func":       default_autotest,
         "Report":     None,
     },
diff --git a/app/test/meson.build b/app/test/meson.build
index 4ae3dffea..a389a2b10 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -205,7 +205,7 @@ fast_non_parallel_test_names = [
         'member_autotest',
         'metrics_autotest',
         'pdump_autotest',
-        'power_acpi_cpufreq_autotest',
+        'power_cpufreq_autotest',
         'power_autotest',
         'power_kvm_vm_autotest',
         'reorder_autotest',
diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index 61b1da05a..d099f2f47 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -14,14 +14,14 @@
 #ifndef RTE_LIBRTE_POWER
 
 static int
-test_power_acpi_cpufreq(void)
+test_power_cpufreq(void)
 {
 	printf("Power management library not supported, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
-test_power_acpi_caps(void)
+test_power_caps(void)
 {
 	printf("Power management library not supported, skipping test\n");
 	return TEST_SKIPPED;
@@ -367,7 +367,7 @@ check_power_freq_min(void)
 }
 
 static int
-test_power_acpi_cpufreq(void)
+test_power_cpufreq(void)
 {
 	int ret = -1;
 	enum power_management_env env;
@@ -539,7 +539,7 @@ test_power_acpi_cpufreq(void)
 }
 
 static int
-test_power_acpi_caps(void)
+test_power_caps(void)
 {
 	struct rte_power_core_capabilities caps;
 	int ret;
@@ -568,5 +568,5 @@ test_power_acpi_caps(void)
 
 #endif
 
-REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq);
-REGISTER_TEST_COMMAND(power_acpi_caps_autotest, test_power_acpi_caps);
+REGISTER_TEST_COMMAND(power_cpufreq_autotest, test_power_cpufreq);
+REGISTER_TEST_COMMAND(power_caps_autotest, test_power_caps);
-- 
2.19.2.windows.1

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

* [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
@ 2019-04-03 10:32     ` Lukasz Krakowiak
  2019-04-15 15:14     ` Hunt, David
  2019-04-15 15:32     ` Kevin Traynor
  2 siblings, 0 replies; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-04-03 10:32 UTC (permalink / raw)
  To: david.hunt; +Cc: anatoly.burakov, dev, Lukasz Krakowiak

This patch remove prefix _acpi from power UT function/test names.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/autotest_data.py     |  4 ++--
 app/test/meson.build          |  2 +-
 app/test/test_power_cpufreq.c | 12 ++++++------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py
index 5f87bb94d..c80801b20 100644
--- a/app/test/autotest_data.py
+++ b/app/test/autotest_data.py
@@ -622,8 +622,8 @@
         "Report":      None,
     },
     {
-        "Name":       "Power ACPI cpufreq autotest",
-        "Command":    "power_acpi_cpufreq_autotest",
+        "Name":       "Power cpufreq autotest",
+        "Command":    "power_cpufreq_autotest",
         "Func":       default_autotest,
         "Report":     None,
     },
diff --git a/app/test/meson.build b/app/test/meson.build
index 4ae3dffea..a389a2b10 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -205,7 +205,7 @@ fast_non_parallel_test_names = [
         'member_autotest',
         'metrics_autotest',
         'pdump_autotest',
-        'power_acpi_cpufreq_autotest',
+        'power_cpufreq_autotest',
         'power_autotest',
         'power_kvm_vm_autotest',
         'reorder_autotest',
diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index 61b1da05a..d099f2f47 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -14,14 +14,14 @@
 #ifndef RTE_LIBRTE_POWER
 
 static int
-test_power_acpi_cpufreq(void)
+test_power_cpufreq(void)
 {
 	printf("Power management library not supported, skipping test\n");
 	return TEST_SKIPPED;
 }
 
 static int
-test_power_acpi_caps(void)
+test_power_caps(void)
 {
 	printf("Power management library not supported, skipping test\n");
 	return TEST_SKIPPED;
@@ -367,7 +367,7 @@ check_power_freq_min(void)
 }
 
 static int
-test_power_acpi_cpufreq(void)
+test_power_cpufreq(void)
 {
 	int ret = -1;
 	enum power_management_env env;
@@ -539,7 +539,7 @@ test_power_acpi_cpufreq(void)
 }
 
 static int
-test_power_acpi_caps(void)
+test_power_caps(void)
 {
 	struct rte_power_core_capabilities caps;
 	int ret;
@@ -568,5 +568,5 @@ test_power_acpi_caps(void)
 
 #endif
 
-REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq);
-REGISTER_TEST_COMMAND(power_acpi_caps_autotest, test_power_acpi_caps);
+REGISTER_TEST_COMMAND(power_cpufreq_autotest, test_power_cpufreq);
+REGISTER_TEST_COMMAND(power_caps_autotest, test_power_caps);
-- 
2.19.2.windows.1


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

* [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature
  2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
                     ` (2 preceding siblings ...)
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
@ 2019-04-03 10:32   ` Lukasz Krakowiak
  2019-04-03 10:32     ` Lukasz Krakowiak
                       ` (2 more replies)
  2019-04-22 20:42   ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Thomas Monjalon
  2019-07-05  7:35   ` Thomas Monjalon
  5 siblings, 3 replies; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-04-03 10:32 UTC (permalink / raw)
  To: david.hunt; +Cc: anatoly.burakov, dev, Lukasz Krakowiak

Add UT check_power_turbo.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/test_power_cpufreq.c | 72 +++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index d099f2f47..d203810da 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -366,6 +366,59 @@ check_power_freq_min(void)
 	return 0;
 }
 
+/* Check rte_power_turbo() */
+static int
+check_power_turbo(void)
+{
+	int ret;
+
+	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
+		printf("Turbo not available on lcore %u, skipping test\n",
+				TEST_POWER_LCORE_ID);
+		return 0;
+	}
+
+	/* test with an invalid lcore id */
+	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
+	if (ret >= 0) {
+		printf("Unexpectedly enable turbo successfully on lcore %u\n",
+				TEST_POWER_LCORE_INVALID);
+		return -1;
+	}
+	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Fail to enable turbo on lcore %u\n",
+				TEST_POWER_LCORE_ID);
+		return -1;
+	}
+
+	/* Check the current frequency */
+	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
+	if (ret < 0)
+		return -1;
+
+	/* test with an invalid lcore id */
+	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
+	if (ret >= 0) {
+		printf("Unexpectedly disable turbo successfully on lcore %u\n",
+				TEST_POWER_LCORE_INVALID);
+		return -1;
+	}
+	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Fail to disable turbo on lcore %u\n",
+				TEST_POWER_LCORE_ID);
+		return -1;
+	}
+
+	/* Check the current frequency */
+	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
+	if (ret < 0)
+		return -1;
+
+	return 0;
+}
+
 static int
 test_power_cpufreq(void)
 {
@@ -427,6 +480,21 @@ test_power_cpufreq(void)
 				"been initialised\n");
 		goto fail_all;
 	}
+	if (rte_power_turbo_status == NULL) {
+		printf("rte_power_turbo_status should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
+	if (rte_power_freq_enable_turbo == NULL) {
+		printf("rte_power_freq_enable_turbo should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
+	if (rte_power_freq_disable_turbo == NULL) {
+		printf("rte_power_freq_disable_turbo should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
 
 	ret = rte_power_exit(TEST_POWER_LCORE_ID);
 	if (ret < 0) {
@@ -502,6 +570,10 @@ test_power_cpufreq(void)
 	if (ret < 0)
 		goto fail_all;
 
+	ret = check_power_turbo();
+	if (ret < 0)
+		goto fail_all;
+
 	ret = rte_power_exit(TEST_POWER_LCORE_ID);
 	if (ret < 0) {
 		printf("Cannot exit power management for lcore %u\n",
-- 
2.19.2.windows.1

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

* [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature Lukasz Krakowiak
@ 2019-04-03 10:32     ` Lukasz Krakowiak
  2019-04-15 15:22     ` Hunt, David
  2019-06-07  8:45     ` Hajkowski, MarcinX
  2 siblings, 0 replies; 34+ messages in thread
From: Lukasz Krakowiak @ 2019-04-03 10:32 UTC (permalink / raw)
  To: david.hunt; +Cc: anatoly.burakov, dev, Lukasz Krakowiak

Add UT check_power_turbo.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 app/test/test_power_cpufreq.c | 72 +++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
index d099f2f47..d203810da 100644
--- a/app/test/test_power_cpufreq.c
+++ b/app/test/test_power_cpufreq.c
@@ -366,6 +366,59 @@ check_power_freq_min(void)
 	return 0;
 }
 
+/* Check rte_power_turbo() */
+static int
+check_power_turbo(void)
+{
+	int ret;
+
+	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
+		printf("Turbo not available on lcore %u, skipping test\n",
+				TEST_POWER_LCORE_ID);
+		return 0;
+	}
+
+	/* test with an invalid lcore id */
+	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
+	if (ret >= 0) {
+		printf("Unexpectedly enable turbo successfully on lcore %u\n",
+				TEST_POWER_LCORE_INVALID);
+		return -1;
+	}
+	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Fail to enable turbo on lcore %u\n",
+				TEST_POWER_LCORE_ID);
+		return -1;
+	}
+
+	/* Check the current frequency */
+	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
+	if (ret < 0)
+		return -1;
+
+	/* test with an invalid lcore id */
+	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
+	if (ret >= 0) {
+		printf("Unexpectedly disable turbo successfully on lcore %u\n",
+				TEST_POWER_LCORE_INVALID);
+		return -1;
+	}
+	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
+	if (ret < 0) {
+		printf("Fail to disable turbo on lcore %u\n",
+				TEST_POWER_LCORE_ID);
+		return -1;
+	}
+
+	/* Check the current frequency */
+	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
+	if (ret < 0)
+		return -1;
+
+	return 0;
+}
+
 static int
 test_power_cpufreq(void)
 {
@@ -427,6 +480,21 @@ test_power_cpufreq(void)
 				"been initialised\n");
 		goto fail_all;
 	}
+	if (rte_power_turbo_status == NULL) {
+		printf("rte_power_turbo_status should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
+	if (rte_power_freq_enable_turbo == NULL) {
+		printf("rte_power_freq_enable_turbo should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
+	if (rte_power_freq_disable_turbo == NULL) {
+		printf("rte_power_freq_disable_turbo should not be NULL, environment has not "
+				"been initialised\n");
+		goto fail_all;
+	}
 
 	ret = rte_power_exit(TEST_POWER_LCORE_ID);
 	if (ret < 0) {
@@ -502,6 +570,10 @@ test_power_cpufreq(void)
 	if (ret < 0)
 		goto fail_all;
 
+	ret = check_power_turbo();
+	if (ret < 0)
+		goto fail_all;
+
 	ret = rte_power_exit(TEST_POWER_LCORE_ID);
 	if (ret < 0) {
 		printf("Cannot exit power management for lcore %u\n",
-- 
2.19.2.windows.1


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

* Re: [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
  2019-04-03 10:32     ` Lukasz Krakowiak
@ 2019-04-15 15:14     ` Hunt, David
  2019-04-15 15:14       ` Hunt, David
  2019-04-15 15:32     ` Kevin Traynor
  2 siblings, 1 reply; 34+ messages in thread
From: Hunt, David @ 2019-04-15 15:14 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: anatoly.burakov, dev


On 3/4/2019 11:32 AM, Lukasz Krakowiak wrote:
> This patch remove prefix _acpi from power UT function/test names.
>
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

I would agree with Thomas, this patch should probably be merged with the 
file rename patch.

Rgds,
Dave.

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

* Re: [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names
  2019-04-15 15:14     ` Hunt, David
@ 2019-04-15 15:14       ` Hunt, David
  0 siblings, 0 replies; 34+ messages in thread
From: Hunt, David @ 2019-04-15 15:14 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: anatoly.burakov, dev


On 3/4/2019 11:32 AM, Lukasz Krakowiak wrote:
> This patch remove prefix _acpi from power UT function/test names.
>
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

I would agree with Thomas, this patch should probably be merged with the 
file rename patch.

Rgds,
Dave.



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

* Re: [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature Lukasz Krakowiak
  2019-04-03 10:32     ` Lukasz Krakowiak
@ 2019-04-15 15:22     ` Hunt, David
  2019-04-15 15:22       ` Hunt, David
  2019-06-07  8:45     ` Hajkowski, MarcinX
  2 siblings, 1 reply; 34+ messages in thread
From: Hunt, David @ 2019-04-15 15:22 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: anatoly.burakov, dev


On 3/4/2019 11:32 AM, Lukasz Krakowiak wrote:
> Add UT check_power_turbo.
>
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---
>   app/test/test_power_cpufreq.c | 72 +++++++++++++++++++++++++++++++++++
>   1 file changed, 72 insertions(+)
>
> diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
> index d099f2f47..d203810da 100644
> --- a/app/test/test_power_cpufreq.c
> +++ b/app/test/test_power_cpufreq.c
> @@ -366,6 +366,59 @@ check_power_freq_min(void)
>   	return 0;
>   }
>   
> +/* Check rte_power_turbo() */
> +static int
> +check_power_turbo(void)
> +{
> +	int ret;
> +
> +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
> +		printf("Turbo not available on lcore %u, skipping test\n",
> +				TEST_POWER_LCORE_ID);
> +		return 0;
> +	}
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly enable turbo successfully on lcore %u\n",
> +				TEST_POWER_LCORE_INVALID);
> +		return -1;
> +	}
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to enable turbo on lcore %u\n",
> +				TEST_POWER_LCORE_ID);
> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
> +	if (ret < 0)
> +		return -1;
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly disable turbo successfully on lcore %u\n",
> +				TEST_POWER_LCORE_INVALID);
> +		return -1;
> +	}
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to disable turbo on lcore %u\n",
> +				TEST_POWER_LCORE_ID);
> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
> +	if (ret < 0)
> +		return -1;
> +
> +	return 0;
> +}
> +
>   static int
>   test_power_cpufreq(void)
>   {
> @@ -427,6 +480,21 @@ test_power_cpufreq(void)
>   				"been initialised\n");
>   		goto fail_all;
>   	}
> +	if (rte_power_turbo_status == NULL) {
> +		printf("rte_power_turbo_status should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> +	if (rte_power_freq_enable_turbo == NULL) {
> +		printf("rte_power_freq_enable_turbo should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> +	if (rte_power_freq_disable_turbo == NULL) {
> +		printf("rte_power_freq_disable_turbo should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
>   
>   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>   	if (ret < 0) {
> @@ -502,6 +570,10 @@ test_power_cpufreq(void)
>   	if (ret < 0)
>   		goto fail_all;
>   
> +	ret = check_power_turbo();
> +	if (ret < 0)
> +		goto fail_all;
> +
>   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>   	if (ret < 0) {
>   		printf("Cannot exit power management for lcore %u\n",


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

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

* Re: [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature
  2019-04-15 15:22     ` Hunt, David
@ 2019-04-15 15:22       ` Hunt, David
  0 siblings, 0 replies; 34+ messages in thread
From: Hunt, David @ 2019-04-15 15:22 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: anatoly.burakov, dev


On 3/4/2019 11:32 AM, Lukasz Krakowiak wrote:
> Add UT check_power_turbo.
>
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---
>   app/test/test_power_cpufreq.c | 72 +++++++++++++++++++++++++++++++++++
>   1 file changed, 72 insertions(+)
>
> diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
> index d099f2f47..d203810da 100644
> --- a/app/test/test_power_cpufreq.c
> +++ b/app/test/test_power_cpufreq.c
> @@ -366,6 +366,59 @@ check_power_freq_min(void)
>   	return 0;
>   }
>   
> +/* Check rte_power_turbo() */
> +static int
> +check_power_turbo(void)
> +{
> +	int ret;
> +
> +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
> +		printf("Turbo not available on lcore %u, skipping test\n",
> +				TEST_POWER_LCORE_ID);
> +		return 0;
> +	}
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly enable turbo successfully on lcore %u\n",
> +				TEST_POWER_LCORE_INVALID);
> +		return -1;
> +	}
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to enable turbo on lcore %u\n",
> +				TEST_POWER_LCORE_ID);
> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
> +	if (ret < 0)
> +		return -1;
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly disable turbo successfully on lcore %u\n",
> +				TEST_POWER_LCORE_INVALID);
> +		return -1;
> +	}
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to disable turbo on lcore %u\n",
> +				TEST_POWER_LCORE_ID);
> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
> +	if (ret < 0)
> +		return -1;
> +
> +	return 0;
> +}
> +
>   static int
>   test_power_cpufreq(void)
>   {
> @@ -427,6 +480,21 @@ test_power_cpufreq(void)
>   				"been initialised\n");
>   		goto fail_all;
>   	}
> +	if (rte_power_turbo_status == NULL) {
> +		printf("rte_power_turbo_status should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> +	if (rte_power_freq_enable_turbo == NULL) {
> +		printf("rte_power_freq_enable_turbo should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> +	if (rte_power_freq_disable_turbo == NULL) {
> +		printf("rte_power_freq_disable_turbo should not be NULL, environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
>   
>   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>   	if (ret < 0) {
> @@ -502,6 +570,10 @@ test_power_cpufreq(void)
>   	if (ret < 0)
>   		goto fail_all;
>   
> +	ret = check_power_turbo();
> +	if (ret < 0)
> +		goto fail_all;
> +
>   	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>   	if (ret < 0) {
>   		printf("Cannot exit power management for lcore %u\n",


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



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

* Re: [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
  2019-04-03 10:32     ` Lukasz Krakowiak
  2019-04-15 15:14     ` Hunt, David
@ 2019-04-15 15:32     ` Kevin Traynor
  2019-04-15 15:32       ` Kevin Traynor
  2 siblings, 1 reply; 34+ messages in thread
From: Kevin Traynor @ 2019-04-15 15:32 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: anatoly.burakov, dev

On 03/04/2019 11:32, Lukasz Krakowiak wrote:
> This patch remove prefix _acpi from power UT function/test names.
>

Hi, why is it better? Asking because it might mean you have to send some
future fixes separately to stable branches.

> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

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

* Re: [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names
  2019-04-15 15:32     ` Kevin Traynor
@ 2019-04-15 15:32       ` Kevin Traynor
  0 siblings, 0 replies; 34+ messages in thread
From: Kevin Traynor @ 2019-04-15 15:32 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: anatoly.burakov, dev

On 03/04/2019 11:32, Lukasz Krakowiak wrote:
> This patch remove prefix _acpi from power UT function/test names.
>

Hi, why is it better? Asking because it might mean you have to send some
future fixes separately to stable branches.

> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---


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

* Re: [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library
  2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
                     ` (3 preceding siblings ...)
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature Lukasz Krakowiak
@ 2019-04-22 20:42   ` Thomas Monjalon
  2019-04-22 20:42     ` Thomas Monjalon
  2019-07-05  7:35   ` Thomas Monjalon
  5 siblings, 1 reply; 34+ messages in thread
From: Thomas Monjalon @ 2019-04-22 20:42 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: dev, david.hunt, anatoly.burakov

> Lukasz Krakowiak (3):
>   test: rename test_power_acpi_cpufreq.c ->
>     app/test/test_power_cpufreq.c
>   test: remove prefix _acpi from UT power function/test names
>   test: add UT for power turbo feature

No review, no merge, sorry.

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

* Re: [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library
  2019-04-22 20:42   ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Thomas Monjalon
@ 2019-04-22 20:42     ` Thomas Monjalon
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Monjalon @ 2019-04-22 20:42 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: dev, david.hunt, anatoly.burakov

> Lukasz Krakowiak (3):
>   test: rename test_power_acpi_cpufreq.c ->
>     app/test/test_power_cpufreq.c
>   test: remove prefix _acpi from UT power function/test names
>   test: add UT for power turbo feature

No review, no merge, sorry.



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

* Re: [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature
  2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature Lukasz Krakowiak
  2019-04-03 10:32     ` Lukasz Krakowiak
  2019-04-15 15:22     ` Hunt, David
@ 2019-06-07  8:45     ` Hajkowski, MarcinX
  2 siblings, 0 replies; 34+ messages in thread
From: Hajkowski, MarcinX @ 2019-06-07  8:45 UTC (permalink / raw)
  To: Krakowiak, LukaszX, Hunt, David; +Cc: Burakov, Anatoly, dev, Krakowiak, LukaszX


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Lukasz Krakowiak
> Sent: Wednesday, April 3, 2019 12:33 PM
> To: Hunt, David <david.hunt@intel.com>
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; dev@dpdk.org;
> Krakowiak, LukaszX <lukaszx.krakowiak@intel.com>
> Subject: [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature
> 
> Add UT check_power_turbo.
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---
>  app/test/test_power_cpufreq.c | 72
> +++++++++++++++++++++++++++++++++++
>  1 file changed, 72 insertions(+)
> 
> diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
> index d099f2f47..d203810da 100644
> --- a/app/test/test_power_cpufreq.c
> +++ b/app/test/test_power_cpufreq.c
> @@ -366,6 +366,59 @@ check_power_freq_min(void)
>  	return 0;
>  }
> 
> +/* Check rte_power_turbo() */
> +static int
> +check_power_turbo(void)
> +{
> +	int ret;
> +
> +	if (rte_power_turbo_status(TEST_POWER_LCORE_ID) == 0) {
> +		printf("Turbo not available on lcore %u, skipping test\n",
> +				TEST_POWER_LCORE_ID);
> +		return 0;
> +	}
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly enable turbo successfully on lcore
> %u\n",
> +				TEST_POWER_LCORE_INVALID);
> +		return -1;
> +	}
> +	ret = rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to enable turbo on lcore %u\n",
> +				TEST_POWER_LCORE_ID);
> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 0);
> +	if (ret < 0)
> +		return -1;
> +
> +	/* test with an invalid lcore id */
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID);
> +	if (ret >= 0) {
> +		printf("Unexpectedly disable turbo successfully on lcore
> %u\n",
> +				TEST_POWER_LCORE_INVALID);
> +		return -1;
> +	}
> +	ret = rte_power_freq_disable_turbo(TEST_POWER_LCORE_ID);
> +	if (ret < 0) {
> +		printf("Fail to disable turbo on lcore %u\n",
> +				TEST_POWER_LCORE_ID);
> +		return -1;
> +	}
> +
> +	/* Check the current frequency */
> +	ret = check_cur_freq(TEST_POWER_LCORE_ID, 1);
> +	if (ret < 0)
> +		return -1;
> +
> +	return 0;
> +}
> +
>  static int
>  test_power_cpufreq(void)
>  {
> @@ -427,6 +480,21 @@ test_power_cpufreq(void)
>  				"been initialised\n");
>  		goto fail_all;
>  	}
> +	if (rte_power_turbo_status == NULL) {
> +		printf("rte_power_turbo_status should not be NULL,
> environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> +	if (rte_power_freq_enable_turbo == NULL) {
> +		printf("rte_power_freq_enable_turbo should not be NULL,
> environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> +	if (rte_power_freq_disable_turbo == NULL) {
> +		printf("rte_power_freq_disable_turbo should not be NULL,
> environment has not "
> +				"been initialised\n");
> +		goto fail_all;
> +	}
> 
>  	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>  	if (ret < 0) {
> @@ -502,6 +570,10 @@ test_power_cpufreq(void)
>  	if (ret < 0)
>  		goto fail_all;
> 
> +	ret = check_power_turbo();
> +	if (ret < 0)
> +		goto fail_all;
> +
>  	ret = rte_power_exit(TEST_POWER_LCORE_ID);
>  	if (ret < 0) {
>  		printf("Cannot exit power management for lcore %u\n",
> --
> 2.19.2.windows.1

Tested-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>

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

* Re: [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library
  2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
                     ` (4 preceding siblings ...)
  2019-04-22 20:42   ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Thomas Monjalon
@ 2019-07-05  7:35   ` Thomas Monjalon
  5 siblings, 0 replies; 34+ messages in thread
From: Thomas Monjalon @ 2019-07-05  7:35 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: dev, david.hunt, anatoly.burakov

03/04/2019 12:32, Lukasz Krakowiak:
> Lukasz Krakowiak (3):
>   test: rename test_power_acpi_cpufreq.c ->
>     app/test/test_power_cpufreq.c
>   test: remove prefix _acpi from UT power function/test names
>   test: add UT for power turbo feature

I decided to squash first 2 patches and apply,
even if we don't have answer to some questions.



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

end of thread, other threads:[~2019-07-05  7:35 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 13:59 [dpdk-dev] [PATCH 0/3] test: improve test coverage for power library Lukasz Krakowiak
2019-03-07 13:59 ` [dpdk-dev] [PATCH 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
2019-03-27 15:05   ` Burakov, Anatoly
2019-03-27 15:05     ` Burakov, Anatoly
2019-03-07 13:59 ` [dpdk-dev] [PATCH 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
2019-03-27 15:07   ` Burakov, Anatoly
2019-03-27 15:07     ` Burakov, Anatoly
2019-03-29 22:40     ` Thomas Monjalon
2019-03-29 22:40       ` Thomas Monjalon
2019-03-07 13:59 ` [dpdk-dev] [PATCH 3/3] test: add UT for power turbo feature Lukasz Krakowiak
2019-03-27 15:13   ` Burakov, Anatoly
2019-03-27 15:13     ` Burakov, Anatoly
2019-04-03  9:07     ` Krakowiak, LukaszX
2019-04-03  9:07       ` Krakowiak, LukaszX
2019-04-03 10:01       ` Burakov, Anatoly
2019-04-03 10:01         ` Burakov, Anatoly
2019-04-03 10:32 ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Lukasz Krakowiak
2019-04-03 10:32   ` Lukasz Krakowiak
2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 1/3] test: rename test_power_acpi_cpufreq.c -> app/test/test_power_cpufreq.c Lukasz Krakowiak
2019-04-03 10:32     ` Lukasz Krakowiak
2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 2/3] test: remove prefix _acpi from UT power function/test names Lukasz Krakowiak
2019-04-03 10:32     ` Lukasz Krakowiak
2019-04-15 15:14     ` Hunt, David
2019-04-15 15:14       ` Hunt, David
2019-04-15 15:32     ` Kevin Traynor
2019-04-15 15:32       ` Kevin Traynor
2019-04-03 10:32   ` [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature Lukasz Krakowiak
2019-04-03 10:32     ` Lukasz Krakowiak
2019-04-15 15:22     ` Hunt, David
2019-04-15 15:22       ` Hunt, David
2019-06-07  8:45     ` Hajkowski, MarcinX
2019-04-22 20:42   ` [dpdk-dev] [PATCH v2 0/3] test: improve test coverage for power library Thomas Monjalon
2019-04-22 20:42     ` Thomas Monjalon
2019-07-05  7:35   ` Thomas Monjalon

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).