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 638B6A0613 for ; Thu, 26 Sep 2019 03:47:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 113191E34; Thu, 26 Sep 2019 03:47:56 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 7737E1DB9 for ; Thu, 26 Sep 2019 03:47:54 +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 fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Sep 2019 18:47:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,549,1559545200"; d="scan'208";a="191532856" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 25 Sep 2019 18:47:52 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) 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:47:52 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 25 Sep 2019 18:47:51 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 25 Sep 2019 18:47:51 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.195]) with mapi id 14.03.0439.000; Thu, 26 Sep 2019 09:46:05 +0800 From: "Zhang, Yuwei1" To: "Zeng, XiaoxiaoX" , "dts@dpdk.org" CC: "Zeng, XiaoxiaoX" Thread-Topic: [dts] [PATCH V2] tests/TestSuite_multiprocess: add case Thread-Index: AQHVaIcM3ikYwRNYQEOubTzbaTmU0qc9RzTQ Date: Thu, 26 Sep 2019 01:46:05 +0000 Message-ID: References: <20190911215504.15980-1-xiaoxiaox.zeng@intel.com> In-Reply-To: <20190911215504.15980-1-xiaoxiaox.zeng@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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" Acked-by: Yuwei Zhang -----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 add testcase test_perf_multiprocess_performance *.according to testplan, add test_perf_multiprocess_performance code Signed-off-by: Xiaoxiao Zeng --- tests/TestSuite_multiprocess.py | 126 ++++++++++++++++++++++++++------ 1 file changed, 102 insertions(+), 24 deletions(-) diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess= .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 TestMul= tiprocess(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_pa= th]) # 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 = Process 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/simpl= e_mp/%s/simple_mp -n 1 -c %s --proc-type=3Dsecondary" % (self.target, corem= ask), "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 receiv= ed 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/simpl= e_mp/%s/simple_mp -n 1 -c %s --proc-type=3Dprimary " % (self.target, corema= sk), "Finished Process Init", 100) + self.session_secondary.send_expect( + "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s=20 + --proc-type=3Dprimary " % (self.target, coremask), "Finished Process=20 + 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), "Finishe= d 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,1= 2 @@ 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/simpl= e_mp/%s/simple_mp -n 1 -c %s --proc-type=3Dprimary" % (self.target, coremas= k), "Finished Process Init", 100) + self.session_secondary.send_expect("./examples/multi_process/simpl= e_mp/%s/simple_mp -n 1 -c %s --proc-type=3Dprimary" % (self.target, coremas= k), + "Finished Process Init",=20 + 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), "Finishe= d 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), "Fin= ished Process 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, "Th= e 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_proce= ss/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=3Dauto" % (self.target, co= remask), "Finished Process Init", 100) + out =3D self.session_secondary.send_expect( + "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s=20 + --proc-type=3Dauto" % (self.target, coremask), "Finished Process Init",=20 + 100) self.verify("EAL: Auto-detected process type: SECONDARY" in out, "The type of process (SECONDARY) was not detected prop= erly") =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_proce= ss/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=3Dauto" % (self.target, co= remask), "Finished Process Init", 100) + out =3D self.session_secondary.send_expect( + "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s=20 + --proc-type=3Dauto" % (self.target, coremask), "Finished Process Init",=20 + 100) self.verify("EAL: Auto-detected process type: PRIMARY" in out, "Th= e 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), "Fini= shed Process 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", ">",100= ) + self.session_secondary.send_expect("send hello_secondary", ">",=20 + 100) out =3D self.dut.get_session_output() self.session_secondary.send_expect("quit", "# ") self.dut.send_expect("quit", "# ") @@ -189,7 +202,8 @@ class TestM= ultiprocess(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/simpl= e_mp/%s/simple_mp -n 1 -c %s -m 64" % (self.target, coremask), "Finished Pr= ocess Init", 100) + self.session_secondary.send_expect("./examples/multi_process/simpl= e_mp/%s/simple_mp -n 1 -c %s -m 64" % (self.target, coremask), + "Finished Process Init",=20 + 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(src= =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 exec= ution['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(executio= n['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,=20 + 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(tge= nInput, 100, None, self.tester.pktgen) + _, pps =3D=20 + 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 detecte= d") + self.result_table_create(['Num-procs', 'Sockets/Cores/Threads',=20 + 'Num Ports', 'Frame Size', '%-age Line Rate', 'Packet Rate(mpps)']) + + for execution in validExecutions: + self.result_table_add( + [execution['nprocs'], execution['cores'], 2, 64,=20 + execution['pps'] / float(100000000 / (8 * 84)), execution['pps'] /=20 + 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/1= T')) portMask =3D utils.create_mask([dutPorts[0], dutPorts[1]]) - self.dut.send_expect("./examples/multi_process/client_server_m= p/mp_server/%s/mp_server -n %d -c %s -- -p %s -n %d" % (self.target, self.d= ut.get_memory_channels(), "0xA0", portMask, execution['nprocs']), "Finished= Process Init", 20) + self.dut.send_expect("./examples/multi_process/client_server_m= p/mp_server/%s/mp_server -n %d -c %s -- -p %s -n %d" % ( + self.target, self.dut.get_memory_channels(), "0xA0",=20 + 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_serv= er_mp/mp_client/%s/mp_client -n %d -c %s --proc-type=3Dsecondary -- -n %d" = % (self.target, self.dut.get_memory_channels(), coreMask, n), "Finished Pro= cess Init") + self.dut.send_expect("./examples/multi_process/client_serv= er_mp/mp_client/%s/mp_client -n %d -c %s --proc-type=3Dsecondary -- -n %d" = % ( + self.target, self.dut.get_memory_channels(),=20 + 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(tge= nInput, 100, - None, self.tester.pktgen) + =20 + None, self.tester.pktgen) _, pps =3D self.tester.pktgen.measure_throughput(stream_ids=3D= streams) =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 detecte= d") =20 - self.result_table_create(['Server threads', 'Server Cores/Threads'= , 'Num-procs', 'Sockets/Cores/Threads', 'Num Ports', 'Frame Size', '%-age L= ine Rate', 'Packet Rate(mpps)']) + self.result_table_create( + ['Server threads', 'Server Cores/Threads', 'Num-procs', 'Socke= ts/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'], exe= cution['cores'], 2, 64, execution['pps'] / float(100000000 / (8 * 84)), exe= cution['pps'] / float(1000000)]) + self.result_table_add([1, '1S/1C/1T', execution['nprocs'], exe= cution['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