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 6FDB93005 for ; Tue, 22 Dec 2015 09:33:05 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 22 Dec 2015 00:33:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,463,1444719600"; d="scan'208";a="878876785" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 22 Dec 2015 00:33:03 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id tBM8Wxb7015102; Tue, 22 Dec 2015 16:32:59 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tBM8WvLb018657; Tue, 22 Dec 2015 16:32:59 +0800 Received: (from hengdinx@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id tBM8WvL9018653; Tue, 22 Dec 2015 16:32:57 +0800 From: Ding Heng To: dts@dpdk.org Date: Tue, 22 Dec 2015 16:32:56 +0800 Message-Id: <1450773176-18622-1-git-send-email-hengx.ding@intel.com> X-Mailer: git-send-email 1.7.4.1 Cc: Ding Heng Subject: [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: Tue, 22 Dec 2015 08:33:06 -0000 Add RFC2544 test as a case in l3fwd. Made some change to framework.py to fix the run time not work issue. Signed-off-by: Ding Heng 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, delay) 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 = [] for row in data: - if row[5] == mode and row[2] == core: + if row[1] == mode and row[2] == core: core_ydata.append(float(row[4])) 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] == core and row[0] == frame_size and \ - row[5] == mode: + row[1] == mode: mode_ydata.append(float(row[4])) ydata.append(mode_ydata) @@ -521,7 +521,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): L3fwd main 2 ports. """ - header_row = ["Frame", "Ports", "S/C/T", "Mpps", "% linerate", "mode"] + header_row = ["Frame", "mode", "S/C/T", "Mpps", "% linerate"] self.l3fwd_test_results['header'] = header_row dts.results_table_add_header(header_row) self.l3fwd_test_results['data'] = [] @@ -533,7 +533,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): HEADER_SIZE['ip'] - HEADER_SIZE['eth'] for _port in range(2): dmac = self.dut.get_mac_address(valports[_port]) - flows = ['Ether(dst=%s)/%s/("X"*%d)' % (dmac, flow, payload_size) for flow in self.flows()[_port *2:(_port +1)*2]] + flows = ['Ether(dst="%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() @@ -611,13 +611,113 @@ class TestL3fwd(TestCase,IxiaPacketGenerator): # Stop l3fwd self.dut.send_expect("^C", "#") - data_row = [frame_size, 2, cores, str(pps), str(pct), mode] + data_row = [frame_size, mode, cores, str(pps), str(pct)] dts.results_table_add_row(data_row) self.l3fwd_test_results['data'].append(data_row) self.plot_2_ports() dts.results_table_print() + def test_perf_rfc2544(self): + + header_row = ["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'] = header_row + dts.results_table_add_header(header_row) + self.l3fwd_test_results['data'] = [] + + for frame_size in TestL3fwd.frame_sizes: + + # Prepare traffic flow + payload_size = frame_size - \ + HEADER_SIZE['ip'] - HEADER_SIZE['eth'] + for _port in range(2): + dmac = self.dut.get_mac_address(valports[_port]) + flows = ['Ether(dst="%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=True) + dts.report("%s" % string.join(flows, '\n'), + frame=True, annex=True) + + + # Prepare the command line + global corelist + pat = re.compile("P([0123]),([0123]),(C\{\d.\d.\d\})") + + pat2 = re.compile("C\{\d") + repl1 = "C{" + str(self.port_socket) + + coreMask = {} + rtCmdLines = dict(TestL3fwd.test_cases_2_ports) + for key in rtCmdLines.keys(): + corelist = [] + while pat.search(rtCmdLines[key]): + # Change the socket to the NIC's socket + if key.find('1S')>=0: + rtCmdLines[key] = pat2.sub(repl1, rtCmdLines[key]) + rtCmdLines[key] = pat.sub(self.repl, rtCmdLines[key]) + + self.logger.info("%s\n" % str(corelist)) + coreMask[key] = dts.create_mask(set(corelist)) + + # measure by two different mode + for mode in TestL3fwd.methods: + + # start l3fwd + index = 0 + subtitle = [] + for cores in rtCmdLines.keys(): + + #in order to save time, only some of the cases will be run. + if mode == "lpm" and (cores == "1S/1C/1T" or cores == "1S/4C/1T"): + info = "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=True) + + subtitle.append(cores) + cmdline = rtCmdLines[cores] % (TestL3fwd.path + "l3fwd_" + mode, coreMask[cores], + self.dut.get_memory_channels(), dts.create_mask(valports[:2])) + + dts.report(cmdline + "\n", frame=True, annex=True) + + out = self.dut.send_expect(cmdline, "L3FWD:", 120) + + # Measure test + tgenInput = [] + for rxPort in range(2): + # No use on rx/tx limitation + if rxPort % 2 == 0: + txIntf = self.tester.get_local_port(valports[rxPort + 1]) + else: + txIntf = self.tester.get_local_port(valports[rxPort - 1]) + + rxIntf = self.tester.get_local_port(valports[rxPort]) + if rxPort % 2 == 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 = self.tester.run_rfc2544(tgenInput, delay=60) + loss_pkts = tx_pkts - rx_pkts + self.dut.send_expect("^C", "#") + + tx_pkts /= 1000000 + rx_pkts /= 1000000 + + data_row = [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 += 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