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 217EDA0613 for ; Thu, 26 Sep 2019 03:53:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B7A791E34; Thu, 26 Sep 2019 03:53:06 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 292411DB9 for ; Thu, 26 Sep 2019 03:53:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 18:53:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,549,1559545200"; d="scan'208";a="191533679" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 25 Sep 2019 18:53:02 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Sep 2019 18:53:02 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Sep 2019 18:53:01 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.89]) with mapi id 14.03.0439.000; Thu, 26 Sep 2019 09:52:59 +0800 From: "Tu, Lijuan" To: "Zeng, XiaoxiaoX" , "dts@dpdk.org" CC: "Zeng, XiaoxiaoX" Thread-Topic: [dts] [PATCH V2] tests/TestSuite_multiprocess: add case Thread-Index: AQHVaIcMDrgskBVeTEq8eEJ9uxBcnKc9SShQ Date: Thu, 26 Sep 2019 01:52:58 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB28433@SHSMSX101.ccr.corp.intel.com> References: <20190911215504.15980-1-xiaoxiaox.zeng@intel.com> In-Reply-To: <20190911215504.15980-1-xiaoxiaox.zeng@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-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2I2NGJlZGQtNWE0Ny00ZmE0LTgwODgtMWFkODI0NzZlYzNiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTUFzVHBrbkFUeFkzd0VKaWoyZ1FBVEhWTk1lazBsYk15QUs2Q0l4VVc2WHNFS29iVGk1aUtDWXZOaG15TkI1ZiJ9 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 V2] tests/TestSuite_multiprocess: add case 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 [mailto:dts-bounces@dpdk.org] On Behalf Of Xiaoxiao Zeng > Sent: Thursday, September 12, 2019 5:55 AM > To: dts@dpdk.org > Cc: Zeng, XiaoxiaoX > Subject: [dts] [PATCH V2] tests/TestSuite_multiprocess: add case >=20 > add testcase test_perf_multiprocess_performance > *.according to testplan, add test_perf_multiprocess_performance code >=20 > Signed-off-by: Xiaoxiao Zeng > --- > tests/TestSuite_multiprocess.py | 126 ++++++++++++++++++++++++++------ > 1 file changed, 102 insertions(+), 24 deletions(-) >=20 > diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiproce= ss.py > index b690d81..384872c 100644 > --- a/tests/TestSuite_multiprocess.py > +++ b/tests/TestSuite_multiprocess.py > @@ -37,6 +37,7 @@ Multi-process Test. > import utils > import time > import os > + > executions =3D [] > from test_case import TestCase > from pktgen import PacketGeneratorHelper @@ -68,16 +69,17 @@ class > TestMultiprocess(TestCase): > executions.append({'nprocs': 4, 'cores': '1S/2C/2T', 'pps': 0}) > executions.append({'nprocs': 4, 'cores': '1S/4C/1T', 'pps': 0}) > executions.append({'nprocs': 8, 'cores': '1S/4C/2T', 'pps': 0}) > - self.dut.alt_session.send_expect("cd dpdk","# ",5) > + self.dut.alt_session.send_expect("cd dpdk", "# ", 5) >=20 > # start new session to run secondary > self.session_secondary =3D self.dut.new_session() > + > # get dts output path > if self.logger.log_path.startswith(os.sep): > self.output_path =3D self.logger.log_path > else: > cur_path =3D os.path.dirname( > - os.path.dirname(os.path.realpath(__file_= _))) > + os.path.dirname(os.path.realpath(__file__))) > self.output_path =3D os.sep.join([cur_path, self.logger.log_= path]) > # create an instance to set stream field setting > self.pktgen_helper =3D PacketGeneratorHelper() @@ -95,23 +97,28 = @@ > class TestMultiprocess(TestCase): > # Send message from secondary to primary > cores =3D self.dut.get_core_list('1S/2C/1T') > coremask =3D utils.create_mask(cores) > - > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dprimary" % (self.target, coremask), "Finished Pr= ocess > Init", 100) > + > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dprimary" % (self.target, coremask), > + "Finished Process Init", 100) > time.sleep(20) > coremask =3D hex(int(coremask, 16) * 0x10).rstrip("L") > - > self.session_secondary.send_expect("./examples/multi_process/simple_mp/ > %s/simple_mp -n 1 -c %s --proc-type=3Dsecondary" % (self.target, coremask= ), > "Finished Process Init", 100) > + self.session_secondary.send_expect( > + "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s = -- > proc-type=3Dsecondary" % (self.target, coremask), "Finished Process Init"= , > + 100) >=20 > self.session_secondary.send_expect("send hello_primary", ">") > out =3D self.dut.get_session_output() > self.session_secondary.send_expect("quit", "# ") > - self.dut.send_expect("quit","# ") > + self.dut.send_expect("quit", "# ") > self.verify("Received 'hello_primary'" in out, "Message not rece= ived on > primary process") > # Send message from primary to secondary > cores =3D self.dut.get_core_list('1S/2C/1T') > coremask =3D utils.create_mask(cores) > - > self.session_secondary.send_expect("./examples/multi_process/simple_mp/ > %s/simple_mp -n 1 -c %s --proc-type=3Dprimary " % (self.target, coremask)= , > "Finished Process Init", 100) > + self.session_secondary.send_expect( > + "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s > + --proc-type=3Dprimary " % (self.target, coremask), "Finished Process > + Init", 100) > time.sleep(20) > coremask =3D hex(int(coremask, 16) * 0x10).rstrip("L") > - > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dsecondary" % (self.target, coremask), "Finished > Process Init", 100) > + > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dsecondary" % (self.target, coremask), > + "Finished Process Init", 100) > self.session_secondary.send_expect("send hello_secondary", ">") > out =3D self.dut.get_session_output() > self.session_secondary.send_expect("quit", "# ") @@ -127,10 +134= ,12 > @@ class TestMultiprocess(TestCase): >=20 > cores =3D self.dut.get_core_list('1S/2C/1T') > coremask =3D utils.create_mask(cores) > - > self.session_secondary.send_expect("./examples/multi_process/simple_mp/ > %s/simple_mp -n 1 -c %s --proc-type=3Dprimary" % (self.target, coremask), > "Finished Process Init", 100) > + > self.session_secondary.send_expect("./examples/multi_process/simple_mp/ > %s/simple_mp -n 1 -c %s --proc-type=3Dprimary" % (self.target, coremask), > + "Finished Process Init", > + 100) > time.sleep(20) > coremask =3D hex(int(coremask, 16) * 0x10).rstrip("L") > - > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dsecondary" % (self.target, coremask), "Finished > Process Init", 100) > + > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dsecondary" % (self.target, coremask), > + "Finished Process Init", 100) > stringsSent =3D 0 > for line in open('/usr/share/dict/words', 'r').readlines(): > line =3D line.split('\n')[0] > @@ -151,11 +160,13 @@ class TestMultiprocess(TestCase): > # Send message from secondary to primary (auto process type) > cores =3D self.dut.get_core_list('1S/2C/1T') > coremask =3D utils.create_mask(cores) > - out =3D > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dauto " % (self.target, coremask), "Finished Proc= ess Init", > 100) > + out =3D > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dauto " % (self.target, coremask), > + "Finished Process Init", 100) > self.verify("EAL: Auto-detected process type: PRIMARY" in out, "= The > type of process (PRIMARY) was not detected properly") > time.sleep(20) > coremask =3D hex(int(coremask, 16) * 0x10).rstrip("L") > - out =3D > self.session_secondary.send_expect("./examples/multi_process/simple_mp/ > %s/simple_mp -n 1 -c %s --proc-type=3Dauto" % (self.target, coremask), > "Finished Process Init", 100) > + out =3D self.session_secondary.send_expect( > + "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s > + --proc-type=3Dauto" % (self.target, coremask), "Finished Process Init", > + 100) > self.verify("EAL: Auto-detected process type: SECONDARY" in out, > "The type of process (SECONDARY) was not detected pr= operly") >=20 > @@ -168,13 +179,15 @@ class TestMultiprocess(TestCase): > # Send message from primary to secondary (auto process type) > cores =3D self.dut.get_core_list('1S/2C/1T') > coremask =3D utils.create_mask(cores) > - out =3D > self.session_secondary.send_expect("./examples/multi_process/simple_mp/ > %s/simple_mp -n 1 -c %s --proc-type=3Dauto" % (self.target, coremask), > "Finished Process Init", 100) > + out =3D self.session_secondary.send_expect( > + "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s > + --proc-type=3Dauto" % (self.target, coremask), "Finished Process Init", > + 100) > self.verify("EAL: Auto-detected process type: PRIMARY" in out, "= The > type of process (PRIMARY) was not detected properly") > time.sleep(20) > coremask =3D hex(int(coremask, 16) * 0x10).rstrip("L") > - out =3D > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dauto" % (self.target, coremask), "Finished Proce= ss Init", > 100) > + out =3D > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s --proc-type=3Dauto" % (self.target, coremask), > + "Finished Process Init", 100) > self.verify("EAL: Auto-detected process type: SECONDARY" in out,= "The > type of process (SECONDARY) was not detected properly") > - self.session_secondary.send_expect("send hello_secondary", ">",1= 00) > + self.session_secondary.send_expect("send hello_secondary", ">", > + 100) > out =3D self.dut.get_session_output() > self.session_secondary.send_expect("quit", "# ") > self.dut.send_expect("quit", "# ") @@ -189,7 +202,8 @@ class > TestMultiprocess(TestCase): >=20 > cores =3D self.dut.get_core_list('1S/2C/1T') > coremask =3D utils.create_mask(cores) > - > self.session_secondary.send_expect("./examples/multi_process/simple_mp/ > %s/simple_mp -n 1 -c %s -m 64" % (self.target, coremask), "Finished Proce= ss > Init", 100) > + > self.session_secondary.send_expect("./examples/multi_process/simple_mp/ > %s/simple_mp -n 1 -c %s -m 64" % (self.target, coremask), > + "Finished Process Init", > + 100) > coremask =3D hex(int(coremask, 16) * 0x10).rstrip("L") > out =3D > self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp > -n 1 -c %s" % (self.target, coremask), "# ", 100) >=20 > @@ -198,6 +212,65 @@ class TestMultiprocess(TestCase): >=20 > self.session_secondary.send_expect("quit", "# ") >=20 > + def test_perf_multiprocess_performance(self): > + """ > + Benchmark Multiprocess performance. > + # """ > + packet_count =3D 16 > + self.dut.send_expect("fg", "# ") > + dutPorts =3D self.dut.get_ports() > + txPort =3D self.tester.get_local_port(dutPorts[0]) > + rxPort =3D self.tester.get_local_port(dutPorts[1]) > + mac =3D self.tester.get_mac(txPort) > + dmac =3D self.dut.get_mac_address(dutPorts[0]) > + tgenInput =3D [] > + > + # create mutative src_ip+dst_ip package > + for i in range(packet_count): > + package =3D r'flows =3D [Ether(src=3D"%s", dst=3D"%s")/IP(sr= c=3D"192.168.1.%d", > dst=3D"192.168.1.%d")/("X"*26)]' % (mac, dmac, i + 1, i + 2) > + self.tester.scapy_append(package) > + pcap =3D os.sep.join([self.output_path, "test_%d.pcap"%i]) > + self.tester.scapy_append('wrpcap("%s", flows)' % pcap) > + tgenInput.append([txPort, rxPort, pcap]) > + self.tester.scapy_execute() > + > + # run multiple symmetric_mp process > + validExecutions =3D [] > + for execution in executions: > + if len(self.dut.get_core_list(execution['cores'])) =3D=3D ex= ecution['nprocs']: > + validExecutions.append(execution) > + > + portMask =3D utils.create_mask([dutPorts[0], dutPorts[1]]) > + > + for n in range(len(validExecutions)): > + execution =3D validExecutions[n] > + coreMask =3D > utils.create_mask(self.dut.get_core_list(execution['cores'])) > + self.session_secondary.send_expect( > + "./examples/multi_process/symmetric_mp/%s/symmetric_mp - > c %s --proc-type=3Dauto -- -p %s --num-procs=3D%d --proc-id=3D%d" % ( > + self.target, coreMask, portMask, > + execution['nprocs'], n), "Finished Process Init") > + > + # clear streams before add new streams > + self.tester.pktgen.clear_streams() > + # run packet generator > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, None, > self.tester.pktgen) > + _, pps =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams) > + > + execution['pps'] =3D pps > + > + # close all symmetric_mp process > + self.dut.send_expect("killall symmetric_mp", "# ") > + > + # get rate and mpps data > + for n in range(len(executions)): > + self.verify(executions[n]['pps'] is not 0, "No traffic detec= ted") > + self.result_table_create(['Num-procs', 'Sockets/Cores/Threads', > + 'Num Ports', 'Frame Size', '%-age Line Rate', 'Packet Rate(mpps)']) > + > + for execution in validExecutions: > + self.result_table_add( > + [execution['nprocs'], execution['cores'], 2, 64, > + execution['pps'] / float(100000000 / (8 * 84)), execution['pps'] / > + float(1000000)]) > + > + self.result_table_print() > + > def test_perf_multiprocess_client_serverperformance(self): > """ > Benchmark Multiprocess client-server performance. > @@ -227,14 +300,16 @@ class TestMultiprocess(TestCase): >=20 > coreMask =3D utils.create_mask(self.dut.get_core_list('1S/1C= /1T')) > portMask =3D utils.create_mask([dutPorts[0], dutPorts[1]]) > - > self.dut.send_expect("./examples/multi_process/client_server_mp/mp_serv > er/%s/mp_server -n %d -c %s -- -p %s -n %d" % (self.target, > self.dut.get_memory_channels(), "0xA0", portMask, execution['nprocs']), > "Finished Process Init", 20) > + > self.dut.send_expect("./examples/multi_process/client_server_mp/mp_serv > er/%s/mp_server -n %d -c %s -- -p %s -n %d" % ( > + self.target, self.dut.get_memory_channels(), "0xA0", > + portMask, execution['nprocs']), "Finished Process Init", 20) > self.dut.send_expect("^Z", "\r\n") > self.dut.send_expect("bg", "# ") >=20 > for n in range(execution['nprocs']): > time.sleep(5) > coreMask =3D utils.create_mask([coreList[n]]) > - > self.dut.send_expect("./examples/multi_process/client_server_mp/mp_clien > t/%s/mp_client -n %d -c %s --proc-type=3Dsecondary -- -n %d" % (self.targ= et, > self.dut.get_memory_channels(), coreMask, n), "Finished Process Init") > + > self.dut.send_expect("./examples/multi_process/client_server_mp/mp_clien > t/%s/mp_client -n %d -c %s --proc-type=3Dsecondary -- -n %d" % ( > + self.target, self.dut.get_memory_channels(), > + coreMask, n), "Finished Process Init") > self.dut.send_expect("^Z", "\r\n") > self.dut.send_expect("bg", "# ") >=20 > @@ -245,7 +320,7 @@ class TestMultiprocess(TestCase): > self.tester.pktgen.clear_streams() > # run packet generator > streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, > - None, self.tester.pktgen= ) > + > + None, self.tester.pktgen) > _, pps =3D self.tester.pktgen.measure_throughput(stream_ids= =3Dstreams) >=20 > execution['pps'] =3D pps > @@ -255,20 +330,23 @@ class TestMultiprocess(TestCase): > for n in range(len(executions)): > self.verify(executions[n]['pps'] is not 0, "No traffic detec= ted") >=20 > - self.result_table_create(['Server threads', 'Server Cores/Thread= s', 'Num- > procs', 'Sockets/Cores/Threads', 'Num Ports', 'Frame Size', '%-age Line R= ate', > 'Packet Rate(mpps)']) > + self.result_table_create( > + ['Server threads', 'Server Cores/Threads', 'Num-procs', > 'Sockets/Cores/Threads', 'Num Ports', 'Frame Size', '%-age Line Rate', > + 'Packet Rate(mpps)']) >=20 > for execution in validExecutions: > - self.result_table_add([1, '1S/1C/1T', execution['nprocs'], > execution['cores'], 2, 64, execution['pps'] / float(100000000 / (8 * 84))= , > execution['pps'] / float(1000000)]) > + self.result_table_add([1, '1S/1C/1T', execution['nprocs'], > execution['cores'], 2, 64, execution['pps'] / float(100000000 / (8 * 84))= , > + execution['pps'] / float(1000000)]) >=20 > self.result_table_print() >=20 > def set_fields(self): > ''' set ip protocol field behavior ''' > fields_config =3D { > - 'ip': { > - 'src': {'range': 64, 'action': 'inc'}, > - 'dst': {'range': 64, 'action': 'inc'}, > - },} > + 'ip': { > + 'src': {'range': 64, 'action': 'inc'}, > + 'dst': {'range': 64, 'action': 'inc'}, > + }, } >=20 > return fields_config >=20 > -- > 2.17.0