From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id DC7CB2BA8 for ; Fri, 15 Apr 2016 08:52:14 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 14 Apr 2016 23:52:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,486,1455004800"; d="scan'208";a="785418711" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 14 Apr 2016 23:52:13 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 14 Apr 2016 23:52:12 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.155]) with mapi id 14.03.0248.002; Fri, 15 Apr 2016 14:52:10 +0800 From: "Liu, Yong" To: "Ding, HengX" , "dts@dpdk.org" CC: "Ding, HengX" Thread-Topic: [dts] [PATCH] l3fwd: Run RFC2544 according to the number of available ports. Thread-Index: AQHRlSuxb8m+ekex6UGNwpanT+oF4J+KnEHw Date: Fri, 15 Apr 2016 06:52:10 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E14EF3730@SHSMSX101.ccr.corp.intel.com> References: <1460514257-17354-1-git-send-email-hengx.ding@intel.com> In-Reply-To: <1460514257-17354-1-git-send-email-hengx.ding@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWFlNTRhNWUtNzllNC00NTE0LWJmMDMtNWMyNWEwMDM1YzBhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjdueFdxV2dhc0pnTjFCdUhtNU5DWVY3NDJXc2lrQ1VFVU9RQ2pWUmY2UlU9In0= x-ctpclassification: CTP_IC 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] l3fwd: Run RFC2544 according to the number of available ports. 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: Fri, 15 Apr 2016 06:52:15 -0000 Thanks Heng. Applied. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Ding Heng > Sent: Wednesday, April 13, 2016 10:24 AM > To: dts@dpdk.org > Cc: Ding, HengX > Subject: [dts] [PATCH] l3fwd: Run RFC2544 according to the number of > available ports. >=20 > Optimize l3fwd case command, 2 port case command will be a list too. > Running command will be different according to the packet length. > Run RFC2544 according to the number of vailable ports. >=20 > Signed-off-by: Ding Heng >=20 > diff --git a/tests/TestSuite_l3fwd.py b/tests/TestSuite_l3fwd.py > index e112b18..0376a76 100644 > --- a/tests/TestSuite_l3fwd.py > +++ b/tests/TestSuite_l3fwd.py > @@ -47,19 +47,19 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): >=20 > path =3D "./examples/l3fwd/build/" >=20 > - test_cases_2_ports =3D {"1S/1C/1T": "%s -c %s -n %d -- -p %s --conf= ig > '(P0,0,C{1.1.0}), (P1,0,C{1.1.0})' --enable-jumbo --max-pkt-len 4096", > + test_cases_2_ports =3D [(1,"1S/1C/1T","%s -c %s -n %d -- -P -p %s -= - > config '(P0,0,C{1.1.0}), (P1,0,C{1.1.0})'"), > #"1S/1C/2T": "%s -c %s -n %d -- -p %s --confi= g > '(P0,0,C{1.1.0}), (P1,0,C{1.1.1})'", > - "1S/2C/1T": "%s -c %s -n %d -- -p %s --config > '(P0,0,C{1.1.0}), (P1,0,C{1.2.0})' --enable-jumbo --max-pkt-len 4096", > + (1,"1S/2C/1T","%s -c %s -n %d -- -P -p %s -- > config '(P0,0,C{1.1.0}), (P1,0,C{1.2.0})'"), > #"1S/4C/1T": "%s -c %s -n %d -- -p %s --confi= g > '(P0,0,C{1.1.0}), (P1,0,C{1.2.0}),(P0,1,C{1.3.0}), (P1,1,C{1.4.0})'", > #"2S/2C/1T": "%s -c %s -n %d -- -p %s --confi= g > '(P0,0,C{0.1.0}), (P1,0,C{0.2.0}),(P0,1,C{1.3.0}), (P1,1,C{1.4.0})'", > - } > + ] >=20 > test_cases_4_ports =3D [(1, "1S/1C/1T", > - "%s -c %s -n %d -- -p %s --config > '(P0,0,C{1.1.0}),(P1,0,C{1.1.0}),(P2,0,C{1.1.0}),(P3,0,C{1.1.0})' -- > enable-jumbo --max-pkt-len 4096"), > + "%s -c %s -n %d -- -P -p %s --config > '(P0,0,C{1.1.0}),(P1,0,C{1.1.0}),(P2,0,C{1.1.0}),(P3,0,C{1.1.0})'"), > #(1, "1S/2C/2T", > # "%s -c %s -n %d -- -p %s --config > '(P0,0,C{1.1.0}),(P1,0,C{1.1.1}),(P2,0,C{1.2.0}),(P3,0,C{1.2.1})'"), > (1, "1S/4C/1T", > - "%s -c %s -n %d -- -p %s --config > '(P0,0,C{1.1.0}),(P1,0,C{1.2.0}),(P2,0,C{1.3.0}),(P3,0,C{1.4.0})' -- > enable-jumbo --max-pkt-len 4096"), > + "%s -c %s -n %d -- -P -p %s --config > '(P0,0,C{1.1.0}),(P1,0,C{1.2.0}),(P2,0,C{1.3.0}),(P3,0,C{1.4.0})'"), > #(2, "1S/8C/1T", > #"%s -c %s -n %d -- -p %s --config > '(P0,0,C{1.1.0}),(P0,1,C{1.2.0}),(P1,0,C{1.3.0}),(P1,1,C{1.4.0}),(P2,0,C{= 1 > .5.0}),(P2,1,C{1.6.0}),(P3,0,C{1.7.0}),(P3,1,C{1.8.0})'"), > #(2, "2S/2C/1T", > @@ -94,8 +94,8 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > "{IPv4(13,101,0,0), 24, P3}", > ] >=20 > - frame_sizes =3D [64]#, 128, 256, 512, 2048] # 65, 128 > - methods =3D ['lpm', 'exact'] > + frame_sizes =3D [64, 128, 256, 512, 2048] # 65, 128 > + methods =3D ['lpm']#, 'exact'] >=20 > # > # > @@ -262,6 +262,8 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): >=20 > self.dut.get_memory_channels(), >=20 > dts.create_mask(valports[:4])) >=20 > + if frame_size > 1518: > + method_command_line =3D method_command_line + " --enable- > jumbo --max-pkt-len %d" % frame_size > dts.report(method_command_line + "\n", frame=3DTrue, annex= =3DTrue) >=20 > out =3D self.dut.send_expect(method_command_line, "L3FWD:", = 120) > @@ -363,7 +365,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > L3fwd main 2 ports. > """ >=20 > - header_row =3D ["Frame", "mode", "S/C/T", "Mpps", "% linerate"] > + header_row =3D ["Frame", "mode", "S/C/T", "Mpps", "% linerate", > "latency_max(us)", "latency_min(us)", "latency_avg(us)"] > self.l3fwd_test_results['header'] =3D header_row > dts.results_table_add_header(header_row) > self.l3fwd_test_results['data'] =3D [] > @@ -393,17 +395,19 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > repl1 =3D "C{" + str(self.port_socket) >=20 > coreMask =3D {} > - rtCmdLines =3D dict(TestL3fwd.test_cases_2_ports) > - for key in rtCmdLines.keys(): > + rtCmdLines =3D {} > + cmdlist =3D TestL3fwd.test_cases_2_ports > + for cmdline_pat in cmdlist: > corelist =3D [] > - while pat.search(rtCmdLines[key]): > + rtCmdLines[cmdline_pat[1]] =3D cmdline_pat[2] > + while pat.search(rtCmdLines[cmdline_pat[1]]): > # Change the socket to the NIC's socket > - if key.find('1S')>=3D0: > - rtCmdLines[key] =3D pat2.sub(repl1, rtCmdLines[k= ey]) > - rtCmdLines[key] =3D pat.sub(self.repl, rtCmdLines[ke= y]) > + if cmdline_pat[1].find('1S')>=3D0: > + rtCmdLines[cmdline_pat[1]] =3D pat2.sub(repl1, > rtCmdLines[cmdline_pat[1]]) > + rtCmdLines[cmdline_pat[1]] =3D pat.sub(self.repl, > rtCmdLines[cmdline_pat[1]]) >=20 > self.logger.info("%s\n" % str(corelist)) > - coreMask[key] =3D dts.create_mask(set(corelist)) > + coreMask[cmdline_pat[1]] =3D dts.create_mask(set(corelis= t)) >=20 > # measure by two different mode > for mode in TestL3fwd.methods: > @@ -423,6 +427,8 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > cmdline =3D rtCmdLines[cores] % (TestL3fwd.path + > "l3fwd_" + mode, coreMask[cores], >=20 > self.dut.get_memory_channels(), dts.create_mask(valports[:2])) >=20 > + if frame_size > 1518: > + cmdline =3D cmdline + " --enable-jumbo --max-pkt= - > len %d" % frame_size > dts.report(cmdline + "\n", frame=3DTrue, annex=3DTru= e) >=20 > out =3D self.dut.send_expect(cmdline, "L3FWD:", 120) > @@ -447,13 +453,15 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > pps /=3D 1000000.0 > linerate =3D self.wirespeed(self.nic, frame_size, 2) > pct =3D pps * 100 / linerate > + latencys =3D > self.tester.traffic_generator_latency(tgenInput) >=20 > index +=3D 1 >=20 > # Stop l3fwd > self.dut.send_expect("^C", "#") >=20 > - data_row =3D [frame_size, mode, cores, str(pps), > str(pct)] > + for latency in latencys: > + data_row =3D [frame_size, mode, cores, str(pps), > str(pct), str(latency['max']), str(latency['min']), > str(latency['average'])] > dts.results_table_add_row(data_row) > self.l3fwd_test_results['data'].append(data_row) >=20 > @@ -461,28 +469,29 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): >=20 > def test_perf_rfc2544(self): >=20 > + ports =3D self.dut.get_ports() > + ports_num =3D len(ports) > header_row =3D ["Frame", "mode", "S/C/T", "LR_tx_pkts(1min)", > "LR_rx_pkts(1min)", "LR_loss_pkts(1min)", "% zero_loss_rate", > "zero_loss_throughput(Mpps)"] > self.l3fwd_test_results['header'] =3D header_row > dts.results_table_add_header(header_row) > self.l3fwd_test_results['data'] =3D [] >=20 > - for frame_size in TestL3fwd.frame_sizes: > + for frame_size in [64, 128, 256, 512, 1024]: >=20 > # Prepare traffic flow > payload_size =3D frame_size - \ > HEADER_SIZE['ip'] - HEADER_SIZE['eth'] > - for _port in range(2): > + for _port in range(ports_num): > dmac =3D self.dut.get_mac_address(valports[_port]) > flows =3D ['Ether(dst=3D"%s")/%s/("X"*%d)' % (dmac, flow= , > payload_size) for flow in self.flows()[_port *2:(_port +1)*2]] > self.tester.scapy_append('wrpcap("dst%d.pcap", > [%s])' %(valports[_port],string.join(flows,','))) > self.tester.scapy_execute() >=20 > - dts.report("Flows for 2 ports, %d frame size.\n" % > (frame_size), > + dts.report("Flows for %d ports, %d frame size.\n" % > (ports_num, frame_size), > annex=3DTrue) > dts.report("%s" % string.join(flows, '\n'), > frame=3DTrue, annex=3DTrue) >=20 > - > # Prepare the command line > global corelist > pat =3D re.compile("P([0123]),([0123]),(C\{\d.\d.\d\})") > @@ -491,17 +500,22 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > repl1 =3D "C{" + str(self.port_socket) >=20 > coreMask =3D {} > - rtCmdLines =3D dict(TestL3fwd.test_cases_2_ports) > - for key in rtCmdLines.keys(): > + rtCmdLines =3D {} > + if ports_num =3D=3D 4: > + cmdlist =3D TestL3fwd.test_cases_4_ports > + else: > + cmdlist =3D TestL3fwd.test_cases_2_ports > + for cmdline_pat in cmdlist: > corelist =3D [] > - while pat.search(rtCmdLines[key]): > + rtCmdLines[cmdline_pat[1]] =3D cmdline_pat[2] > + while pat.search(rtCmdLines[cmdline_pat[1]]): > # Change the socket to the NIC's socket > - if key.find('1S')>=3D0: > - rtCmdLines[key] =3D pat2.sub(repl1, rtCmdLines[k= ey]) > - rtCmdLines[key] =3D pat.sub(self.repl, rtCmdLines[ke= y]) > + if cmdline_pat[1].find('1S')>=3D0: > + rtCmdLines[cmdline_pat[1]] =3D pat2.sub(repl1, > rtCmdLines[cmdline_pat[1]]) > + rtCmdLines[cmdline_pat[1]] =3D pat.sub(self.repl, > rtCmdLines[cmdline_pat[1]]) >=20 > self.logger.info("%s\n" % str(corelist)) > - coreMask[key] =3D dts.create_mask(set(corelist)) > + coreMask[cmdline_pat[1]] =3D dts.create_mask(set(corelis= t)) >=20 > # measure by two different mode > for mode in TestL3fwd.methods: > @@ -512,24 +526,26 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > for cores in rtCmdLines.keys(): >=20 > #in order to save time, only some of the cases will > be run. > - if mode =3D=3D "lpm" and (cores =3D=3D "1S/1C/1T" or= cores =3D=3D > "1S/4C/1T"): > - info =3D "Executing l3fwd using %s mode, 2 > ports, %s and %d frame size.\n" % ( > - mode, cores, frame_size) > + if mode =3D=3D "lpm" and (cores =3D=3D "1S/2C/1T" or= cores =3D=3D > "1S/4C/1T"): > + info =3D "Executing l3fwd using %s mode, %d > ports, %s and %d frame size.\n" % ( > + mode, ports_num, cores, frame_size) >=20 > self.logger.info(info) > dts.report(info, annex=3DTrue) >=20 > subtitle.append(cores) > cmdline =3D rtCmdLines[cores] % (TestL3fwd.path = + > "l3fwd_" + mode, coreMask[cores], > - > self.dut.get_memory_channels(), dts.create_mask(valports[:2])) > + > self.dut.get_memory_channels(), dts.create_mask(valports[:ports_num])) >=20 > + if frame_size > 1518: > + cmdline =3D cmdline + " --enable-jumbo --max= - > pkt-len %d" % frame_size > dts.report(cmdline + "\n", frame=3DTrue, annex= =3DTrue) >=20 > out =3D self.dut.send_expect(cmdline, "L3FWD:", = 120) >=20 > # Measure test > tgenInput =3D [] > - for rxPort in range(2): > + for rxPort in range(ports_num): > # No use on rx/tx limitation > if rxPort % 2 =3D=3D 0: > txIntf =3D > self.tester.get_local_port(valports[rxPort + 1]) > -- > 1.9.3