From patchwork Wed Sep 2 15:15:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng, Yuan" X-Patchwork-Id: 76294 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A442BA04B7; Wed, 2 Sep 2020 10:10:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6DD8A4C99; Wed, 2 Sep 2020 10:10:33 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 009D4E07 for ; Wed, 2 Sep 2020 10:10:31 +0200 (CEST) IronPort-SDR: NQtJlhMFMgvDUUT8la6IpGtlu/59MjZR5KegJDAXHbv5EFMrcnWGyMT9FN8XlMkZfM0XqOSsyp k+hm1vxKx/yg== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="175395776" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="175395776" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 01:10:27 -0700 IronPort-SDR: 80QSV3A7gjfXDiCge9Ck7ow0PBOtOnn+zXtKRvre4fqF3Kpnj4UO6pp4NZwS29d5X382391XvX Y2Uk8bnwds9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="477541148" Received: from npg_dpdk_nic_yuanpeng_tester62.sh.intel.com ([10.67.119.61]) by orsmga005.jf.intel.com with ESMTP; 02 Sep 2020 01:10:25 -0700 From: Peng Yuan To: dts@dpdk.org Cc: Peng Yuan Date: Wed, 2 Sep 2020 15:15:13 +0000 Message-Id: <1599059713-44254-1-git-send-email-yuan.peng@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH]tests: change packet configuration 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" change packet configuration to fix traffic error. add eal_param to adapt the tester and dut on the same server senario. get driver type from config file. Signed-off-by: Peng Yuan diff --git a/tests/TestSuite_softnic.py b/tests/TestSuite_softnic.py index c6ba6b9..7752546 100644 --- a/tests/TestSuite_softnic.py +++ b/tests/TestSuite_softnic.py @@ -75,7 +75,8 @@ class TestSoftnic(TestCase): self.dut.session.copy_file_to(self.firmware, self.root_path) self.dut.session.copy_file_to(self.tm_firmware, self.root_path) self.dut.session.copy_file_to(self.nat_firmware, self.root_path) - self.cmd = "./%s/app/testpmd -c 0x7 -s 0x4 -n 4 --vdev 'net_softnic0,firmware=/tmp/%s,cpu_id=1,conn_port=8086' -- -i --forward-mode=softnic --portmask=0x2" + self.eal_param = " -w %s" % self.dut.ports_info[0]['pci'] + self.cmd = "./%s/app/testpmd -c 0x7 -s 0x4 -n 4 %s --vdev 'net_softnic0,firmware=/tmp/%s,cpu_id=1,conn_port=8086' -- -i --forward-mode=softnic --portmask=0x2" # get dts output path if self.logger.log_path.startswith(os.sep): self.output_path = self.logger.log_path @@ -90,7 +91,7 @@ class TestSoftnic(TestCase): 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('igb_uio', [ports[0]]) + self.dut.bind_interfaces_linux(self.drivername, [ports[0]]) def set_up(self): """ @@ -106,7 +107,7 @@ class TestSoftnic(TestCase): # 10G nic pps(M) expect_pps = [14, 8, 4, 2, 1, 0.9, 0.8] - self.dut.send_expect(self.cmd % (self.target, 'firmware.cli'), "testpmd>", timeout=300) + self.dut.send_expect(self.cmd % (self.target, self.eal_param, 'firmware.cli'), "testpmd>", timeout=300) self.dut.send_expect("set fwd macswap", "testpmd>") self.dut.send_expect("start", "testpmd>") rx_port = self.tester.get_local_port(0) @@ -116,7 +117,7 @@ class TestSoftnic(TestCase): payload_size = frame - self.headers_size tgen_input = [] pcap = os.sep.join([self.output_path, "test.pcap"]) - pkt = "Ether(dst='%s')/IP()/UDP()/Raw('x'*%d)" % (self.dmac, payload_size) + pkt = "Ether(dst='%s')/IP()/UDP()/Raw(load='x'*%d)" % (self.dmac, payload_size) self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, pkt)) tgen_input.append((tx_port, rx_port, pcap)) self.tester.scapy_execute() @@ -132,11 +133,11 @@ class TestSoftnic(TestCase): def test_perf_shaping_for_pipe(self): self.change_config_file('tm_firmware.cli') - self.dut.send_expect(self.cmd % (self.target, 'tm_firmware.cli'), "testpmd> ", timeout=800) + self.dut.send_expect(self.cmd % (self.target, 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('x'*(64 - %s))", "Ether(dst='%s')/IP(dst='100.0.15.255')/UDP()/Raw('x'*(64 - %s))", "Ether(dst='%s')/IP(dst='100.0.4.0')/UDP()/Raw('x'*(64 - %s))"] + 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))"] except_bps_range = [1700000, 2000000] for i in range(3): @@ -169,7 +170,7 @@ class TestSoftnic(TestCase): for t in pkt_type: for i in range(2): self.dut.send_expect("sed -i -e '12c table action profile AP0 ipv4 offset 270 fwd nat %s proto %s' %s" % (pkt_location[i], t, self.root_path + 'nat_firmware.cli'), "#") - self.dut.send_expect(self.cmd % (self.target, 'nat_firmware.cli'), "testpmd>", timeout=60) + self.dut.send_expect(self.cmd % (self.target, self.eal_param, 'nat_firmware.cli'), "testpmd>", timeout=60) self.dut.send_expect("start", "testpmd>") # src ip tcp for j in range(2): @@ -182,9 +183,9 @@ class TestSoftnic(TestCase): self.tester.scapy_foreground() pkt = "Ether(dst='%s')/IP(dst='%s')/" % (self.dmac, ip) if pkt_type == 'tcp': - pkt = pkt + "TCP()/Raw('x'*20)" + pkt = pkt + "TCP()/Raw(load='x'*20)" else: - pkt = pkt + "UDP()/Raw('x'*20)" + pkt = pkt + "UDP()/Raw(load='x'*20)" self.tester.scapy_append('sendp([%s], iface="%s")' % (pkt, self.txItf)) self.start_tcpdump(self.txItf)