* [dts] [PATCH 1/2] l3fwd: enable rfc2544 case and change result format for generate report
@ 2015-12-31 8:25 Ding Heng
2015-12-31 8:25 ` [dts] [PATCH 2/2] l3fwd: delete plot funtions Ding Heng
2016-01-06 1:04 ` [dts] [PATCH 1/2] l3fwd: enable rfc2544 case and change result format for generate report Liu, Yong
0 siblings, 2 replies; 4+ messages in thread
From: Ding Heng @ 2015-12-31 8:25 UTC (permalink / raw)
To: dts; +Cc: Ding Heng
Signed-off-by: Ding Heng <hengx.ding@intel.com>
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/framework/utils.py b/framework/utils.py
index dd45e9e..48bba0e 100644
--- a/framework/utils.py
+++ b/framework/utils.py
@@ -98,3 +98,13 @@ def remove_old_rsa_key(crb, ip):
remove_rsa_key_cmd = "sed -i '/^%s/d' %s" % \
(ip.strip(), rsa_key_path)
crb.send_expect(remove_rsa_key_cmd, "# ")
+
+def human_read_number(num):
+ if num > 1000000:
+ num /= 1000000
+ return str(num) + "M"
+ elif num > 1000:
+ num /= 1000
+ return str(num) + "K"
+ else:
+ return str(num)
diff --git a/tests/TestSuite_l3fwd.py b/tests/TestSuite_l3fwd.py
index 0e09256..e785b8b 100644
--- a/tests/TestSuite_l3fwd.py
+++ b/tests/TestSuite_l3fwd.py
@@ -42,28 +42,29 @@ from test_case import TestCase
from exception import VerifyFailure
from settings import HEADER_SIZE
from etgen import IxiaPacketGenerator
+from utils import *
class TestL3fwd(TestCase,IxiaPacketGenerator):
path = "./examples/l3fwd/build/"
- test_cases_2_ports = {"1S/1C/1T": "%s -c %s -n %d -- -p %s --config '(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})'",
+ test_cases_2_ports = {"1S/1C/1T": "%s -c %s -n %d -- -p %s --config '(P0,0,C{1.1.0}), (P1,0,C{1.1.0})' --enable-jumbo --max-pkt-len 4096",
+ #"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})' --enable-jumbo --max-pkt-len 4096",
+ #"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})'",
}
test_cases_4_ports = [(1, "1S/1C/1T",
- "%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 --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.0}),(P2,0,C{1.1.0}),(P3,0,C{1.1.0})' --enable-jumbo --max-pkt-len 4096"),
+ #(1, "1S/2C/2T",
+ # "%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 --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 --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})'"),
+ "%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})' --enable-jumbo --max-pkt-len 4096"),
+ #(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 --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})'"),
]
queues_4_ports = []
@@ -94,7 +95,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
"{IPv4(13,101,0,0), 24, P3}",
]
- frame_sizes = [64,128] # 65, 128
+ frame_sizes = [64, 128, 256, 512, 2048] # 65, 128
methods = ['lpm', 'exact']
#
@@ -202,7 +203,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
image_path = self.plotting.create_bars_plot(
'test_perf_l3fwd_4ports_%d_%dRxQ' % (frame_size, queues),
'LPM & Exact modes, %dB, %d Rx Queues, 4 ports' % (frame_size, queues),
- cores,
+ TestL3fwd.frame_sizes,
ydata,
ylabel='% linerate',
legend=TestL3fwd.methods)
@@ -227,7 +228,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 +256,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)
@@ -391,7 +392,6 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
output_pattern = re.compile("P([0123]),([0123]),(C\{\d.\d.\d\})")
pat2 = re.compile("C\{\d")
repl1 = "C{" + str(self.port_socket)
-
bps = dict()
pps = dict()
@@ -449,7 +449,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
# stop l3fwd
self.dut.send_expect("^C", "#")
- data_row = [frame_size, rx_queues_per_port, cores_config]
+ data_row = [frame_size, method, cores_config, rx_queues_per_port]
for method in TestL3fwd.methods:
data_row.append(pps[method])
data_row.append(pct[method])
@@ -474,7 +474,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
# Verify that enough ports are available
self.verify(len(ports) >= 4, "Insufficient ports for speed testing")
- header_row = ["Frame size", "RX Queues/NIC Port", "S/C/T"]
+ header_row = ["Frame size", "mode", "S/C/T", "RX Queues/NIC Port"]
for method in TestL3fwd.methods:
header_row.append('%s Mpps' % method)
@@ -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,116 @@ 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", "zero_loss_throughput(Mpps)"]
+ 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", "#")
+ linerate = self.wirespeed(self.nic, frame_size, 2)
+ zero_loss_throughput = (linerate * zero_loss_rate) / 100
+
+ tx_pkts = human_read_number(tx_pkts)
+ rx_pkts = human_read_number(rx_pkts)
+ loss_pkts = human_read_number(loss_pkts)
+
+ data_row = [frame_size, mode, cores, tx_pkts, rx_pkts, loss_pkts, zero_loss_rate, zero_loss_throughput]
+ 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dts] [PATCH 2/2] l3fwd: delete plot funtions
2015-12-31 8:25 [dts] [PATCH 1/2] l3fwd: enable rfc2544 case and change result format for generate report Ding Heng
@ 2015-12-31 8:25 ` Ding Heng
2015-12-31 8:36 ` Xu, Qian Q
2016-01-06 1:04 ` [dts] [PATCH 1/2] l3fwd: enable rfc2544 case and change result format for generate report Liu, Yong
1 sibling, 1 reply; 4+ messages in thread
From: Ding Heng @ 2015-12-31 8:25 UTC (permalink / raw)
To: dts; +Cc: Ding Heng
Signed-off-by: Ding Heng <hengx.ding@intel.com>
diff --git a/tests/TestSuite_l3fwd.py b/tests/TestSuite_l3fwd.py
index e785b8b..63d6acd 100644
--- a/tests/TestSuite_l3fwd.py
+++ b/tests/TestSuite_l3fwd.py
@@ -95,7 +95,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
"{IPv4(13,101,0,0), 24, P3}",
]
- frame_sizes = [64, 128, 256, 512, 2048] # 65, 128
+ frame_sizes = [64]#, 128, 256, 512, 2048] # 65, 128
methods = ['lpm', 'exact']
#
@@ -121,160 +121,6 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
# Test cases.
#
- def plot_4_ports(self):
-
- data = self.l3fwd_test_results['data']
-
- # Create a plot for each number of queues for frame size and mode comparison
- cores = '1S/1C/1T'
- for queues in TestL3fwd.queues_4_ports:
- ydata = []
- lpm_ydata = []
- exact_ydata = []
- for frame_size in TestL3fwd.frame_sizes:
- for row in data:
- if row[1] * 4 == queues and row[2] == cores and \
- row[0] == frame_size:
- if len(TestL3fwd.methods) == 2:
- lpm_ydata.append(row[4])
- exact_ydata.append(row[6])
- else:
- if 'lpm' in TestL3fwd.methods:
- lpm_ydata.append(row[4])
- if 'exact' in TestL3fwd.methods:
- exact_ydata.append(row[4])
-
- if 'lpm' in TestL3fwd.methods:
- ydata.append(lpm_ydata)
- if 'exact' in TestL3fwd.methods:
- ydata.append(exact_ydata)
-
- if len(ydata[0]) == 0:
- self.logger.warning('No data for plotting 1S/1C/1T')
- break
- else:
- try:
- image_path = self.plotting.create_bars_plot(
- 'test_perf_l3fwd_4ports_1S_1C_1T_%dRxQ' % queues,
- 'LPM & Exact modes, 1S/1C/1T, %d Rx Queues, 4 ports' % queues,
- TestL3fwd.frame_sizes,
- ydata,
- ylabel='% linerate',
- legend=TestL3fwd.methods)
-
- dts.results_plot_print(image_path, 50)
- except VerifyFailure as e:
- self.logger.error(str(e))
-
- # Create a plot for each number of queues for core config and mode comparison
- frame_size = TestL3fwd.frame_sizes[0] # Frame size fixed to the first selected
- for queues in TestL3fwd.queues_4_ports:
-
- cores = []
- for row in data:
- if row[2] not in cores and \
- row[1] * 4 == queues:
- cores.append(row[2])
-
- ydata = []
- lpm_ydata = []
- exact_ydata = []
-
- for core in cores:
- for row in data:
- if row[1] * 4 == queues and \
- row[2] == core and \
- row[0] == frame_size:
- if len(TestL3fwd.methods) == 2:
- lpm_ydata.append(row[4])
- exact_ydata.append(row[6])
- else:
- if 'lpm' in TestL3fwd.methods:
- lpm_ydata.append(row[4])
- if 'exact' in TestL3fwd.methods:
- exact_ydata.append(row[4])
-
- if 'lpm' in TestL3fwd.methods:
- ydata.append(lpm_ydata)
- if 'exact' in TestL3fwd.methods:
- ydata.append(exact_ydata)
-
- try:
- image_path = self.plotting.create_bars_plot(
- 'test_perf_l3fwd_4ports_%d_%dRxQ' % (frame_size, queues),
- 'LPM & Exact modes, %dB, %d Rx Queues, 4 ports' % (frame_size, queues),
- TestL3fwd.frame_sizes,
- ydata,
- ylabel='% linerate',
- legend=TestL3fwd.methods)
-
- dts.results_plot_print(image_path)
- except VerifyFailure as e:
- self.logger.error(str(e))
-
- def plot_2_ports(self):
-
- data = self.l3fwd_test_results['data']
-
- cores = []
- for row in data:
- if row[2] not in cores:
- cores.append(row[2])
-
- # Create a plot for each mode for frame size and cores comparison
- for mode in TestL3fwd.methods:
- mode_ydata = []
-
- for core in cores:
- core_ydata = []
- for row in data:
- if row[1] == mode and row[2] == core:
- core_ydata.append(float(row[4]))
-
- mode_ydata.append(core_ydata)
-
- image_path = self.plotting.create_bars_plot(
- 'test_perf_l3fwd_2ports_%s' % mode,
- 'L3fwd %s mode, 2 ports' % mode,
- TestL3fwd.frame_sizes,
- mode_ydata,
- ylabel='% linerate',
- legend=cores)
-
- dts.results_plot_print(image_path, 50)
-
- # If testing only one mode, do nothing else.
- if len(TestL3fwd.methods) == 1:
- return
-
- # Create a plot for 1st core config for mode and frame size comparison
- core = '1S/1C/1T'
-
- ydata = []
- for mode in TestL3fwd.methods:
- mode_ydata = []
- for frame_size in TestL3fwd.frame_sizes:
- for row in data:
- if row[2] == core and row[0] == frame_size and \
- row[1] == mode:
- mode_ydata.append(float(row[4]))
-
- ydata.append(mode_ydata)
-
- str_frame_sizes = []
- for frame_size in TestL3fwd.frame_sizes:
- str_frame_sizes.append(str(frame_size))
-
- image_path = self.plotting.create_bars_plot(
- 'test_perf_l3fwd_2ports_1S_1C_1T',
- 'L3fwd 1S/1C/1T cores, 2 ports',
- TestL3fwd.frame_sizes,
- ydata,
- ylabel='% linerate',
- legend=TestL3fwd.methods)
-
- dts.results_plot_print(image_path)
-
def set_up_all(self):
"""
Run at the start of each test suite.
@@ -513,7 +359,6 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
if number_sockets >= int(test_case[1].split('/')[0][0]):
self.get_throughput(frame_size, *test_case)
- self.plot_4_ports()
dts.results_table_print()
def test_perf_l3fwd_2ports(self):
@@ -615,7 +460,6 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
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):
--
1.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dts] [PATCH 2/2] l3fwd: delete plot funtions
2015-12-31 8:25 ` [dts] [PATCH 2/2] l3fwd: delete plot funtions Ding Heng
@ 2015-12-31 8:36 ` Xu, Qian Q
0 siblings, 0 replies; 4+ messages in thread
From: Xu, Qian Q @ 2015-12-31 8:36 UTC (permalink / raw)
To: Ding, HengX, dts; +Cc: Ding, HengX
Thanks
Qian
-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Ding Heng
Sent: Thursday, December 31, 2015 4:26 PM
To: dts@dpdk.org
Cc: Ding, HengX
Subject: [dts] [PATCH 2/2] l3fwd: delete plot funtions
Signed-off-by: Ding Heng <hengx.ding@intel.com>
diff --git a/tests/TestSuite_l3fwd.py b/tests/TestSuite_l3fwd.py index e785b8b..63d6acd 100644
--- a/tests/TestSuite_l3fwd.py
+++ b/tests/TestSuite_l3fwd.py
@@ -95,7 +95,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
"{IPv4(13,101,0,0), 24, P3}",
]
- frame_sizes = [64, 128, 256, 512, 2048] # 65, 128
+ frame_sizes = [64]#, 128, 256, 512, 2048] # 65, 128
Qian: Pls check the line, 64]#???
methods = ['lpm', 'exact']
#
@@ -121,160 +121,6 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
# Test cases.
#
- def plot_4_ports(self):
-
- data = self.l3fwd_test_results['data']
-
- # Create a plot for each number of queues for frame size and mode comparison
- cores = '1S/1C/1T'
- for queues in TestL3fwd.queues_4_ports:
- ydata = []
- lpm_ydata = []
- exact_ydata = []
- for frame_size in TestL3fwd.frame_sizes:
- for row in data:
- if row[1] * 4 == queues and row[2] == cores and \
- row[0] == frame_size:
- if len(TestL3fwd.methods) == 2:
- lpm_ydata.append(row[4])
- exact_ydata.append(row[6])
- else:
- if 'lpm' in TestL3fwd.methods:
- lpm_ydata.append(row[4])
- if 'exact' in TestL3fwd.methods:
- exact_ydata.append(row[4])
-
- if 'lpm' in TestL3fwd.methods:
- ydata.append(lpm_ydata)
- if 'exact' in TestL3fwd.methods:
- ydata.append(exact_ydata)
-
- if len(ydata[0]) == 0:
- self.logger.warning('No data for plotting 1S/1C/1T')
- break
- else:
- try:
- image_path = self.plotting.create_bars_plot(
- 'test_perf_l3fwd_4ports_1S_1C_1T_%dRxQ' % queues,
- 'LPM & Exact modes, 1S/1C/1T, %d Rx Queues, 4 ports' % queues,
- TestL3fwd.frame_sizes,
- ydata,
- ylabel='% linerate',
- legend=TestL3fwd.methods)
-
- dts.results_plot_print(image_path, 50)
- except VerifyFailure as e:
- self.logger.error(str(e))
-
- # Create a plot for each number of queues for core config and mode comparison
- frame_size = TestL3fwd.frame_sizes[0] # Frame size fixed to the first selected
- for queues in TestL3fwd.queues_4_ports:
-
- cores = []
- for row in data:
- if row[2] not in cores and \
- row[1] * 4 == queues:
- cores.append(row[2])
-
- ydata = []
- lpm_ydata = []
- exact_ydata = []
-
- for core in cores:
- for row in data:
- if row[1] * 4 == queues and \
- row[2] == core and \
- row[0] == frame_size:
- if len(TestL3fwd.methods) == 2:
- lpm_ydata.append(row[4])
- exact_ydata.append(row[6])
- else:
- if 'lpm' in TestL3fwd.methods:
- lpm_ydata.append(row[4])
- if 'exact' in TestL3fwd.methods:
- exact_ydata.append(row[4])
-
- if 'lpm' in TestL3fwd.methods:
- ydata.append(lpm_ydata)
- if 'exact' in TestL3fwd.methods:
- ydata.append(exact_ydata)
-
- try:
- image_path = self.plotting.create_bars_plot(
- 'test_perf_l3fwd_4ports_%d_%dRxQ' % (frame_size, queues),
- 'LPM & Exact modes, %dB, %d Rx Queues, 4 ports' % (frame_size, queues),
- TestL3fwd.frame_sizes,
- ydata,
- ylabel='% linerate',
- legend=TestL3fwd.methods)
-
- dts.results_plot_print(image_path)
- except VerifyFailure as e:
- self.logger.error(str(e))
-
- def plot_2_ports(self):
-
- data = self.l3fwd_test_results['data']
-
- cores = []
- for row in data:
- if row[2] not in cores:
- cores.append(row[2])
-
- # Create a plot for each mode for frame size and cores comparison
- for mode in TestL3fwd.methods:
- mode_ydata = []
-
- for core in cores:
- core_ydata = []
- for row in data:
- if row[1] == mode and row[2] == core:
- core_ydata.append(float(row[4]))
-
- mode_ydata.append(core_ydata)
-
- image_path = self.plotting.create_bars_plot(
- 'test_perf_l3fwd_2ports_%s' % mode,
- 'L3fwd %s mode, 2 ports' % mode,
- TestL3fwd.frame_sizes,
- mode_ydata,
- ylabel='% linerate',
- legend=cores)
-
- dts.results_plot_print(image_path, 50)
-
- # If testing only one mode, do nothing else.
- if len(TestL3fwd.methods) == 1:
- return
-
- # Create a plot for 1st core config for mode and frame size comparison
- core = '1S/1C/1T'
-
- ydata = []
- for mode in TestL3fwd.methods:
- mode_ydata = []
- for frame_size in TestL3fwd.frame_sizes:
- for row in data:
- if row[2] == core and row[0] == frame_size and \
- row[1] == mode:
- mode_ydata.append(float(row[4]))
-
- ydata.append(mode_ydata)
-
- str_frame_sizes = []
- for frame_size in TestL3fwd.frame_sizes:
- str_frame_sizes.append(str(frame_size))
-
- image_path = self.plotting.create_bars_plot(
- 'test_perf_l3fwd_2ports_1S_1C_1T',
- 'L3fwd 1S/1C/1T cores, 2 ports',
- TestL3fwd.frame_sizes,
- ydata,
- ylabel='% linerate',
- legend=TestL3fwd.methods)
-
- dts.results_plot_print(image_path)
-
def set_up_all(self):
"""
Run at the start of each test suite.
@@ -513,7 +359,6 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
if number_sockets >= int(test_case[1].split('/')[0][0]):
self.get_throughput(frame_size, *test_case)
- self.plot_4_ports()
dts.results_table_print()
def test_perf_l3fwd_2ports(self):
@@ -615,7 +460,6 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
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):
--
1.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dts] [PATCH 1/2] l3fwd: enable rfc2544 case and change result format for generate report
2015-12-31 8:25 [dts] [PATCH 1/2] l3fwd: enable rfc2544 case and change result format for generate report Ding Heng
2015-12-31 8:25 ` [dts] [PATCH 2/2] l3fwd: delete plot funtions Ding Heng
@ 2016-01-06 1:04 ` Liu, Yong
1 sibling, 0 replies; 4+ messages in thread
From: Liu, Yong @ 2016-01-06 1:04 UTC (permalink / raw)
To: Ding Heng, dts
Applied, thanks.
On 12/31/2015 04:25 PM, Ding Heng wrote:
> Signed-off-by: Ding Heng <hengx.ding@intel.com>
>
> 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/framework/utils.py b/framework/utils.py
> index dd45e9e..48bba0e 100644
> --- a/framework/utils.py
> +++ b/framework/utils.py
> @@ -98,3 +98,13 @@ def remove_old_rsa_key(crb, ip):
> remove_rsa_key_cmd = "sed -i '/^%s/d' %s" % \
> (ip.strip(), rsa_key_path)
> crb.send_expect(remove_rsa_key_cmd, "# ")
> +
> +def human_read_number(num):
> + if num > 1000000:
> + num /= 1000000
> + return str(num) + "M"
> + elif num > 1000:
> + num /= 1000
> + return str(num) + "K"
> + else:
> + return str(num)
> diff --git a/tests/TestSuite_l3fwd.py b/tests/TestSuite_l3fwd.py
> index 0e09256..e785b8b 100644
> --- a/tests/TestSuite_l3fwd.py
> +++ b/tests/TestSuite_l3fwd.py
> @@ -42,28 +42,29 @@ from test_case import TestCase
> from exception import VerifyFailure
> from settings import HEADER_SIZE
> from etgen import IxiaPacketGenerator
> +from utils import *
>
> class TestL3fwd(TestCase,IxiaPacketGenerator):
>
> path = "./examples/l3fwd/build/"
>
> - test_cases_2_ports = {"1S/1C/1T": "%s -c %s -n %d -- -p %s --config '(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})'",
> + test_cases_2_ports = {"1S/1C/1T": "%s -c %s -n %d -- -p %s --config '(P0,0,C{1.1.0}), (P1,0,C{1.1.0})' --enable-jumbo --max-pkt-len 4096",
> + #"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})' --enable-jumbo --max-pkt-len 4096",
> + #"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})'",
> }
>
> test_cases_4_ports = [(1, "1S/1C/1T",
> - "%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 --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.0}),(P2,0,C{1.1.0}),(P3,0,C{1.1.0})' --enable-jumbo --max-pkt-len 4096"),
> + #(1, "1S/2C/2T",
> + # "%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 --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 --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})'"),
> + "%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})' --enable-jumbo --max-pkt-len 4096"),
> + #(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 --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})'"),
> ]
>
> queues_4_ports = []
> @@ -94,7 +95,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
> "{IPv4(13,101,0,0), 24, P3}",
> ]
>
> - frame_sizes = [64,128] # 65, 128
> + frame_sizes = [64, 128, 256, 512, 2048] # 65, 128
> methods = ['lpm', 'exact']
>
> #
> @@ -202,7 +203,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
> image_path = self.plotting.create_bars_plot(
> 'test_perf_l3fwd_4ports_%d_%dRxQ' % (frame_size, queues),
> 'LPM & Exact modes, %dB, %d Rx Queues, 4 ports' % (frame_size, queues),
> - cores,
> + TestL3fwd.frame_sizes,
> ydata,
> ylabel='% linerate',
> legend=TestL3fwd.methods)
> @@ -227,7 +228,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 +256,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)
> @@ -391,7 +392,6 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
> output_pattern = re.compile("P([0123]),([0123]),(C\{\d.\d.\d\})")
> pat2 = re.compile("C\{\d")
> repl1 = "C{" + str(self.port_socket)
> -
>
> bps = dict()
> pps = dict()
> @@ -449,7 +449,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
> # stop l3fwd
> self.dut.send_expect("^C", "#")
>
> - data_row = [frame_size, rx_queues_per_port, cores_config]
> + data_row = [frame_size, method, cores_config, rx_queues_per_port]
> for method in TestL3fwd.methods:
> data_row.append(pps[method])
> data_row.append(pct[method])
> @@ -474,7 +474,7 @@ class TestL3fwd(TestCase,IxiaPacketGenerator):
> # Verify that enough ports are available
> self.verify(len(ports) >= 4, "Insufficient ports for speed testing")
>
> - header_row = ["Frame size", "RX Queues/NIC Port", "S/C/T"]
> + header_row = ["Frame size", "mode", "S/C/T", "RX Queues/NIC Port"]
>
> for method in TestL3fwd.methods:
> header_row.append('%s Mpps' % method)
> @@ -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,116 @@ 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", "zero_loss_throughput(Mpps)"]
> + 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", "#")
> + linerate = self.wirespeed(self.nic, frame_size, 2)
> + zero_loss_throughput = (linerate * zero_loss_rate) / 100
> +
> + tx_pkts = human_read_number(tx_pkts)
> + rx_pkts = human_read_number(rx_pkts)
> + loss_pkts = human_read_number(loss_pkts)
> +
> + data_row = [frame_size, mode, cores, tx_pkts, rx_pkts, loss_pkts, zero_loss_rate, zero_loss_throughput]
> + 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)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-06 1:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-31 8:25 [dts] [PATCH 1/2] l3fwd: enable rfc2544 case and change result format for generate report Ding Heng
2015-12-31 8:25 ` [dts] [PATCH 2/2] l3fwd: delete plot funtions Ding Heng
2015-12-31 8:36 ` Xu, Qian Q
2016-01-06 1:04 ` [dts] [PATCH 1/2] l3fwd: enable rfc2544 case and change result format for generate report Liu, Yong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).