From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EC9D7A0096 for ; Fri, 7 Jun 2019 10:45:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E5703798; Fri, 7 Jun 2019 10:45:21 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EEE112E8F for ; Fri, 7 Jun 2019 10:45:18 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2019 01:45:17 -0700 X-ExtLoop1: 1 Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga006.jf.intel.com with ESMTP; 07 Jun 2019 01:45:16 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.227]) by IRSMSX152.ger.corp.intel.com ([169.254.6.212]) with mapi id 14.03.0415.000; Fri, 7 Jun 2019 09:45:15 +0100 From: "Hajkowski, MarcinX" To: "Krakowiak, LukaszX" , "Hunt, David" CC: "Burakov, Anatoly" , "dev@dpdk.org" , "Krakowiak, LukaszX" Thread-Topic: [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature Thread-Index: AQHU6gjXMhYR7O8OYUayx2EJtzeC1qaQRYMw Date: Fri, 7 Jun 2019 08:45:14 +0000 Message-ID: <7AE8A440E9E11A43ABE083B4E74B60F94CE0C6@IRSMSX104.ger.corp.intel.com> References: <20190307135950.30738-1-lukaszx.krakowiak@intel.com> <20190403103256.21856-1-lukaszx.krakowiak@intel.com> <20190403103256.21856-4-lukaszx.krakowiak@intel.com> In-Reply-To: <20190403103256.21856-4-lukaszx.krakowiak@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWY5ZGNkMDgtYmJlNC00NDY1LWJiMWMtNzQzOGVkNmU4MmM1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRVpsdzhLXC8zNVNFU1NxRGtJVVN2MnFYbGE5a21KeFk0YjZDM1wvKys5Q0RSajRvYUloUVkzMTRoUXh3SWNOTEE3In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----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 > Cc: Burakov, Anatoly ; dev@dpdk.org; > Krakowiak, LukaszX > Subject: [dpdk-dev] [PATCH v2 3/3] test: add UT for power turbo feature >=20 > Add UT check_power_turbo. >=20 > Signed-off-by: Lukasz Krakowiak > --- > app/test/test_power_cpufreq.c | 72 > +++++++++++++++++++++++++++++++++++ > 1 file changed, 72 insertions(+) >=20 > 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; > } >=20 > +/* Check rte_power_turbo() */ > +static int > +check_power_turbo(void) > +{ > + int ret; > + > + if (rte_power_turbo_status(TEST_POWER_LCORE_ID) =3D=3D 0) { > + printf("Turbo not available on lcore %u, skipping test\n", > + TEST_POWER_LCORE_ID); > + return 0; > + } > + > + /* test with an invalid lcore id */ > + ret =3D rte_power_freq_enable_turbo(TEST_POWER_LCORE_INVALID); > + if (ret >=3D 0) { > + printf("Unexpectedly enable turbo successfully on lcore > %u\n", > + TEST_POWER_LCORE_INVALID); > + return -1; > + } > + ret =3D 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 =3D check_cur_freq(TEST_POWER_LCORE_ID, 0); > + if (ret < 0) > + return -1; > + > + /* test with an invalid lcore id */ > + ret =3D rte_power_freq_disable_turbo(TEST_POWER_LCORE_INVALID); > + if (ret >=3D 0) { > + printf("Unexpectedly disable turbo successfully on lcore > %u\n", > + TEST_POWER_LCORE_INVALID); > + return -1; > + } > + ret =3D 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 =3D 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 =3D=3D 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 =3D=3D 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 =3D=3D NULL) { > + printf("rte_power_freq_disable_turbo should not be NULL, > environment has not " > + "been initialised\n"); > + goto fail_all; > + } >=20 > ret =3D rte_power_exit(TEST_POWER_LCORE_ID); > if (ret < 0) { > @@ -502,6 +570,10 @@ test_power_cpufreq(void) > if (ret < 0) > goto fail_all; >=20 > + ret =3D check_power_turbo(); > + if (ret < 0) > + goto fail_all; > + > ret =3D 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