* [dts] [PATCH V1] tests/softnic: optimization suite
@ 2020-10-13 18:40 LihongX Ma
2020-10-22 6:34 ` Tu, Lijuan
0 siblings, 1 reply; 2+ messages in thread
From: LihongX Ma @ 2020-10-13 18:40 UTC (permalink / raw)
To: dts; +Cc: yuan.peng, LihongX Ma
- remove useless code
- modify the fwd method according to plan
- use different pcap to configure stream
Signed-off-by: LihongX Ma <lihongx.ma@intel.com>
---
tests/TestSuite_softnic.py | 30 ++++++++----------------------
1 file changed, 8 insertions(+), 22 deletions(-)
diff --git a/tests/TestSuite_softnic.py b/tests/TestSuite_softnic.py
index 119d7a8..d0fb419 100644
--- a/tests/TestSuite_softnic.py
+++ b/tests/TestSuite_softnic.py
@@ -87,11 +87,6 @@ class TestSoftnic(TestCase):
self.output_path = os.sep.join([cur_path, self.logger.log_path])
# create an instance to set stream field setting
self.pktgen_helper = PacketGeneratorHelper()
- self.dut.restore_interfaces()
- self.used_dut_port = self.dut_ports[1]
- self.host_intf = self.dut.ports_info[self.used_dut_port]['intf']
- out = self.dut.send_expect('ethtool %s' % self.host_intf, '#')
- self.speed = re.findall('Supported link modes: (\d*)', out)[0]
self.dut.bind_interfaces_linux(self.drivername, [ports[0]])
def set_up(self):
@@ -109,7 +104,6 @@ class TestSoftnic(TestCase):
expect_pps = [14, 8, 4, 2, 1, 0.9, 0.8]
self.dut.send_expect(self.cmd % (self.path, self.eal_param, 'firmware.cli'), "testpmd>", timeout=800)
- self.dut.send_expect("set fwd macswap", "testpmd>")
self.dut.send_expect("start", "testpmd>")
rx_port = self.tester.get_local_port(0)
tx_port = self.tester.get_local_port(0)
@@ -135,7 +129,6 @@ class TestSoftnic(TestCase):
def test_perf_shaping_for_pipe(self):
self.change_config_file('tm_firmware.cli')
self.dut.send_expect(self.cmd % (self.path, self.eal_param, 'tm_firmware.cli'), "testpmd> ", timeout=800)
- self.dut.send_expect("set fwd macswap", "testpmd>")
self.dut.send_expect("start", "testpmd>")
rx_port = self.tester.get_local_port(0)
pkts = ["Ether(dst='%s')/IP(dst='100.0.0.0')/UDP()/Raw(load='x'*(64 - %s))", "Ether(dst='%s')/IP(dst='100.0.15.255')/UDP()/Raw(load='x'*(64 - %s))", "Ether(dst='%s')/IP(dst='100.0.4.0')/UDP()/Raw(load='x'*(64 - %s))"]
@@ -146,16 +139,19 @@ class TestSoftnic(TestCase):
pcap = os.sep.join([self.output_path, "test.pcap"])
pkt = pkts[i] % (self.dmac, self.headers_size)
self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, pkt))
- tgen_input.append((rx_port, rx_port, pcap))
+ self.tester.scapy_execute()
if i == 2:
- vm_config = self.set_fields_ip()
+ for j in range(16):
+ pk = "Ether(dst='%s')/IP(dst='100.0.15.%d')/UDP()/Raw(load='x'*(64 - %s))" % (self.dmac, j, self.headers_size)
+ self.tester.scapy_append('wrpcap("%s/test_%d.pcap", [%s])' % (self.output_path, j, pk))
+ self.tester.scapy_execute()
+ tgen_input.append((rx_port, rx_port, "%s/test_%d.pcap" % (self.output_path, j)))
else:
- vm_config = self.set_fields()
- self.tester.scapy_execute()
+ tgen_input.append((rx_port, rx_port, pcap))
# clear streams before add new streams
self.tester.pktgen.clear_streams()
# run packet generator
- streams = self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 100, vm_config, self.tester.pktgen)
+ streams = self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 100, None, self.tester.pktgen)
bps, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)
if i == 2:
self.verify(except_bps_range[1]*16 > bps > except_bps_range[0]*16, 'No traffic detected')
@@ -205,16 +201,6 @@ class TestSoftnic(TestCase):
self.tester.send_expect("tcpdump -A -nn -e -vv -w getPackageByTcpdump.cap -i %s 2> /dev/null& " % self.txItf, "#")
time.sleep(4)
- def set_fields(self):
- fields_config = {
- 'ip': {'dst': {'range': 1, 'action': 'inc'}, }, }
- return fields_config
-
- def set_fields_ip(self):
- fields_config = {
- 'ip': {'dst': {'range': 16, 'action': 'inc'}, }, }
- return fields_config
-
def tear_down(self):
"""
Run after each test case.
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V1] tests/softnic: optimization suite
2020-10-13 18:40 [dts] [PATCH V1] tests/softnic: optimization suite LihongX Ma
@ 2020-10-22 6:34 ` Tu, Lijuan
0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-10-22 6:34 UTC (permalink / raw)
To: Ma, LihongX, dts; +Cc: Peng, Yuan, Ma, LihongX
> - remove useless code
> - modify the fwd method according to plan
> - use different pcap to configure stream
>
> Signed-off-by: LihongX Ma <lihongx.ma@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-22 6:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 18:40 [dts] [PATCH V1] tests/softnic: optimization suite LihongX Ma
2020-10-22 6:34 ` Tu, Lijuan
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).