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 9BE2F922D for ; Tue, 15 Sep 2015 12:33:23 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 15 Sep 2015 03:33:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,535,1437462000"; d="scan'208";a="562019766" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by FMSMGA003.fm.intel.com with ESMTP; 15 Sep 2015 03:33:22 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 15 Sep 2015 18:33:19 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.75]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.210]) with mapi id 14.03.0248.002; Tue, 15 Sep 2015 18:33:18 +0800 From: "Xu, HuilongX" To: "Xu, Qian Q" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 1/2] Add updated vmdq test suite. Thread-Index: AQHQ74DQ+c3JEpJWH0SDM5SiyJ9sW549Rg5A//+BRgCAAJz9kA== Date: Tue, 15 Sep 2015 10:33:18 +0000 Message-ID: References: <1442298928-23647-1-git-send-email-qian.q.xu@intel.com> <82F45D86ADE5454A95A89742C8D1410E01DDBB1D@shsmsx102.ccr.corp.intel.com> In-Reply-To: <82F45D86ADE5454A95A89742C8D1410E01DDBB1D@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: Bc0= AAAI AYg+ BSoj BhmL BvfJ DGJe DRgi DuEm ErCS Fyb8 GO+k GjWf HSYw IXQc LZg2; 1; ZAB0AHMAQABkAHAAZABrAC4AbwByAGcA; Sosha1_v1; 7; {3C62AB74-3A51-41E7-AD65-CAE3B3BE73B5}; aAB1AGkAbABvAG4AZwB4AC4AeAB1AEAAaQBuAHQAZQBsAC4AYwBvAG0A; Tue, 15 Sep 2015 10:33:16 GMT; UgBFADoAIABbAGQAdABzAF0AIABbAFAAQQBUAEMASAAgADEALwAyAF0AIABBAGQAZAAgAHUAcABkAGEAdABlAGQAIAB2AG0AZABxACAAdABlAHMAdAAgAHMAdQBpAHQAZQAuAA== x-cr-puzzleid: {3C62AB74-3A51-41E7-AD65-CAE3B3BE73B5} 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 1/2] Add updated vmdq test suite. 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: Tue, 15 Sep 2015 10:33:24 -0000 Hi qian, Would need add vmdq function test case, or only run performance test? If only run performance test, I think not need add in execution files. I suggest you can add a new execution file for performance test. Thanks a lot > -----Original Message----- > From: Xu, Qian Q > Sent: Tuesday, September 15, 2015 5:09 PM > To: Xu, HuilongX; dts@dpdk.org > Subject: RE: [dts] [PATCH 1/2] Add updated vmdq test suite. >=20 > Huilong > It's a performance test, do you want to test? >=20 > Thanks > Qian >=20 >=20 > -----Original Message----- > From: Xu, HuilongX > Sent: Tuesday, September 15, 2015 4:45 PM > To: Xu, Qian Q; dts@dpdk.org > Subject: RE: [dts] [PATCH 1/2] Add updated vmdq test suite. >=20 > Hi qian, > Could you add this test in execution.conf and execution_FVL.conf for > Niantic and FVL NIC test? > Thanks a lot >=20 > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Qian Xu > > Sent: Tuesday, September 15, 2015 2:35 PM > > To: dts@dpdk.org > > Subject: [dts] [PATCH 1/2] Add updated vmdq test suite. > > > > Updated vmdq test suite, and it works for both FVL and Niantic. The > > major changes are as below: > > 1. Support FVL 4x10g, 2x10g, 2x40g. > > 2. Update the traffic to make the MAC address and VLAN id changes > together. > > Then the packet loss is 0 at low traffic. > > 3. Set the max pools number for major NICs: FVL 40G, 10G, Niantic, 1G. > > 4. Update the core config. > > > > Signed-off-by: Qian Xu > > > > diff --git a/tests/TestSuite_vmdq.py b/tests/TestSuite_vmdq.py new > > file mode 100644 index 0000000..5949bce > > --- /dev/null > > +++ b/tests/TestSuite_vmdq.py > > @@ -0,0 +1,262 @@ > > +# > > + > > +""" > > +DPDK Test suite. > > + > > +Tests for vmdq. > > + > > +""" > > + > > +import dts > > +import re > > +from etgen import IxiaPacketGenerator from test_case import TestCase > > +from time import sleep > > + > > + > > +class TestVmdq(TestCase, IxiaPacketGenerator): > > + dut_ports =3D [] > > + ip_dot1q_header_size =3D 22 > > + default_framesize =3D 64 > > + default_payload =3D default_framesize - ip_dot1q_header_size > > + current_frame_size =3D 0 > > + destmac_port0 =3D "52:54:00:12:00:00" > > + destmac_port1 =3D "52:54:00:12:01:00" > > + da_repeat =3D 1 > > + vlan_repeat =3D 1 > > + queues =3D 8 > > + > > + def set_up_all(self): > > + """ > > + Run at the start of each test suite. > > + """ > > + > > + self.tester.extend_external_packet_generator(TestVmdq, self) > > + > > + self.dut.send_expect("sed -i > > 's/CONFIG_RTE_MAX_QUEUES_PER_PORT=3D256/CONFIG_RTE_MAX_QUEUES_PER_PORT= =3D1 > > 024/ > > ' ./config/common_linuxapp", "# ", 5) > > + > > + self.dut.build_install_dpdk(self.target) > > + # Update the max queue per port for Fortville. > > + self.dut.send_expect("sed -i 's/define MAX_QUEUES 128/define > > MAX_QUEUES 1024/' ./examples/vmdq/main.c", "#", 5) > > + > > + self.dut_ports =3D self.dut.get_ports(self.nic) > > + print self.dut_ports > > + self.verify(len(self.dut_ports) >=3D 2, "Insufficient ports") > > + > > + self.core_configs =3D [] > > + self.core_configs.append({'cores': '1S/1C/1T', 'mpps': {}}) > > + self.core_configs.append({'cores': '1S/2C/1T', 'mpps': {}}) > > + self.core_configs.append({'cores': '1S/2C/2T', 'mpps': {}}) > > + self.core_configs.append({'cores': '1S/4C/1T', 'mpps': {}}) > > + > > + self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > > + out =3D self.dut.send_expect("make -C examples/vmdq", "#", 10) > > + self.verify("Error" not in out, "Compilation error") > > + > > + > > + def validateApproxEqual(self, lines): > > + """ > > + Check that all the rx queue stats are within a 30% range. > > + """ > > + > > + minimum =3D 1000000 > > + maximun =3D 0 > > + > > + # Need to use Python re package because dts.regexp only > > + handles 1 > > group, > > + # we need 4. > > + scanner =3D re.compile( > > + "^Pool [0-9]+: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)$") > > + for l in lines: > > + m =3D scanner.search(l) > > + if m is None: > > + # Line at the end, "Finished handling signal", ignore > > + pass > > + else: > > + for stat in m.groups(): > > + if stat < minimum: > > + minimum =3D stat > > + if stat > maximun: > > + maximun =3D stat > > + self.verify(maximun - minimum <=3D minimum * > > + 0.3, "Too wide variation in queue stats") > > + > > + def Npools_128queues(self, npools): > > + """ > > + MAX queues is 128 > > + queues/pools =3D 128/npools > > + """ > > + > > + TestVmdq.current_frame_size =3D TestVmdq.default_framesize > > + > > + self.dut_ports =3D self.dut.get_ports(self.nic) > > + > > + core_list =3D self.dut.get_core_list("1S/4C/1T", > > socket=3Dself.ports_socket) > > + core_mask =3D dts.create_mask(core_list) > > + > > + port_mask =3D dts.create_mask([self.dut_ports[0], > > self.dut_ports[1]]) > > + # Run the application > > + out =3D self.dut.send_expect("./examples/vmdq/build/vmdq_app -= n > > + 4 - > > c %s -- -p %s --nb-pools %s&" % > > + (core_mask, port_mask, > > + str(npools)), > > "reading queues", 120) > > + > > + # Transmit traffic > > + tx_port =3D self.tester.get_local_port(self.dut_ports[0]) > > + rx_port =3D self.tester.get_local_port(self.dut_ports[1]) > > + tx_mac =3D self.tester.get_mac(tx_port) > > + > > + self.vlan_repeat =3D npools > > + self.da_repeat =3D npools > > + tgen_input =3D [] > > + for p in range(8): > > + self.tester.scapy_append('dmac=3D"%s"' % self.destmac_port= 0) > > + self.tester.scapy_append('smac=3D"%s"' % tx_mac) > > + self.tester.scapy_append( > > + 'flows =3D [Ether(src=3Dsmac, > > dst=3Ddmac)/Dot1Q(vlan=3D0,prio=3D%d)]'%p) > > + self.tester.scapy_append('wrpcap("test%d.pcap", flows)' %p= ) > > + self.tester.scapy_execute() > > + tgen_input.append((tx_port, rx_port, "test%d.pcap" %p)) > > + > > + loss =3D self.tester.traffic_generator_loss(tgen_input, 10) > > + print "loss is %s !" % loss > > + > > + # Verify the accurate > > + self.verify(loss < 0.001, "Excessive packet loss") > > + self.validateApproxEqual(out.split("\r\n")) > > + > > + def set_up(self): > > + """ > > + Run before each test case. > > + """ > > + self.dut.kill_all() > > + > > + def test_perf_vmdq_64pools_queues(self): > > + """ > > + This function call " Npools_128queues" with differen number > > + of pools. Details see below. if not sure, set it as 8 pools. > > + """ > > + if self.nic in ("niantic", "springfountain"): > > + self.Npools_128queues(64) > > + elif self.nic in ("fortville_spirit", > "fortville_spirit_single"): > > + self.Npools_128queues(63) > > + elif self.nic in ("fortville_eagle"): > > + self.Npools_128queues(34) > > + else: > > + self.Npools_128queues(8) > > + > > + def test_perf_vmdq_performance(self): > > + """ > > + Try different configuration and different packe size > > + """ > > + > > + self.tester.get_interface( > > + self.tester.get_local_port(self.dut_ports[0])) > > + > > + frame_sizes =3D [64, 128, 256, 512, 1024, 1280, 1518] > > + for config in self.core_configs: > > + > > + print dts.BLUE(config["cores"]) > > + self.dut.kill_all() > > + > > + core_config =3D config['cores'] > > + core_list =3D > > self.dut.get_core_list(core_config,socket=3Dself.ports_socket) > > + core_mask =3D dts.create_mask(core_list) > > + portmask =3D dts.create_mask(self.dut.get_ports()) > > + if self.nic in ("niantic", "springfountain"): > > + self.queues =3D 64 > > + self.dut.send_expect( > > + "examples/vmdq/build/vmdq_app -n %d -c %s -- -p > > + %s -- > > nb-pools 64&" % > > + (self.dut.get_memory_channels(), core_mask, > > + portmask), > > "reading queues", 30) > > + elif self.nic in ("fortville_spirit", > > "fortville_spirit_single"): > > + self.queues =3D 63 > > + self.dut.send_expect( > > + "examples/vmdq/build/vmdq_app -n %d -c %s -- -p > > + %s -- > > nb-pools 63&" % > > + (self.dut.get_memory_channels(), core_mask, > > + portmask), > > "reading queues", 30) > > + elif self.nic in ("fortville_eagle"): > > + self.queues =3D 34 > > + self.dut.send_expect( > > + "examples/vmdq/build/vmdq_app -n %d -c %s -- -p > > + %s -- > > nb-pools 34&" % > > + (self.dut.get_memory_channels(), core_mask, > > + portmask), > > "reading queues", 30) > > + else: > > + self.queues =3D 8 > > + self.dut.send_expect( > > + "examples/vmdq/build/vmdq_app -n %d -c %s -- -p > > + %s -- > > nb-pools 8&" % > > + (self.dut.get_memory_channels(), core_mask, > > + portmask), > > "reading queues", 30) > > + > > + tx_port =3D self.tester.get_local_port(self.dut_ports[0]) > > + rx_port =3D self.tester.get_local_port(self.dut_ports[1]) > > + > > + print dts.GREEN("Waiting for application to initialize") > > + sleep(5) > > + > > + for frame_size in frame_sizes: > > + > > + TestVmdq.current_frame_size =3D frame_size > > + > > + print dts.BLUE(str(frame_size)) > > + > > + self.tester.scapy_append('dstmac=3D"%s"' % > > self.destmac_port0) > > + tx_mac =3D self.tester.get_mac(tx_port) > > + self.tester.scapy_append('srcmac=3D"%s"' % tx_mac) > > + self.tester.scapy_append( > > + 'flows =3D > > [Ether(src=3Dsrcmac,dst=3Ddstmac)/Dot1Q(vlan=3D0)/("X"*%d)]' % > > + (frame_size - TestVmdq.ip_dot1q_header_size)) > > + self.tester.scapy_append('wrpcap("test1.pcap", flows)'= ) > > + self.tester.scapy_execute() > > + > > + self.tester.scapy_append('dstmac=3D"%s"' % > > self.destmac_port1) > > + tx_mac =3D self.tester.get_mac(rx_port) > > + self.tester.scapy_append('srcmac=3D"%s"' % tx_mac) > > + self.tester.scapy_append( > > + 'flows =3D > > [Ether(src=3Dsrcmac,dst=3Ddstmac)/Dot1Q(vlan=3D0)/("X"*%d)]' % > > + (frame_size - TestVmdq.ip_dot1q_header_size)) > > + self.tester.scapy_append('wrpcap("test2.pcap", flows)'= ) > > + self.tester.scapy_execute() > > + > > + self.vlan_repeat =3D self.queues > > + self.da_repeat =3D self.queues > > + > > + tgen_input =3D [] > > + tgen_input.append((tx_port, rx_port, "test1.pcap")) > > + tgen_input.append((rx_port, tx_port, "test2.pcap")) > > + _, pps =3D > > self.tester.traffic_generator_throughput(tgen_input) > > + config['mpps'][frame_size] =3D pps/1000000.0 > > + > > + for n in range(len(self.core_configs)): > > + for size in frame_sizes: > > + self.verify( > > + self.core_configs[n]['mpps'][size] is not 0, "No > > traffic detected") > > + > > + # Print results > > + dts.results_table_add_header( > > + ['Frame size'] + [n['cores'] for n in self.core_configs]) > > + > > + for size in frame_sizes: > > + dts.results_table_add_row( > > + [size] + [n['mpps'][size] for n in > > + self.core_configs]) > > + > > + dts.results_table_print() > > + > > + # Override etgen.dot1q function > > + def dot1q(self, port, prio, id, vlan, type): > > + """ > > + Change Ixia configuration > > + """ > > + > > + self.add_tcl_cmd("vlan config -mode vIncrement") > > + self.add_tcl_cmd("vlan config -step 1") > > + self.add_tcl_cmd("vlan config -repeat %d" % self.vlan_repeat) > > + self.add_tcl_cmd("stream config -framesize %d" % > > + TestVmdq.current_frame_size) > > + super(TestVmdq, self).dot1q(port, prio, id, vlan, type) > > + > > + def ether(self, port, src, dst, type): > > + """ > > + Configure Ether protocal. > > + """ > > + self.add_tcl_cmd("protocol config -ethernetType ethernetII") > > + self.add_tcl_cmd('stream config -sa "%s"' % > > self.macToTclFormat(src)) > > + self.add_tcl_cmd('stream config -da "%s"' % > > self.macToTclFormat(dst)) > > + self.add_tcl_cmd('stream config -daRepeatCounter increment') > > + self.add_tcl_cmd('stream config -daStep 1') > > + self.add_tcl_cmd('stream config -numDA %d' % self.da_repeat) > > + > > + > > -- > > 2.1.0