From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 257DA1E2BE for ; Tue, 12 Jun 2018 03:43:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2018 18:43:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,212,1526367600"; d="scan'208";a="236612897" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 11 Jun 2018 18:43:12 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Jun 2018 18:43:12 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Jun 2018 18:43:11 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.87]) with mapi id 14.03.0319.002; Tue, 12 Jun 2018 09:43:10 +0800 From: "Liu, Yong" To: "Lu, PeipeiX" , "dts@dpdk.org" CC: "Lu, PeipeiX" Thread-Topic: [dts] [PATCH V1] fix the ports and core from different socket Thread-Index: AQHT+MQenUjFOeSvXUiGxYeN+Op0IqRb6rJA Date: Tue, 12 Jun 2018 01:43:09 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E630C2016@SHSMSX103.ccr.corp.intel.com> References: <1527759995-33457-1-git-send-email-peipeix.lu@intel.com> In-Reply-To: <1527759995-33457-1-git-send-email-peipeix.lu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjEwNjNkM2QtMTUxZC00NTQxLTg5MWEtN2FjNWI0MjIyMzdkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY1pzRFdqM2FidE5EQVkyR205ZVlNTWpvTEtKZGs3Z1ZENkp5XC85c0t4TExWc2tqVlQxdWY5SzZcL2xSR1pHak52In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] fix the ports and core from different socket 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: , X-List-Received-Date: Tue, 12 Jun 2018 01:43:14 -0000 Peipei,=20 Some comments below. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lu,peipei > Sent: Thursday, May 31, 2018 5:47 PM > To: dts@dpdk.org > Cc: Lu, PeipeiX > Subject: [dts] [PATCH V1] fix the ports and core from different socket >=20 > the cases need ports and cores from the same socket. > --- > tests/TestSuite_unit_tests_pmd_perf.py | 24 ++++++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) >=20 > diff --git a/tests/TestSuite_unit_tests_pmd_perf.py > b/tests/TestSuite_unit_tests_pmd_perf.py > index 7fc200e..a72d470 100644 > --- a/tests/TestSuite_unit_tests_pmd_perf.py > +++ b/tests/TestSuite_unit_tests_pmd_perf.py > @@ -85,12 +85,28 @@ class TestUnitTestsPmdPerf(TestCase): > """ > pass >=20 > + def get_core_from_socket(self): > + """ > + select the port and lcores from same socket. > + """ > + out =3D self.dut.send_expect("./usertools/cpu_layout.py","#", 10) > + k =3D re.search("Core 0 (.*)", out) > + result =3D re.findall("(\d+),", k.group()) > + port =3D self.dut.ports_info[0]['pci'] > + m =3D re.findall(":(\d+):", port) > + if int(m[0]) < 10: > + return int(result[0]) > + else: > + return int(result[1]) > + Can't assume socket ID just from bus ID. There's one way to get this inform= ation, by "ports_info[0]['port'].socket". Please take care that socket value maybe -1.=20 > def test_pmd_burst(self): > """ > Run pmd stream control mode burst test case. > """ > + self.core =3D self.get_core_from_socket() > + Code is not aligned here, please check indent. > + self.dut.send_expect("./test/test/test -n 1 --lcores=3D'%d- > %d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60) >=20 > - self.dut.send_expect("./test/test/test -n 1 -c f", > "R.*T.*E.*>.*>", 60) > for mode in self.burst_ctlmodes: > self.dut.send_expect("set_rxtx_sc %s" % mode, "RTE>>", 10) > out =3D self.dut.send_expect("pmd_perf_autotest", "RTE>>", 1= 20) > @@ -105,7 +121,7 @@ class TestUnitTestsPmdPerf(TestCase): > """ > Run pmd stream control mode continues test case. > """ > - > + self.core =3D self.get_core_from_socket() Code is not aligned here, please check indent.=20 > self.table_header =3D ['Mode'] > self.table_header +=3D self.anchors > self.result_table_create(self.table_header) > @@ -113,9 +129,9 @@ class TestUnitTestsPmdPerf(TestCase): >=20 > for mode in self.rxtx_modes: > if mode is "scalar": > - self.dut.send_expect("./test/test/test_scalar -n 1 -c f"= , > "R.*T.*E.*>.*>", 60) > + self.dut.send_expect("./test/test/test_scalar -n 1 -- > lcores=3D'%d-%d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60) > else: > - self.dut.send_expect("./test/test/test -n 1 -c f", > "R.*T.*E.*>.*>", 60) > + self.dut.send_expect("./test/test/test -n 1 --lcores=3D'= %d- > %d'" %(self.core, self.core + 6), "R.*T.*E.*>.*>", 60) >=20 > table_row =3D [mode] > self.dut.send_expect("set_rxtx_sc continuous", "RTE>>", 10) > -- > 1.9.3