From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7B477A054F; Wed, 1 Jun 2022 08:22:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1EC3640694; Wed, 1 Jun 2022 08:22:26 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 7E13940689 for ; Wed, 1 Jun 2022 08:22:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654064544; x=1685600544; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ySaMajsSpFrZso66e80otMz6QG8+lLVAqAznDAE6gds=; b=bqu8LQ9vi+MGodgTbM+NO60ZXOiIxELPJe/WoMNCwuZFK4jQTn/J7jwl 2slan2tuRpMUTT8fIRq2t1cXFjJTX2Lz82BDlvK5HH9/azI1pmnRRRYMW seiGGU9wu9sVTHv8Af9QzRIRKD3EgDpTJ5nz2dW1PmEaVZzfotuCLDL1V EFIiX/YLPoT4V2h8QLbzG+5+NyP+gEDh2fOcx5d8FFXyNysZNRitGhpsa wvkT0PFG0c3got0RBFRThMLYdZ/lE8BIXGNhGc4celVnSdmj5BIE3spBh m54y79Zt1Mxf+KwLSsaW8xA/ptk9kdVU1PHZ7n6FmwQBUR/oC/sf7RsN6 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10364"; a="255356904" X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="255356904" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 23:22:23 -0700 X-IronPort-AV: E=Sophos;i="5.91,266,1647327600"; d="scan'208";a="823610013" Received: from shwdenpg560.ccr.corp.intel.com ([10.253.109.11]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 23:22:22 -0700 From: "Li, WeiyuanX" To: dts@dpdk.org, yuan.peng@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V1 1/2] tests/kernelpf_iavf: modify script VLAN filter enable requires a port VLAN is assigned Date: Wed, 1 Jun 2022 14:22:10 +0800 Message-Id: <20220601062211.646-1-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.34.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 From: Weiyuan Li 1. Modify script VLAN filter enable requires a port VLAN is assigned. 2. tcpdump timeout, increase the '-nn' to skip the DNS reverse domain name resolution operation. 3. Add failure processing repair sometimes failed to execute command 'ip link set'. Signed-off-by: Weiyuan Li --- tests/TestSuite_kernelpf_iavf.py | 41 ++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index bb20e687..9391b4b0 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2019 Intel Corporation +# Copyright(c) 2022 Intel Corporation # """ @@ -206,13 +206,24 @@ class TestKernelpfIavf(TestCase): self.vm_testpmd.execute_cmd("stop") self.vm_testpmd.execute_cmd("set fwd txonly") self.tester.send_expect("rm -f tcpdump.pcap", "#") - self.tester.send_expect("tcpdump -i %s 2>tcpdump.out &" % self.tester_intf, "#") + self.tester.send_expect( + "tcpdump -nn -i %s 2>tcpdump.out &" % self.tester_intf, "#" + ) self.vm_testpmd.execute_cmd("start") time.sleep(1) self.vm_testpmd.execute_cmd("stop") self.tester.send_expect("killall tcpdump", "#") time.sleep(1) - cap_packet = self.tester.send_expect("cat tcpdump.out", "#", 30) + retry_times = 10 + while retry_times: + with open("/root/tcpdump.out", "r") as files: + for fl in files: + if "packet" in fl: + break + retry_times -= 1 + cap_packet = self.tester.send_expect( + "cat tcpdump.out | grep 'packet'", "# ", 30 + ) stats = self.vm_testpmd.get_pmd_stats(0) cap_tcp_num = re.findall("(\d+) packets", cap_packet) nums = sum(map(int, cap_tcp_num)) @@ -355,9 +366,13 @@ class TestKernelpfIavf(TestCase): vf can receive packet with right vlan id, can't receive wrong vlan id packet """ random_vlan = random.randint(1, MAX_VLAN) - self.dut.send_expect( + out = self.dut.send_expect( "ip link set %s vf 0 vlan %s" % (self.host_intf, random_vlan), "# " ) + if "Resource temporarily unavailable" in out: + self.dut.send_expect( + "ip link set %s vf 0 vlan %s" % (self.host_intf, random_vlan), "# " + ) out = self.dut.send_expect("ip link show %s" % self.host_intf, "# ") self.verify("vlan %d" % random_vlan in out, "Failed to add pvid on VF0") @@ -380,14 +395,17 @@ class TestKernelpfIavf(TestCase): self.verify(len(receive_pkt) == 1, "tester received wrong vlan packet!!!") # remove vlan - self.vm_testpmd.execute_cmd("stop") - self.vm_testpmd.execute_cmd("port stop all") + self.vm_testpmd.quit() self.dut.send_expect("ip link set %s vf 0 vlan 0" % self.host_intf, "# ") out = self.dut.send_expect("ip link show %s" % self.host_intf, "# ") self.verify("vlan %d" % random_vlan not in out, "Failed to remove pvid on VF0") # send packet without vlan - self.vm_testpmd.execute_cmd("port reset 0") - self.vm_testpmd.execute_cmd("port start all") + self.vm_testpmd.start_testpmd("all") + self.vm_testpmd.execute_cmd("set fwd mac") + self.vm_testpmd.execute_cmd("set verbose 1") + self.vm_testpmd.execute_cmd("vlan set filter on 0") + self.vm_testpmd.execute_cmd("vlan set strip on 0") + self.vm_testpmd.execute_cmd("rx_vlan add 10 0") self.vm_testpmd.execute_cmd("start") out = self.send_and_getout(vlan=0, pkt_type="UDP") self.verify(self.vf_mac in out, "Not received packet without vlan!!!") @@ -429,6 +447,7 @@ class TestKernelpfIavf(TestCase): self.vm_testpmd.execute_cmd("set verbose 1") self.vm_testpmd.execute_cmd("vlan set filter on 0") self.vm_testpmd.execute_cmd("vlan set strip on 0") + self.vm_testpmd.execute_cmd("rx_vlan add 10 0") self.vm_testpmd.execute_cmd("start") # send packet without vlan, vf can receive packet out = self.send_and_getout(pkt_type="UDP") @@ -543,6 +562,7 @@ class TestKernelpfIavf(TestCase): self.vm_testpmd.execute_cmd("port start all") self.vm_testpmd.execute_cmd("set fwd mac") self.vm_testpmd.execute_cmd("set verbose 1") + self.vm_testpmd.execute_cmd("rx_vlan add 10 0") self.vm_testpmd.execute_cmd("start") # error vlan id @@ -1050,10 +1070,7 @@ class TestKernelpfIavf(TestCase): self.scapy_send_packet(self.vf_mac, self.tester_intf, vlan_flags=True, count=10) out = self.vm_dut.get_session_output() packets = len(re.findall("received 1 packets", out)) - if self.kdriver == "i40e" and self.driver_version < "2.13.10": - self.verify(packets == 10, "Not receive expected packet") - else: - self.verify(packets == 0, "Receive expected packet") + self.verify(packets == 10, "Receive expected packet") # send 10 untagged packets, and check 10 untagged packets received self.scapy_send_packet(self.vf_mac, self.tester_intf, count=10) -- 2.17.1