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 1609AA0552; Fri, 26 Aug 2022 04:43:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DEEB427F5; Fri, 26 Aug 2022 04:43:15 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 8213D400D6 for ; Fri, 26 Aug 2022 04:43:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661481793; x=1693017793; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ihE0LCeDAzycaxv80F0uzQargRVwyS39cm8g6IHN2ZI=; b=GAn7SofxUZnfYFOpNc3QDDkd/ToC7q82kuALskyUsIpAiCl0PVBaSlqz 9zz7zM1fuUcfcVEHFfgJjJMqE6bfl/a3MlIGewhrxSEDMcFFTJeCc8uth F65nPJHUBHRj8VcjQYZ8PMyIljaX0Ugp3HUwQ900vpct52eiek29Hq169 +ijTPb7f8VP+HLU6oHYiKSRtXwcIdNtWWFPE4BshLsxShzhVAd9DyuOY9 2oHGbnRwoSD4ey0dT8caHee8u6FWGJLkfRKAbwUhTMQ6+kYxXOKKs6H00 fkzX7heRxIxpMeCT7QIWU1FGpZZJ6D29+1qGcabTJUsmBxDclddRoxWXH w==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="295187355" X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="295187355" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 19:43:12 -0700 X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="671275194" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 19:43:11 -0700 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Jiale Song Subject: [dts][PATCH V2 04/10] tests/ice_advanced_iavf_rss: update dts code for dpdk csum change Date: Fri, 26 Aug 2022 10:43:02 +0800 Message-Id: <20220826024308.17447-4-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220826024308.17447-1-weiyuanx.li@intel.com> References: <20220826024308.17447-1-weiyuanx.li@intel.com> 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 According to dpdk commit 9b4ea7ae77fa(app/testpmd: revert MAC update in checksum forwarding) modify the script adapt to this chagne. 1. Modify VF case to enable promisc. 2. Modify PF case to send packet dst mac is random. Signed-off-by: Weiyuan Li --- Tested-by: Jiale Song < songx.jiale@intel.com> v2: -modify the dst mac variable to 'dst_mac' -Added enable promisc model tests/TestSuite_ice_advanced_iavf_rss.py | 74 +++++++++++++++++++----- 1 file changed, 58 insertions(+), 16 deletions(-) diff --git a/tests/TestSuite_ice_advanced_iavf_rss.py b/tests/TestSuite_ice_advanced_iavf_rss.py index e560c9e6..bed1d1df 100644 --- a/tests/TestSuite_ice_advanced_iavf_rss.py +++ b/tests/TestSuite_ice_advanced_iavf_rss.py @@ -5781,10 +5781,34 @@ class AdvancedIavfRSSTest(TestCase): self.vf_flag = False self.create_iavf() + def ip_link_set(self, host_intf=None, cmd=None, port=None, types=None, value=0): + if host_intf is None or cmd is None or port is None or types is None: + return + set_command = f"ip link set {host_intf} {cmd} {port} {types} {value}" + out = self.dut.send_expect(set_command, "# ") + if "RTNETLINK answers: Invalid argument" in out: + self.dut.send_expect(set_command, "# ") + def set_up(self): """ Run before each test case. """ + if self.running_case == "test_flow_rule_not_impact_rx_tx_chksum": + self.host_intf_0 = self.dut.ports_info[self.used_dut_port]["intf"] + self.ip_link_set( + host_intf=self.host_intf_0, + cmd="vf", + port=0, + types="trust", + value="on", + ) + self.ip_link_set( + host_intf=self.host_intf_0, + cmd="vf", + port=0, + types="spoofchk", + value="off", + ) self.pkt = Packet() self.pmd_output = PmdOutput(self.dut) self.launch_testpmd() @@ -6370,7 +6394,7 @@ class AdvancedIavfRSSTest(TestCase): expect_chksum = dict() checksum_pattern = re.compile("chksum.*=.*(0x[0-9a-z]+)") self.tester.send_expect("scapy", ">>> ") - sniff_src = self.dut.get_mac_address(self.dut_ports[0]) + sniff_src = "52:00:00:00:00:00" for pkt in expect_pkts: self.tester.send_expect("p = %s" % expect_pkts[pkt], ">>>") out = self.tester.send_expect("p.show2()", ">>>") @@ -6382,7 +6406,7 @@ class AdvancedIavfRSSTest(TestCase): inst = self.tester.tcpdump_sniff_packets( intf=self.tester_iface0, count=len(pkts), - filters=[{"layer": "ether", "config": {"src": vf0_mac}}], + filters=[{"layer": "ether", "config": {"src": sniff_src}}], ) out = self.rssprocess.send_pkt_get_output(pkts=pkts[pkt]) rece_pkt = self.tester.load_tcpdump_sniff_packets(inst) @@ -6417,24 +6441,26 @@ class AdvancedIavfRSSTest(TestCase): self.pmd_output.execute_cmd("csum set tcp hw 0") self.pmd_output.execute_cmd("csum set sctp hw 0") self.pmd_output.execute_cmd("port start all") + self.pmd_output.execute_cmd("set promisc 0 on") self.pmd_output.execute_cmd("start") + dst_mac = "00:11:22:33:44:56" pkt_list = { - "IP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP(src="192.168.0.1", chksum=0xfff3)/("X"*48)', - "IP/TCP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/TCP(sport=22, chksum=0xfff3)/("X"*48)', - "IP/UDP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/UDP(sport=22, chksum=0x1)/("X"*48)', - "IP/SCTP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/SCTP(sport=22, chksum=0x0)/("X"*48)', - "IPv6/TCP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IPv6()/TCP(sport=22, chksum=0xe38)/("X"*48)', - "IPv6/UDP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IPv6()/UDP(sport=22, chksum=0xe38)/("X"*48)', - "IPv6/SCTP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IPv6()/SCTP(sport=22, chksum=0x0)/("X"*48)', + "IP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IP(src="192.168.0.1", chksum=0xfff3)/("X"*48)', + "IP/TCP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/TCP(sport=22, chksum=0xfff3)/("X"*48)', + "IP/UDP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/UDP(sport=22, chksum=0x1)/("X"*48)', + "IP/SCTP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/SCTP(sport=22, chksum=0x0)/("X"*48)', + "IPv6/TCP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IPv6()/TCP(sport=22, chksum=0xe38)/("X"*48)', + "IPv6/UDP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IPv6()/UDP(sport=22, chksum=0xe38)/("X"*48)', + "IPv6/SCTP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IPv6()/SCTP(sport=22, chksum=0x0)/("X"*48)', } expect_pkt = { - "IP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/("X"*48)', - "IP/TCP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/TCP(sport=22)/("X"*48)', - "IP/UDP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/UDP(sport=22)/("X"*48)', - "IP/SCTP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/SCTP(sport=22)/("X"*48)', - "IPv6/TCP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IPv6()/TCP(sport=22)/("X"*48)', - "IPv6/UDP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IPv6()/UDP(sport=22)/("X"*48)', - "IPv6/SCTP": 'Ether(dst="00:11:22:33:44:55", src="52:00:00:00:00:00")/IPv6()/SCTP(sport=22)/("X"*48)', + "IP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/("X"*48)', + "IP/TCP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/TCP(sport=22)/("X"*48)', + "IP/UDP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/UDP(sport=22)/("X"*48)', + "IP/SCTP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IP(src="192.168.0.1")/SCTP(sport=22)/("X"*48)', + "IPv6/TCP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IPv6()/TCP(sport=22)/("X"*48)', + "IPv6/UDP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IPv6()/UDP(sport=22)/("X"*48)', + "IPv6/SCTP": f'Ether(dst="{dst_mac}", src="52:00:00:00:00:00")/IPv6()/SCTP(sport=22)/("X"*48)', } rule_list = [ "flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-chksum end queues end / end", @@ -6631,6 +6657,22 @@ class AdvancedIavfRSSTest(TestCase): self.dut.send_command("clear port stats all", timeout=1) self.pmd_output.execute_cmd("stop") self.pmd_output.execute_cmd("quit", "#") + if self.running_case == "test_flow_rule_not_impact_rx_tx_chksum": + self.host_intf_0 = self.dut.ports_info[self.used_dut_port]["intf"] + self.ip_link_set( + host_intf=self.host_intf_0, + cmd="vf", + port=0, + types="trust", + value="off", + ) + self.ip_link_set( + host_intf=self.host_intf_0, + cmd="vf", + port=0, + types="spoofchk", + value="on", + ) def tear_down_all(self): self.dut.kill_all() -- 2.25.1