From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 887012C1A for ; Wed, 23 Mar 2016 02:46:55 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 22 Mar 2016 18:46:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,380,1455004800"; d="scan'208";a="943074853" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 22 Mar 2016 18:46:54 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 18:46:53 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 18:46:53 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.232]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.24]) with mapi id 14.03.0248.002; Wed, 23 Mar 2016 09:46:51 +0800 From: "Xu, Qian Q" To: "Liu, Yong" , "dts@dpdk.org" CC: "Xu, Qian Q" Thread-Topic: [dts] [PATCH] add l3fwd exact match perf test script and plan Thread-Index: AQHRhAySgmbq43Ogf0aKhAnSN/ii259mQyvA Date: Wed, 23 Mar 2016 01:46:51 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E0320DEBB@shsmsx102.ccr.corp.intel.com> References: <1458106186-19145-1-git-send-email-qian.q.xu@intel.com> <56F0F46E.1050309@intel.com> In-Reply-To: <56F0F46E.1050309@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjM1NjdiNTQtYzRiNi00MjFjLWJkNTUtMzBiNDc1MzUxNThjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InBcL09NQkpUdko2eGhKd05WczFiUjZ6MGZPS1F6SEtURmxZZ2E0WXgxQkU0PSJ9 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] add l3fwd exact match perf test script and plan 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 Mar 2016 01:46:56 -0000 I will run into core dump for this case, not sure why, so now not add it to= the performance test config, and we can run it separately..... Thanks Qian -----Original Message----- From: Liu, Yong=20 Sent: Tuesday, March 22, 2016 3:30 PM To: Xu, Qian Q; dts@dpdk.org Subject: Re: [dts] [PATCH] add l3fwd exact match perf test script and plan Applied. Qian, will you update the execution file or keep it away for basic= performance test? On 03/16/2016 01:29 PM, Qian Xu wrote: > Add l3fwd exact match perf test script and plan. > 1. Separate l3fwd lpm and exact match performance test script and plan=20 > because they have different ways. Previous l3fwd perf test is l3fwd=20 > lpm perf test. Add new exact match perf test. > > 2. Update the test plan and script for l3fwd exact match, remove 4port=20 > case and added the hash-entry-number for perf check. Updated the=20 > traffic, sample command for 2 ports. > > Signed-off-by: Qian Xu > > diff --git a/test_plans/l3fwd_em_test_plan.rst=20 > b/test_plans/l3fwd_em_test_plan.rst > new file mode 100644 > index 0000000..caed954 > --- /dev/null > +++ b/test_plans/l3fwd_em_test_plan.rst > @@ -0,0 +1,215 @@ > +.. Copyright (c) <2011>, Intel Corporation > + All rights reserved. > + > + Redistribution and use in source and binary forms, with or without > + modification, are permitted provided that the following conditions > + are met: > + > + - Redistributions of source code must retain the above copyright > + notice, this list of conditions and the following disclaimer. > + > + - Redistributions in binary form must reproduce the above copyright > + notice, this list of conditions and the following disclaimer in > + the documentation and/or other materials provided with the > + distribution. > + > + - Neither the name of Intel Corporation nor the names of its > + contributors may be used to endorse or promote products derived > + from this software without specific prior written permission. > + > + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS > + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR > + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED > + OF THE POSSIBILITY OF SUCH DAMAGE. > + > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > +Layer-3 Forwarding Exact Match > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > + > +The Layer-3 Forwarding results are produced using ``l3fwd`` application. > + > +Prerequisites > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +1. Hardware requirements: > + > + - For each CPU socket, each memory channel should be populated with = at least 1x DIMM > + - Board is populated with 4x 1GbE or 10GbE ports. Special PCIe restr= ictions may > + be required for performance. For example, the following requiremen= ts should be > + met for Intel 82599 (Niantic) NICs: > + > + - NICs are plugged into PCIe Gen2 or Gen3 slots > + - For PCIe Gen2 slots, the number of lanes should be 8x or higher > + - A single port from each NIC should be used, so for 4x ports, 4x N= ICs should > + be used > + > + - NIC ports connected to traffic generator. It is assumed that the N= IC ports > + P0, P1, P2, P3 (as identified by the DPDK application) are connect= ed to the > + traffic generator ports TG0, TG1, TG2, TG3. The application-side p= ort mask of > + NIC ports P0, P1, P2, P3 is noted as PORTMASK in this section. > + > +2. BIOS requirements: > + > + - Intel Hyper-Threading Technology is ENABLED > + - Hardware Prefetcher is DISABLED > + - Adjacent Cache Line Prefetch is DISABLED > + - Direct Cache Access is DISABLED > + > +3. Linux kernel requirements: > + > + - Linux kernel has the following features enabled: huge page support= , UIO, HPET > + - Appropriate number of huge pages are reserved at kernel boot time > + - The IDs of the hardware threads (logical cores) per each CPU socke= t can be > + determined by parsing the file /proc/cpuinfo. The naming conventio= n for the > + logical cores is: C{x.y.z} =3D hyper-thread z of physical core y o= f CPU socket x, > + with typical values of x =3D 0 .. 3, y =3D 0 .. 7, z =3D 0 .. 1. L= ogical cores > + C{0.0.1} and C{0.0.1} should be avoided while executing the test, = as they are > + used by the Linux kernel for running regular processes. > + > +4. Software application requirements > + > +5. Support igb_uio and vfio driver, if used vfio, kernel need 3.6+ and e= nable vt-d in bios. > +When used vfio , used "modprobe vfio" and "modprobe vfio-pci" insmod=20 > +vfiod driver, then used "./tools/dpdk_nic_bind.py --bind=3Dvfio-pci devi= ce_bus_id" to bind vfio driver to test driver. > + > + > +- In hash mode, the hash table used for packet routing is: > + > +| > + > ++-------+-------------+-----------+-------------+-----------+-----------= +--------+ > +| Entry | IPv4 | IPv4 | Port | Port | L4 = | Output | > +| # | destination | source | destination | source | protocol = | port | > +| | address | address | | | = | | > ++-------+-------------+-----------+-------------+-----------+-----------= +--------+ > +| 0 | 201.0.0.0 | 200.20.0.1| 102 | 12 | TCP = | P1 | > ++-------+-------------+-----------+-------------+-----------+-----------= +--------+ > +| 1 | 101.0.0.0 | 100.10.0.1| 101 | 11 | TCP = | P0 | > ++-------+-------------+-----------+-------------+-----------+-----------= +--------+ > +| 2 | 211.0.0.0 | 200.40.0.1| 102 | 12 | TCP = | P3 | > ++-------+-------------+-----------+-------------+-----------+-----------= +--------+ > +| 3 | 111.0.0.0 | 100.30.0.1| 101 | 11 | TCP = | P2 | > ++-------+-------------+-----------+-------------+-----------+-----------= +--------+ > + > + > +6. Traffic generator requirements > + > +The flows need to be configured and started by the traffic generator: > + > +| > + > ++------+---------+----------+-----------+------+-------+--------+-------= ---------------------------+ > +| Flow | Traffic | IPv4 | IPv4 | Port | Port | L4 | IPv4 = | > +| | Gen. | Dst. | Src. | Dst. | Src. | Proto. | Dst Ad= dr | > +| | Port | Address | Address | | | | Mask(C= ontinuous Increment Host) | > ++------+---------+----------+-----------+------+-------+--------+-------= ---------------------------+ > +| 1 | TG0 | 201.0.0.0| 200.20.0.1| 102 | 12 | TCP | 255= .240.0.0 | > ++------+---------+----------+-----------+------+-------+--------+-------= ---------------------------+ > +| 2 | TG1 | 101.0.0.0| 100.10.0.1| 101 | 11 | TCP | 255= .240.0.0 | > ++------+---------+------------+---------+------+-------+--------+-------= ---------------------------+ > + > + > + > +| > + > +The queue column represents the expected NIC port RX queue where the=20 > +packet should be written by the NIC hardware when RSS is enabled for tha= t port. > + > +Test Case: Layer-3 Forwarding (in Hash Mode)=20 > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +The following items are configured through the command line interface=20 > +of the > +application: > + > + - The set of one or several RX queues to be enabled for each NIC=20 > + port > + - The set of logical cores to execute the packet forwarding task > + - Mapping of the NIC RX queues to logical cores handling them. > + - The set of hash-entry-num for the exact match > + > +The test report should provide the throughput rate measurements (in=20 > +mpps and % of the line rate for 4x NIC ports) as listed in the table bel= ow: > + > +| > + > ++----+---------+---------+-------------+---------+----------+-----------= -------+ > +| # |Number of|Total |Number |Total |Number | Throughput= Rate | > +| |RX Queues|Number of|of Sockets/ |Number of|of NIX RX | Exact Matc= h Mode | > +| |per NIC |NIC RX |Cores/Threads|Threads |Queues per+-----------= -------+ > +| |Port |Queues | | |Thread | mpps | = % | > ++----+---------+---------+-------------+---------+----------+--------+--= -------+ > +| 1 | 1 |2 |1S/1C/1T |1 |1 | | = | > ++----+---------+---------+-------------+---------+----------+--------+--= -------+ > +| 2 | 1 |2 |1S/2C/1T |2 |1 | | = | > ++----+---------+---------+-------------+---------+----------+--------+--= -------+ > +| 3 | 2 |4 |1S/4C/1T |4 |2 | | = | > ++----+---------+---------+-------------+---------+----------+--------+--= -------+ > + > + > +The application command line associated with each of the above tests=20 > +is presented in the table below. The test report should present this=20 > +table with the actual command line used, replacing the PORTMASK and=20 > +C{x.y.z} with their actual values used during test execution. > + > +| > + > ++-----+-----------------------------------------------------------------= -----------------------------------------------------+ > +| # | Command Line = | > ++-----+-----------------------------------------------------------------= -----------------------------------------------------+ > +|1 |./l3fwd -c coremask -n 3 -- -E -p 0x3 --config '(P0,0,C{0.1.0}),(= P1,0,C{0.1.0})' | > ++-----+-----------------------------------------------------------------= -----------------------------------------------------+ > +|2 |./l3fwd -c coremask -n 3 -- -E -p 0x3 --config '(P0,0,C{0.1.0}),(= P1,0,C{0.2.0})' | > ++-----+-----------------------------------------------------------------= -----------------------------------------------------+ > +|3 |./l3fwd -c coremask -n 3 -- -E -p 0x3 --config '(P0,0,C{0.1.0}),(= P0,1,C{0.2.0}),(P1,0,C{0.3.0}),(P1,1,C{0.4.0})' | > ++-----+-----------------------------------------------------------------= -----------------------------------------------------+ > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > diff --git a/tests/TestSuite_l3fwd_em.py b/tests/TestSuite_l3fwd_em.py=20 > new file mode 100644 index 0000000..18e48a8 > --- /dev/null > +++ b/tests/TestSuite_l3fwd_em.py > @@ -0,0 +1,286 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. > +# All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without=20 > +# modification, are permitted provided that the following conditions=20 > +# are met: > +# > +# * Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# * Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in > +# the documentation and/or other materials provided with the > +# distribution. > +# * Neither the name of Intel Corporation nor the names of its > +# contributors may be used to endorse or promote products derived > +# from this software without specific prior written permission. > +# > +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=20 > +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #=20 > +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR=20 > +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE=20 > +COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,=20 > +INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES=20 > +(INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR=20 > +SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION)=20 > +HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT,=20 > +STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE)=20 > +ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF= THE POSSIBILITY OF SUCH DAMAGE. > + > +""" > +DPDK Test suite. > +Layer-3 forwarding exact-match test script. > +""" > + > +import dts > +import string > +import re > +from test_case import TestCase > +from exception import VerifyFailure > +from settings import HEADER_SIZE > +from etgen import IxiaPacketGenerator from utils import * > + > +class TestL3fwdEM(TestCase,IxiaPacketGenerator): > + > + path =3D "./examples/l3fwd/build/" > + > + test_cases_2_ports =3D {"1S/1C/1T": "%s -c %s -n %d -- -p %s -E --co= nfig '(P0,0,C{1.1.0}), (P1,0,C{1.1.0})' --hash-entry-num 0x400000", > + "1S/2C/1T": "%s -c %s -n %d -- -p %s -E --conf= ig '(P0,0,C{1.1.0}), (P1,0,C{1.2.0})' --hash-entry-num 0x400000", > + "1S/4C/1T": "%s -c %s -n %d -- -p %s -E --conf= ig '(P0,0,C{1.1.0}), (P1,0,C{1.2.0}),(P0,1,C{1.3.0}), (P1,1,C{1.4.0})' --ha= sh-entry-num 0x400000" > + } > + > + > + frame_sizes =3D [64, 65, 128, 256, 512, 1518] # 65, 128 > + methods =3D ['exact'] > + > + # > + # > + # Utility methods and other non-test code. > + # > + # Insert or move non-test functions here. > + def portRepl(self, match): > + """ > + Function to replace P([0123]) pattern in tables > + """ > + > + portid =3D match.group(1) > + self.verify(int(portid) in range(4), "invalid port id") > + if int(portid) >=3D len(valports): > + return '0' > + else: > + return '%s' % valports[int(portid)] > + > + # > + # > + # > + # Test cases. > + # > + > + def set_up_all(self): > + """ > + Run at the start of each test suite. > + > + > + L3fwd Prerequisites > + """ > + # Based on h/w type, choose how many ports to use > + ports =3D self.dut.get_ports(socket=3D1) > + if not ports: > + ports =3D self.dut.get_ports(socket=3D0) > + > + self.tester.extend_external_packet_generator(TestL3fwdEM, self) > + # Verify that enough ports are available > + self.verify(len(ports) >=3D 2, "Insufficient ports for speed=20 > + testing") > + > + netdev =3D self.dut.ports_info[ports[0]]['port'] > + > + self.port_socket =3D netdev.socket > + > + > + # Verify that enough threads are available > + cores =3D self.dut.get_core_list("1S/8C/2T") > + self.verify(cores is not None, "Insufficient cores for speed=20 > + testing") > + > + global valports > + valports =3D [_ for _ in ports if self.tester.get_local_port(_)= =20 > + !=3D -1] > + > + self.verify(len(valports) >=3D 2, "Insufficient active ports=20 > + for speed testing") > + > + pat =3D re.compile("P([0123])") > + > + # Update config file and rebuild to get best perf on FVL > + self.dut.send_expect("sed -i -e 's/CONFIG_RTE_PCI_CONFIG=3Dn/CON= FIG_RTE_PCI_CONFIG=3Dy/' ./config/common_linuxapp", "#", 20) > + self.dut.send_expect("sed -i -e 's/CONFIG_RTE_PCI_EXTENDED_TAG= =3D.*$/CONFIG_RTE_PCI_EXTENDED_TAG=3D\"on\"/' ./config/common_linuxapp", "#= ", 20) > + self.dut.build_install_dpdk(self.target) > + > + > + > + out =3D self.dut.build_dpdk_apps("./examples/l3fwd") > + self.verify("Error" not in out, "compilation error 1") > + self.verify("No such file" not in out, "compilation error 2") > + > + > + self.l3fwd_test_results =3D {'header': [], > + 'data': []} > + > + > + def repl(self, match): > + pid =3D match.group(1) > + qid =3D match.group(2) > + self.logger.debug("%s\n" % match.group(3)) > + lcid =3D self.dut.get_lcore_id(match.group(3)) > + self.logger.debug("%s\n" % lcid) > + > + global corelist > + corelist.append(int(lcid)) > + > + self.verify(int(pid) in range(4), "invalid port id") > + self.verify(lcid, "invalid thread id") > + > + return '%s,%s,%s' % (str(valports[int(pid)]), qid, lcid) > + > + > + def set_up(self): > + """ > + Run before each test case. > + """ > + pass > + > + > + def test_perf_l3fwd_2ports(self): > + """ > + L3fwd main 2 ports. > + """ > + > + 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 [] > + > + for frame_size in TestL3fwdEM.frame_sizes: > + > + # Prepare traffic flow > + payload_size =3D frame_size - \ > + HEADER_SIZE['ip'] - HEADER_SIZE['eth'] -=20 > + HEADER_SIZE['tcp'] > + > + # Traffic for port0 > + dmac_port0 =3D self.dut.get_mac_address(valports[0]) > + flow1 =3D '[Ether(dst=3D"%s")/IP(src=3D"200.20.0.1",dst=3D"2= 01.0.0.0")/TCP(sport=3D12,dport=3D102)/("X"*%d)]' %(dmac_port0,payload_size= ) > + self.tester.scapy_append('wrpcap("dst0.pcap",%s)' %flow1) > + > + # Traffic for port1 > + dmac_port1 =3D self.dut.get_mac_address(valports[1]) > + flow2 =3D '[Ether(dst=3D"%s")/IP(src=3D"100.10.0.1",dst=3D"1= 01.0.0.0")/TCP(sport=3D11,dport=3D101)/("X"*%d)]' %(dmac_port1,payload_size= ) > + self.tester.scapy_append('wrpcap("dst1.pcap",%s)' %flow2) > + self.tester.scapy_execute() > + > + > + > + # 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(TestL3fwdEM.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,=20 > + rtCmdLines[key]) > + > + self.logger.info("%s\n" % str(corelist)) > + coreMask[key] =3D dts.create_mask(set(corelist)) > + > + # measure by two different mode > + for mode in TestL3fwdEM.methods: > + > + # start l3fwd > + index =3D 0 > + subtitle =3D [] > + for cores in rtCmdLines.keys(): > + > + 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] % (TestL3fwdEM.path + = "l3fwd", coreMask[cores], > + =20 > + self.dut.get_memory_channels(), dts.create_mask(valports[:2])) > + > + dts.report(cmdline + "\n", frame=3DTrue,=20 > + annex=3DTrue) > + > + out =3D self.dut.send_expect(cmdline, "L3FWD:=20 > + entering main loop", 120) > + > + > + print self.dut.get_session_output(timeout=3D3) > + > + > + # 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(valpor= ts[rxPort + 1]) > + else: > + txIntf =3D=20 > + self.tester.get_local_port(valports[rxPort - 1]) > + > + rxIntf =3D self.tester.get_local_port(valports[r= xPort]) > + if rxPort % 2 =3D=3D 0: > + tgenInput.append((txIntf, rxIntf, "dst%d.pca= p" %valports[rxPort+1])) > + else: > + tgenInput.append((txIntf, rxIntf,=20 > + "dst%d.pcap" %valports[rxPort-1])) > + > + _, pps =3D=20 > + self.tester.traffic_generator_throughput(tgenInput,delay=3D20) > + > + self.verify(pps > 0, "No traffic detected") > + pps /=3D 1000000.0 > + linerate =3D self.wirespeed(self.nic, frame_size, 2) > + pct =3D pps * 100 / linerate > + > + index +=3D 1 > + > + # Stop l3fwd > + self.dut.send_expect("^C", "#") > + 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) > + > + 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 -ipProtocol ipV4ProtocolTcp") > + self.add_tcl_cmd('ip config -sourceIpAddr "%s"' % src) > + self.add_tcl_cmd("ip config -sourceIpAddrMode ipIdle") > + self.add_tcl_cmd('ip config -destIpAddr "%s"' % dst) > + self.add_tcl_cmd("ip config -destIpAddrMode ipContIncrHost") > + self.add_tcl_cmd("ip config -destIpMask '255.240.0.0'") > + self.add_tcl_cmd("ip config -ttl %d" % ttl) > + self.add_tcl_cmd("ip config -totalLength %d" % len) > + self.add_tcl_cmd("ip config -fragment %d" % frag) > + self.add_tcl_cmd("ip config -identifier %d" % id) > + self.add_tcl_cmd("stream config -framesize %d" % (len + 18)) > + self.add_tcl_cmd("ip set %d %d %d" % (self.chasId,=20 > + port['card'], port['port'])) > + > + def tear_down(self): > + """ > + Run after each test case. > + """ > + pass > + > + def tear_down_all(self): > + """ > + Run after each test suite. > + """ > + pass