From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 65CCAA0540; Mon, 20 Jul 2020 09:01:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C5EA11BEE4; Mon, 20 Jul 2020 09:01:24 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 98D7C1BEE3 for ; Mon, 20 Jul 2020 09:01:22 +0200 (CEST) IronPort-SDR: h8dLiM1ViwKOZYrlese94qULcCSisSLEV88MQBNgbfSx2nZL9KLZB4o7u9n+CjNP5TDfAXVst3 /vak6HKSsRtA== X-IronPort-AV: E=McAfee;i="6000,8403,9687"; a="149848864" X-IronPort-AV: E=Sophos;i="5.75,374,1589266800"; d="scan'208";a="149848864" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 00:01:21 -0700 IronPort-SDR: 6cH5zuIssMDpAwcYnkyeFvpY+TyLzUb2W2d3C6Q8yZURmQS54KrX/PNqFeh1uyxVxEomDO3nDb 3srDZPJJ609A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,374,1589266800"; d="scan'208";a="461579795" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 20 Jul 2020 00:01:21 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 00:01:21 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 20 Jul 2020 00:01:20 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 20 Jul 2020 00:01:20 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.22]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.135]) with mapi id 14.03.0439.000; Mon, 20 Jul 2020 15:01:17 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Yao, Lei A" CC: "Mo, YufengX" Thread-Topic: [dts] [PATCH V1 1/1] power_branch_ratio: fix port release issue Thread-Index: AQHWVCELrfXbUObnFEGckbjuADc9J6kQHtLA Date: Mon, 20 Jul 2020 07:01:17 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC821F9@SHSMSX101.ccr.corp.intel.com> References: <20200707053854.13787-1-yufengx.mo@intel.com> <20200707053854.13787-2-yufengx.mo@intel.com> In-Reply-To: <20200707053854.13787-2-yufengx.mo@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1 1/1] power_branch_ratio: fix port release issue X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts On Behalf Of yufengmx > Sent: 2020=1B$BG/=1B(B7=1B$B7n=1B(B7=1B$BF|=1B(B 13:39 > To: dts@dpdk.org; Yao, Lei A > Cc: Mo, YufengX > Subject: [dts] [PATCH V1 1/1] power_branch_ratio: fix port release issue >=20 >=20 > #. fix port release issue. >=20 > Signed-off-by: yufengmx > --- > tests/TestSuite_power_branch_ratio.py | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) >=20 > diff --git a/tests/TestSuite_power_branch_ratio.py > b/tests/TestSuite_power_branch_ratio.py > index 8bd82d4..b45ebcb 100644 > --- a/tests/TestSuite_power_branch_ratio.py > +++ b/tests/TestSuite_power_branch_ratio.py > @@ -303,10 +303,12 @@ class TestPowerBranchRatio(TestCase): > self.dut.build_install_dpdk(self.target) >=20 > @contextmanager > - def restore_compilation(self): > + def restore_environment(self): > try: > yield > finally: > + time.sleep(10) > + self.restore_port_drv() > sw_table =3D [ > "CONFIG_RTE_LIBRTE_POWER", > "CONFIG_RTE_LIBRTE_POWER_DEBUG", @@ -319,6 +321,17 @@ > class TestPowerBranchRatio(TestCase): > # re-compile dpdk source code > self.dut.build_install_dpdk(self.target) >=20 > + def restore_port_drv(self): > + driver =3D self.drivername > + for port in self.dut.ports_info: > + netdev =3D port.get('port') > + if not netdev: > + continue > + cur_drv =3D netdev.get_nic_driver() > + if cur_drv =3D=3D driver: > + continue > + netdev.bind_driver(driver) > + > def init_vm_power_mgr(self): > self.vm_power_mgr =3D self.prepare_binary('vm_power_manager') >=20 > @@ -652,7 +665,7 @@ class TestPowerBranchRatio(TestCase): > """ > Run after each test suite. > """ > - with self.restore_compilation(): > + with self.restore_environment(): > self.close_vm() >=20 > def set_up(self): > -- > 2.21.0