From patchwork Mon Jul 18 02:54:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 113991 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 E708EA0547; Mon, 18 Jul 2022 04:55:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E15FE40F1A; Mon, 18 Jul 2022 04:55:03 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 0DCE240F1A for ; Mon, 18 Jul 2022 04:55:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658112902; x=1689648902; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jv6l9W3NV6ua1X3Qyn2u82FufPwb5+9EDAtmTEx2FNM=; b=BgthZ2psBPD3dAVBGqQ/sAPZ3ysWyt29BS/UjJrPizqdjajBffDfBGq9 1z8hPDHFSxI5RPYB9LpEZABYLs81rVq7Pi1ZK/413VPu/iwELz3GGgxNq X679IbIJJ8dLvsKjyvqN0Tvx2tsCXcGYG4g/vSEn9IudbuS9dLJ5UqSl4 f/PsMsjHXh6yBIo9VfiXE2ITrUIwwYdLzNCiGveAah7HGGWL8PUZALCn6 hv6cRLUcoxIqDAFCkE43wLzKAIDKWxcJkeXfZkc8GaubIsKUNTVOemMNT WOzkvoTwTb3J36OVEkXs75r29fcZhCbNK7KO6clqSyqdZn74rF6rrkZez A==; X-IronPort-AV: E=McAfee;i="6400,9594,10411"; a="311796677" X-IronPort-AV: E=Sophos;i="5.92,280,1650956400"; d="scan'208";a="311796677" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2022 19:55:01 -0700 X-IronPort-AV: E=Sophos;i="5.92,280,1650956400"; d="scan'208";a="624541942" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2022 19:54:59 -0700 From: Weiyuan Li To: dts@dpdk.org, yuan.peng@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V1 01/12] tests/kernelpf_iavf: update dts code for dpdk csum change Date: Mon, 18 Jul 2022 10:54:36 +0800 Message-Id: <20220718025447.13287-1-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 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 --- tests/TestSuite_kernelpf_iavf.py | 46 ++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index d7d17ac4..57944770 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -75,6 +75,14 @@ class TestKernelpfIavf(TestCase): self.flag = "vf-vlan-pruning" self.default_stats = self.dut.get_priv_flags_state(self.host_intf, self.flag) + 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): if self.running_case == "test_vf_mac_filter": @@ -120,6 +128,22 @@ class TestKernelpfIavf(TestCase): "ip link set %s vf 0 mac %s" % (self.host_intf, self.vf_mac), "# " ) + if self.running_case == "test_vf_tso": + 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", + ) try: for port in self.sriov_vfs_port: @@ -656,9 +680,10 @@ class TestKernelpfIavf(TestCase): self.tester.scapy_foreground() time.sleep(5) self.start_tcpdump(self.tester_intf) + vf_mac = "00:01:23:45:67:80" pkt = ( - 'sendp([Ether(dst="%s")/IP(chksum=0x1234)/TCP(flags=0x10,chksum=0x1234)/' - 'Raw(RandString(5214))], iface="%s")' % (self.vf_mac, self.tester_intf) + 'sendp([Ether(dst="%s", src="52:00:00:00:00:00")/IP(chksum=0x1234)/TCP(flags=0x10,chksum=0x1234)/' + 'Raw(RandString(5214))], iface="%s")' % (vf_mac, self.tester_intf) ) self.tester.scapy_append(pkt) self.tester.scapy_execute() @@ -927,6 +952,23 @@ class TestKernelpfIavf(TestCase): self.destroy_vm_env() self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ") + if self.running_case == "test_vf_tso": + 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): """ When the case of this test suite finished, the environment should