From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 49B60379E for ; Wed, 23 Dec 2015 08:29:26 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 22 Dec 2015 23:29:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,467,1444719600"; d="scan'208";a="868015535" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga001.fm.intel.com with ESMTP; 22 Dec 2015 23:29:25 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Dec 2015 23:29:25 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Dec 2015 23:29:24 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.28]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.151]) with mapi id 14.03.0248.002; Wed, 23 Dec 2015 15:29:16 +0800 From: "Liu, Yong" To: "Ding, HengX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] l3fwd: enable rfc2544 test as a performance case. Thread-Index: AQHRPJN8MZulC+xAQUmaqazXJNgoWZ7YK8ew Date: Wed, 23 Dec 2015 07:29:16 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10F94682@SHSMSX103.ccr.corp.intel.com> References: <1450773176-18622-1-git-send-email-hengx.ding@intel.com> In-Reply-To: <1450773176-18622-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjA1ZDczNjctZDllYi00MWRhLWE4YjUtYmM4ZGNmOTZlMjYxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoid1NDdm9FWlFRV3pNMVlncmZUUFcwQVN5UXhFUWw1QUhUandVcnBveEs0bz0ifQ== 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 Cc: "Ding, HengX" Subject: Re: [dts] [PATCH] l3fwd: enable rfc2544 test as a performance 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: , X-List-Received-Date: Wed, 23 Dec 2015 07:29:27 -0000 Hi Heng, Two comments for make performance data more clear and readable. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Ding Heng > Sent: Tuesday, December 22, 2015 4:33 PM > To: dts@dpdk.org > Cc: Ding, HengX > Subject: [dts] [PATCH] l3fwd: enable rfc2544 test as a performance case. >=20 > Add RFC2544 test as a case in l3fwd. Made some change to framework.py to > fix > the run time not work issue. >=20 > Signed-off-by: Ding Heng >=20 > diff --git a/framework/tester.py b/framework/tester.py > index 210d54f..4dea0e3 100644 > --- a/framework/tester.py > +++ b/framework/tester.py > @@ -445,7 +445,7 @@ class Tester(Crb): > Run loss performance test on specified ports. > """ > if self.check_port_list(portList, 'ixia'): > - return self.ixia_packet_gen.loss(portList, ratePercent) > + return self.ixia_packet_gen.loss(portList, ratePercent, dela= y) > elif not self.check_port_list(portList): > self.logger.warning("exception by mixed port types") > return None > diff --git a/tests/TestSuite_l3fwd.py b/tests/TestSuite_l3fwd.py > index 0e09256..cd9c7cf 100644 > --- a/tests/TestSuite_l3fwd.py > +++ b/tests/TestSuite_l3fwd.py > @@ -227,7 +227,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > for core in cores: > core_ydata =3D [] > for row in data: > - if row[5] =3D=3D mode and row[2] =3D=3D core: > + if row[1] =3D=3D mode and row[2] =3D=3D core: > core_ydata.append(float(row[4])) Number is hard to understood, could you try to use variable replace of inte= ger.=20 It will be like below. mod_col=3D1 Core_col =3D 2 if raw[mode] =3D=3D mode and row[core_col] =3D=3D core: >=20 > mode_ydata.append(core_ydata) > @@ -255,7 +255,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > for frame_size in TestL3fwd.frame_sizes: > for row in data: > if row[2] =3D=3D core and row[0] =3D=3D frame_size a= nd \ > - row[5] =3D=3D mode: > + row[1] =3D=3D mode: > mode_ydata.append(float(row[4])) >=20 > ydata.append(mode_ydata) > @@ -521,7 +521,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > L3fwd main 2 ports. > """ >=20 > - header_row =3D ["Frame", "Ports", "S/C/T", "Mpps", "% linerate", > "mode"] > + header_row =3D ["Frame", "mode", "S/C/T", "Mpps", "% linerate"] > self.l3fwd_test_results['header'] =3D header_row > dts.results_table_add_header(header_row) > self.l3fwd_test_results['data'] =3D [] > @@ -533,7 +533,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > HEADER_SIZE['ip'] - HEADER_SIZE['eth'] > for _port in range(2): > 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]] > + 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 > @@ -611,13 +611,113 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): > # Stop l3fwd > self.dut.send_expect("^C", "#") >=20 > - data_row =3D [frame_size, 2, cores, str(pps), str(pc= t), > mode] > + data_row =3D [frame_size, mode, cores, str(pps), > str(pct)] > dts.results_table_add_row(data_row) > self.l3fwd_test_results['data'].append(data_row) >=20 > self.plot_2_ports() > dts.results_table_print() >=20 > + def test_perf_rfc2544(self): > + > + header_row =3D ["Frame", "mode", "S/C/T", "LR_tx_pkts(1min)", > "LR_rx_pkts(1min)", "LR_loss_pkts(1min)", "% zero_loss_rate"] > + self.l3fwd_test_results['header'] =3D header_row > + dts.results_table_add_header(header_row) > + self.l3fwd_test_results['data'] =3D [] > + > + for frame_size in TestL3fwd.frame_sizes: > + > + # Prepare traffic flow > + payload_size =3D frame_size - \ > + HEADER_SIZE['ip'] - HEADER_SIZE['eth'] > + for _port in range(2): > + 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() > + > + dts.report("Flows for 2 ports, %d frame size.\n" % > (frame_size), > + annex=3DTrue) > + dts.report("%s" % string.join(flows, '\n'), > + frame=3DTrue, annex=3DTrue) > + > + > + # Prepare the command line > + global corelist > + pat =3D re.compile("P([0123]),([0123]),(C\{\d.\d.\d\})") > + > + pat2 =3D re.compile("C\{\d") > + repl1 =3D "C{" + str(self.port_socket) > + > + coreMask =3D {} > + rtCmdLines =3D dict(TestL3fwd.test_cases_2_ports) > + for key in rtCmdLines.keys(): > + corelist =3D [] > + while pat.search(rtCmdLines[key]): > + # 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]) > + > + self.logger.info("%s\n" % str(corelist)) > + coreMask[key] =3D dts.create_mask(set(corelist)) > + > + # measure by two different mode > + for mode in TestL3fwd.methods: > + > + # start l3fwd > + index =3D 0 > + subtitle =3D [] > + for cores in rtCmdLines.keys(): > + > + #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) > + > + self.logger.info(info) > + dts.report(info, annex=3DTrue) > + > + subtitle.append(cores) > + cmdline =3D rtCmdLines[cores] % (TestL3fwd.path = + > "l3fwd_" + mode, coreMask[cores], > + > self.dut.get_memory_channels(), dts.create_mask(valports[:2])) > + > + dts.report(cmdline + "\n", frame=3DTrue, annex= =3DTrue) > + > + out =3D self.dut.send_expect(cmdline, "L3FWD:", = 120) > + > + # Measure test > + tgenInput =3D [] > + for rxPort in range(2): > + # No use on rx/tx limitation > + if rxPort % 2 =3D=3D 0: > + txIntf =3D > self.tester.get_local_port(valports[rxPort + 1]) > + else: > + txIntf =3D > self.tester.get_local_port(valports[rxPort - 1]) > + > + rxIntf =3D > self.tester.get_local_port(valports[rxPort]) > + if rxPort % 2 =3D=3D 0: > + tgenInput.append((txIntf, rxIntf, > "dst%d.pcap" %valports[rxPort+1])) > + else: > + tgenInput.append((txIntf, rxIntf, > "dst%d.pcap" %valports[rxPort-1])) > + > + zero_loss_rate, tx_pkts, rx_pkts =3D > self.tester.run_rfc2544(tgenInput, delay=3D60) > + loss_pkts =3D tx_pkts - rx_pkts > + self.dut.send_expect("^C", "#") Better to add one function human_read_number() in framework/utils.py, tran= slate number to more readable format. If tx_pkts > 1000000, return value will be xxx.xxxM. If tx_pts > 1000 and < 1000000, return value will be xxx.xxxK It tx_pkts < 1000, return value just xxx. > + > + tx_pkts /=3D 1000000 > + rx_pkts /=3D 1000000 > + > + data_row =3D [frame_size, mode, cores, > str(tx_pkts)+"M", str(rx_pkts)+"M", loss_pkts, zero_loss_rate] > + dts.results_table_add_row(data_row) > + self.l3fwd_test_results['data'].append(data_row) > + else: > + pass > + > + index +=3D 1 > + > + dts.results_table_print() > + > def ip(self, port, frag, src, proto, tos, dst, chksum, len, options, > version, flags, ihl, ttl, id): > self.add_tcl_cmd("protocol config -name ip") > self.add_tcl_cmd('ip config -sourceIpAddr "%s"' % src) > -- > 1.9.3