From patchwork Tue Aug 30 02:47:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 115639 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 797ECA034C; Tue, 30 Aug 2022 04:47:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 748B940F35; Tue, 30 Aug 2022 04:47:49 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id C52E240F17 for ; Tue, 30 Aug 2022 04:47:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661827667; x=1693363667; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vnmLSOBaxnCHpUMX+LjQEPEZwyzbs3LGiA77yu6BmSY=; b=fxqi31fIP9bKXTymx6hu1/47KTriJojrbVgbAuCv5sMOF4xgUgeL0Ah6 3JYeMKvn7zKBS0nb79A2YxiAKKFSx2zilh3gy7RWi/LTQI7VW7jeFZaFq zHqUHc7Wzzx4cbC4OEPptJ3o3fEJLwREfpplTALR/dyWhTsNVzdNlB0Wt oi9R4W7jsMXMtU+wyfxbms5GODrtyLPTCM0hDYe0KnkX1VYJTR+oNZe6L h70UOw5xUp2ejawASgMAYFwc0xQJx9XU4wl/xVsMU9KzM4NQx9Zg121tA PbvLv5bT6Ylx2Rswh7ejkzJxH1G/DwjX4sXxAUiJ3an5bIPswjjc2zMuB g==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="359024468" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="359024468" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 19:47:42 -0700 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="641181941" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 19:47:41 -0700 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Jiale Song Subject: [dts][PATCH V3 08/10] tests/ice_iavf_fdir: update dts code for dpdk csum change Date: Tue, 30 Aug 2022 10:47:38 +0800 Message-Id: <20220830024740.26250-8-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220830024740.26250-1-weiyuanx.li@intel.com> References: <20220830024740.26250-1-weiyuanx.li@intel.com> MIME-Version: 1.0 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 Signed-off-by: Weiyuan Li Tested-by: Jiale Song < songx.jiale@intel.com> --- Tested-by: Jiale Song < songx.jiale@intel.com> v2: -Enable promisc mode in testpmd v3: -Test plan csum add enable promisc mode tests/TestSuite_ice_iavf_fdir.py | 84 ++++++++++++++++++++++++++++++-- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_ice_iavf_fdir.py b/tests/TestSuite_ice_iavf_fdir.py index a4df6151..1cc71f67 100644 --- a/tests/TestSuite_ice_iavf_fdir.py +++ b/tests/TestSuite_ice_iavf_fdir.py @@ -8401,6 +8401,14 @@ class TestICEIAVFFdir(TestCase): self.dut_file_dir = "/tmp/" self.q_num = TXQ_RXQ_NUMBER + 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. @@ -8422,6 +8430,42 @@ class TestICEIAVFFdir(TestCase): self.sriov_vfs_pf0 = self.dut.ports_info[self.used_dut_port_0]["vfs_port"] self.sriov_vfs_pf1 = self.dut.ports_info[self.used_dut_port_1]["vfs_port"] + self.host_intf_0 = self.dut.ports_info[self.used_dut_port_0]["intf"] + self.host_intf_1 = self.dut.ports_info[self.used_dut_port_0]["intf"] + + if self.running_case in [ + "test_pfcp_vlan_strip_off_sw_checksum", + "test_pfcp_vlan_strip_on_hw_checksum", + ]: + 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.ip_link_set( + host_intf=self.host_intf_1, + cmd="vf", + port=0, + types="trust", + value="on", + ) + self.ip_link_set( + host_intf=self.host_intf_1, + cmd="vf", + port=0, + types="spoofchk", + value="off", + ) + self.dut.send_expect( "ip link set %s vf 0 mac 00:11:22:33:44:55" % self.pf0_intf, "#" ) @@ -10760,6 +10804,7 @@ class TestICEIAVFFdir(TestCase): self.dut.send_expect("csum set ip %s %d" % (hw, port), "testpmd>") self.dut.send_expect("csum set udp %s %d" % (hw, port), "testpmd>") self.dut.send_expect("port start all", "testpmd>") + self.dut.send_expect("set promisc 0 on", "testpmd>") self.dut.send_expect("start", "testpmd>") def get_chksum_values(self, packets_expected): @@ -10791,7 +10836,7 @@ class TestICEIAVFFdir(TestCase): tx_interface = self.tester_iface0 rx_interface = self.tester_iface0 - sniff_src = "00:11:22:33:44:55" + sniff_src = "52:00:00:00:00:00" result = dict() pkt = Packet() chksum = self.get_chksum_values(packets_expected) @@ -10896,7 +10941,7 @@ class TestICEIAVFFdir(TestCase): socket=self.ports_socket, ) vlan = 51 - mac = "00:11:22:33:44:55" + mac = "00:11:22:33:44:56" sndIP = "10.0.0.1" sndIPv6 = "::1" pkts_sent = { @@ -11051,7 +11096,7 @@ class TestICEIAVFFdir(TestCase): socket=self.ports_socket, ) vlan = 51 - mac = "00:11:22:33:44:55" + mac = "00:11:22:33:44:56" sndIP = "10.0.0.1" sndIPv6 = "::1" pkts_sent = { @@ -11610,6 +11655,39 @@ class TestICEIAVFFdir(TestCase): if getattr(self, "session_third", None): self.dut.close_session(self.session_third) + if self.running_case in [ + "test_pfcp_vlan_strip_off_sw_checksum", + "test_pfcp_vlan_strip_on_hw_checksum", + ]: + 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", + ) + self.ip_link_set( + host_intf=self.host_intf_1, + cmd="vf", + port=0, + types="trust", + value="off", + ) + self.ip_link_set( + host_intf=self.host_intf_1, + cmd="vf", + port=0, + types="spoofchk", + value="on", + ) + def tear_down_all(self): self.dut.kill_all() self.destroy_env()