From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 415ADA04B7; Wed, 14 Oct 2020 04:14:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB7571DB82; Wed, 14 Oct 2020 04:14:46 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 239551DA8D for ; Wed, 14 Oct 2020 04:14:44 +0200 (CEST) IronPort-SDR: jP/uw5nUoBeWmQDrmOsP6MwAdtqH/Lz1IXYGyPK2Nq1pH8czkiBukPxMH3UhwSQBFwbHxIy5Pm /Cmb+sK29Z4g== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="153853631" X-IronPort-AV: E=Sophos;i="5.77,373,1596524400"; d="scan'208";a="153853631" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 19:14:37 -0700 IronPort-SDR: k0xEUrRXlSqb/Q+/7+F6ymfRVDLtinTwEJ+Reg9l82wqTJC4NY+mKogOKYP/HO8dX/ypa4OpyP pyVzG/HeUc/A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,373,1596524400"; d="scan'208";a="357234158" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.174]) by orsmga007.jf.intel.com with ESMTP; 13 Oct 2020 19:14:35 -0700 From: LihongX Ma To: dts@dpdk.org Cc: yuan.peng@intel.com, LihongX Ma Date: Wed, 14 Oct 2020 02:40:05 +0800 Message-Id: <1602614405-20002-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] tests/softnic: optimization 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" - remove useless code - modify the fwd method according to plan - use different pcap to configure stream Signed-off-by: LihongX Ma --- 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