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 C97D49E5 for ; Wed, 16 Sep 2015 04:18:48 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 15 Sep 2015 19:18:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,537,1437462000"; d="scan'208";a="769893442" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga001.jf.intel.com with ESMTP; 15 Sep 2015 19:18:26 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 16 Sep 2015 10:18:25 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.110]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.210]) with mapi id 14.03.0248.002; Wed, 16 Sep 2015 10:18:24 +0800 From: "Liu, Yong" To: "Xu, Qian Q" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] Update the suite to remove promisc and UDP for lpm case, add socket sensitive. Thread-Index: AQHQ6tASGDdDqWkDl0uhA5p2TmnvEJ4+dkWQ Date: Wed, 16 Sep 2015 02:18:23 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10EF4641@SHSMSX103.ccr.corp.intel.com> References: <1441783204-15643-1-git-send-email-qian.q.xu@intel.com> In-Reply-To: <1441783204-15643-1-git-send-email-qian.q.xu@intel.com> Accept-Language: zh-CN, 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] Update the suite to remove promisc and UDP for lpm case, add socket sensitive. 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, 16 Sep 2015 02:18:49 -0000 Applied, thx. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Qian Xu > Sent: Wednesday, September 09, 2015 3:20 PM > To: dts@dpdk.org > Subject: [dts] [PATCH] Update the suite to remove promisc and UDP for lpm > case, add socket sensitive. >=20 > The major updates are as below: > 1. Remove promisc mode in the sample command and ensure the traffic is > sent to the correct MAC address. > 2. Update 2 ports and 4 ports case list, which can cover 10G, 40G Nics. > 3. Make the lcore's socket in the commands automatically change with the > NIC's socket. > 4. Remove UDP in traffic settings. > 5. Update config file to have best perf on FVL. >=20 > Signed-off-by: Qian Xu >=20 > diff --git a/tests/TestSuite_l3fwd.py b/tests/TestSuite_l3fwd.py > index 65fa6f7..0e09256 100644 > --- a/tests/TestSuite_l3fwd.py > +++ b/tests/TestSuite_l3fwd.py > @@ -41,55 +41,29 @@ from plotting import Plotting > from test_case import TestCase > from exception import VerifyFailure > from settings import HEADER_SIZE > +from etgen import IxiaPacketGenerator >=20 > - > -class TestL3fwd(TestCase): > +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 -P -- > config '(P0,0,C{1.1.0}), (P1,0,C{1.1.0})'", > - "1S/1C/2T": "%s -c %s -n %d -- -p %s -P -- > config '(P0,0,C{1.1.0}), (P1,0,C{1.1.1})'", > - "1S/2C/1T": "%s -c %s -n %d -- -p %s -P -- > config '(P0,0,C{1.1.0}), (P1,0,C{1.2.0})'" > + 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})'", > + "1S/1C/2T": "%s -c %s -n %d -- -p %s --config > '(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})'", > + "1S/4C/1T": "%s -c %s -n %d -- -p %s --config > '(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 --config > '(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 -P --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/1C/2T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{1.1.0}),(P1,0,C{1.1.0}),(P2,0,C{1.1.1}),(P3,0,C{1.1.1})'"), > - (1, "1S/2C/1T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{1.1.0}),(P1,0,C{1.1.0}),(P2,0,C{1.2.0}),(P3,0,C{1.2.0})'"), > + "%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})'"), > (1, "1S/2C/2T", > - "%s -c %s -n %d -- -p %s -P --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})'"), > + "%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 -P --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})'"), > - (1, "2S/1C/1T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{0.1.0}),(P1,0,C{0.1.0}),(P2,0,C{1.1.0}),(P3,0,C{1.1.0})'"), > - (1, "2S/1C/2T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{0.1.0}),(P1,0,C{0.1.1}),(P2,0,C{1.1.0}),(P3,0,C{1.1.1})'"), > - (1, "2S/2C/1T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{0.1.0}),(P1,0,C{0.2.0}),(P2,0,C{1.1.0}),(P3,0,C{1.2.0})'"), > - (2, "1S/1C/1T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{1.1.0}),(P0,1,C{1.1.0}),(P1,0,C{1.1.0}),(P1,1,C{1.1.0}),(P2,0,C{= 1 > .1.0}),(P2,1,C{1.1.0}),(P3,0,C{1.1.0}),(P3,1,C{1.1.0})'"), > - (2, "1S/1C/2T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{1.1.0}),(P0,1,C{1.1.0}),(P1,0,C{1.1.0}),(P1,1,C{1.1.0}),(P2,0,C{= 1 > .1.1}),(P2,1,C{1.1.1}),(P3,0,C{1.1.1}),(P3,1,C{1.1.1})'"), > - (2, "1S/2C/1T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{1.1.0}),(P0,1,C{1.1.0}),(P1,0,C{1.1.0}),(P1,1,C{1.1.0}),(P2,0,C{= 1 > .2.0}),(P2,1,C{1.2.0}),(P3,0,C{1.2.0}),(P3,1,C{1.2.0})'"), > - (2, "1S/2C/2T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{1.1.0}),(P0,1,C{1.1.0}),(P1,0,C{1.1.1}),(P1,1,C{1.1.1}),(P2,0,C{= 1 > .2.0}),(P2,1,C{1.2.0}),(P3,0,C{1.2.1}),(P3,1,C{1.2.1})'"), > - (2, "1S/4C/1T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{1.1.0}),(P0,1,C{1.1.0}),(P1,0,C{1.2.0}),(P1,1,C{1.2.0}),(P2,0,C{= 1 > .3.0}),(P2,1,C{1.3.0}),(P3,0,C{1.4.0}),(P3,1,C{1.4.0})'"), > - (2, "1S/4C/2T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{1.1.0}),(P0,1,C{1.1.1}),(P1,0,C{1.2.0}),(P1,1,C{1.2.1}),(P2,0,C{= 1 > .3.0}),(P2,1,C{1.3.1}),(P3,0,C{1.4.0}),(P3,1,C{1.4.1})'"), > - (2, "2S/1C/1T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{0.1.0}),(P0,1,C{0.1.0}),(P1,0,C{0.1.0}),(P1,1,C{0.1.0}),(P2,0,C{= 1 > .1.0}),(P2,1,C{1.1.0}),(P3,0,C{1.1.0}),(P3,1,C{1.1.0})'"), > - (2, "2S/1C/2T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{0.1.0}),(P0,1,C{0.1.0}),(P1,0,C{0.1.1}),(P1,1,C{0.1.1}),(P2,0,C{= 1 > .1.0}),(P2,1,C{1.1.0}),(P3,0,C{1.1.1}),(P3,1,C{1.1.1})'"), > + "%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})'"), > + (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", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{0.1.0}),(P0,1,C{0.1.0}),(P1,0,C{0.2.0}),(P1,1,C{0.2.0}),(P2,0,C{= 1 > .1.0}),(P2,1,C{1.1.0}),(P3,0,C{1.2.0}),(P3,1,C{1.2.0})'"), > - (2, "2S/2C/2T", > - "%s -c %s -n %d -- -p %s -P --config > '(P0,0,C{0.1.0}),(P0,1,C{0.1.1}),(P1,0,C{0.2.0}),(P1,1,C{0.2.1}),(P2,0,C{= 1 > .1.0}),(P2,1,C{1.1.1}),(P3,0,C{1.2.0}),(P3,1,C{1.2.1})'"), > - (2, "2S/4C/1T", > - "%s -c %s -n %d -- -p %s -P --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}),(P2,0,C{= 1 > .1.0}),(P2,1,C{1.2.0}),(P3,0,C{1.3.0}),(P3,1,C{1.4.0})'") > + "%s -c %s -n %d -- -p %s --config > '(P0,0,C{1.1.0}),(P1,0,C{1.2.0}),(P2,0,C{0.3.0}),(P3,0,C{0.4.0})'"), > ] >=20 > queues_4_ports =3D [] > @@ -120,8 +94,7 @@ class TestL3fwd(TestCase): > "{IPv4(13,101,0,0), 24, P3}", > ] >=20 > - frame_sizes =3D [64] # 65, 128 > - > + frame_sizes =3D [64,128] # 65, 128 > methods =3D ['lpm', 'exact'] >=20 > # > @@ -313,18 +286,30 @@ class TestL3fwd(TestCase): > if not ports: > ports =3D self.dut.get_ports(socket=3D0) >=20 > + self.tester.extend_external_packet_generator(TestL3fwd, self) > # Verify that enough ports are available > self.verify(len(ports) >=3D 2, "Insufficient ports for speed > testing") > + > + netdev =3D self.dut.ports_info[ports[0]]['port'] > + > + self.port_socket =3D netdev.socket > + >=20 > # Verify that enough threads are available > - cores =3D self.dut.get_core_list("2S/4C/2T") > + cores =3D self.dut.get_core_list("2S/8C/2T") > self.verify(cores is not None, "Insufficient cores for speed > testing") >=20 > global valports > valports =3D [_ for _ in ports if self.tester.get_local_port(_) = !=3D > -1] > + > self.verify(len(valports) >=3D 2, "Insufficient active ports for > speed testing") >=20 > 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/CONFIG_RTE_PCI_CONFIG=3Dy/' ./config/common_= linux > app", "#", 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) > + >=20 > # Prepare long prefix match table, replace P(x) port pattern > lpmStr =3D "static struct ipv4_l3fwd_route ipv4_l3fwd_route_arra= y[] > =3D {\\\n" > @@ -372,16 +357,16 @@ class TestL3fwd(TestCase): > Return a list of packets that implements the flows described in > the > l3fwd test plan. >=20 > - """ > + """ > return [ > - 'IP(src=3D"1.2.3.4",dst=3D"10.100.0.1")/UDP(sport=3D10,dport= =3D1)', > - 'IP(src=3D"1.2.3.4",dst=3D"10.101.0.1")/UDP(sport=3D10,dport= =3D1)', > - 'IP(src=3D"1.2.3.4",dst=3D"11.100.0.1")/UDP(sport=3D11,dport= =3D1)', > - 'IP(src=3D"1.2.3.4",dst=3D"11.101.0.1")/UDP(sport=3D11,dport= =3D1)', > - 'IP(src=3D"1.2.3.4",dst=3D"12.100.0.1")/UDP(sport=3D12,dport= =3D1)', > - 'IP(src=3D"1.2.3.4",dst=3D"12.101.0.1")/UDP(sport=3D12,dport= =3D1)', > - 'IP(src=3D"1.2.3.4",dst=3D"13.100.0.1")/UDP(sport=3D13,dport= =3D1)', > - 'IP(src=3D"1.2.3.4",dst=3D"13.101.0.1")/UDP(sport=3D13,dport= =3D1)'] > + 'IP(src=3D"1.2.3.4",dst=3D"11.100.0.1")', > + 'IP(src=3D"1.2.3.4",dst=3D"11.101.0.1")', > + 'IP(src=3D"1.2.3.4",dst=3D"10.100.0.1")', > + 'IP(src=3D"1.2.3.4",dst=3D"10.101.0.1")', > + 'IP(src=3D"1.2.3.4",dst=3D"13.100.0.1")', > + 'IP(src=3D"1.2.3.4",dst=3D"13.101.0.1")', > + 'IP(src=3D"1.2.3.4",dst=3D"12.100.0.1")', > + 'IP(src=3D"1.2.3.4",dst=3D"12.101.0.1")'] >=20 > def repl(self, match): > pid =3D match.group(1) > @@ -404,6 +389,9 @@ class TestL3fwd(TestCase): > """ >=20 > output_pattern =3D re.compile("P([0123]),([0123]),(C\{\d.\d.\d\}= )") > + pat2 =3D re.compile("C\{\d") > + repl1 =3D "C{" + str(self.port_socket) > + >=20 > bps =3D dict() > pps =3D dict() > @@ -411,9 +399,14 @@ class TestL3fwd(TestCase): >=20 > global corelist > corelist =3D [] > - > + > + > while output_pattern.search(command_line): > + # If one socket case, we update the socket to ensure the core > used by l3fwd is on the same socket of the NIC. > + if cores_config.find('1S')>=3D0: > + command_line =3D pat2.sub(repl1,command_line) > command_line =3D output_pattern.sub(self.repl, command_line) > + >=20 > self.logger.debug("%s\n" % str(corelist)) > core_mask =3D dts.create_mask(set(corelist)) > @@ -439,7 +432,11 @@ class TestL3fwd(TestCase): > tx_interface =3D > self.tester.get_local_port(valports[rxPort - 1]) >=20 > rx_interface =3D > self.tester.get_local_port(valports[rxPort]) > - tgen_input.append((tx_interface, rx_interface, > "dst%d.pcap" % valports[rxPort])) > + # Make sure the traffic send to the correct MAC address > + if rxPort % 2 =3D=3D 0: > + tgen_input.append((tx_interface, rx_interface, > "dst%d.pcap" % valports[rxPort+1])) > + else: > + tgen_input.append((tx_interface, rx_interface, > "dst%d.pcap" % valports[rxPort-1])) >=20 > # FIX ME > bps[method], pps[method] =3D > self.tester.traffic_generator_throughput(tgen_input) > @@ -490,7 +487,7 @@ class TestL3fwd(TestCase): > for frame_size in TestL3fwd.frame_sizes: >=20 > # Prepare traffic flow > - payload_size =3D frame_size - HEADER_SIZE['udp'] - \ > + payload_size =3D frame_size - \ > HEADER_SIZE['ip'] - HEADER_SIZE['eth'] >=20 > for _port in range(4): > @@ -532,28 +529,37 @@ class TestL3fwd(TestCase): > for frame_size in TestL3fwd.frame_sizes: >=20 > # Prepare traffic flow > - payload_size =3D frame_size - HEADER_SIZE['udp'] - \ > + payload_size =3D frame_size - \ > HEADER_SIZE['ip'] - HEADER_SIZE['eth'] > - > - flows =3D ['Ether()/%s/("X"*%d)' % (flow, payload_size) for > flow in self.flows()[:4]] > + 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() >=20 > 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) >=20 > - self.tester.scapy_append('wrpcap("test2ports.pcap", [%s])' % > string.join(flows, ',')) > - self.tester.scapy_execute() >=20 > # 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)) >=20 > @@ -589,8 +595,10 @@ class TestL3fwd(TestCase): > txIntf =3D > self.tester.get_local_port(valports[rxPort - 1]) >=20 > rxIntf =3D > self.tester.get_local_port(valports[rxPort]) > - > - tgenInput.append((txIntf, rxIntf, > "test2ports.pcap")) > + 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])) >=20 > _, pps =3D > self.tester.traffic_generator_throughput(tgenInput) > self.verify(pps > 0, "No traffic detected") > -- > 2.1.0