From patchwork Tue Jul 5 07:18:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 113668 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 98C92A0542; Tue, 5 Jul 2022 09:18:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FDFF4021D; Tue, 5 Jul 2022 09:18:44 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id B4680400D7 for ; Tue, 5 Jul 2022 09:18:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657005522; x=1688541522; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5BjNO5MPhvWOR4RsT5lNYowsmWJzIibk1NiHYa7ZZwM=; b=mQfH5Pzqxw+ZeuHpq6/yx/War7zPP64ILV4NBusP2YHRvp7zDgx3uWnY DrdNrojo5SZ8rfAW9OLz8NEcCgDihd8bbDPNwX0WuApRXP2RLhLgyeTu9 n5pCHyIScGo1enFm0F48c383IIFnN5CpRryHe5HzWXLcYeKFN8fL36Beg lQYrWVgdKGsJKakDmr2eyDWu3WjMndtcRib988EJLZsfiG6X45yFC7N1f 2WwaF9BhQtGd3G+TcIVbsJnRS4G9ZOF90dMIsFeHC5kvZJjPSIhxU93EL knuP7rFmSba1qef87Rx9lYa7jL6OqFMmUHlIFCXujKIvdy6eTH9HIrkEk A==; X-IronPort-AV: E=McAfee;i="6400,9594,10398"; a="308814497" X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="308814497" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 00:18:41 -0700 X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="625346203" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 00:18:39 -0700 From: Weiyuan Li To: dts@dpdk.org, yuan.peng@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V1 1/4] tests/kernelpf_iavf: update dts code for driver change Date: Tue, 5 Jul 2022 15:18:32 +0800 Message-Id: <20220705071835.17187-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 The out-tree driver has vf-vlan-pruning option,but in-tree driver has not. So we need different action to enable vlan filter when we validate the vlan filter function with in-tree and out-tree kernel drvier. Signed-off-by: Weiyuan Li --- tests/TestSuite_kernelpf_iavf.py | 34 ++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index d7d17ac4..8d051931 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -96,7 +96,26 @@ class TestKernelpfIavf(TestCase): # bind to default driver self.bind_nic_driver(self.dut_ports, driver="") self.used_dut_port = self.dut_ports[0] - if self.is_eth_series_nic(800) and self.default_stats: + # check out tree driver whether there is flag vf-vlan-pruning. + # out tree path: /lib/modules/4.18.0-305.19.1.el8_4.x86_64/updates/drivers/net/ethernet/intel/i40e/i40e.ko + # in tree path:/lib/modules/5.15.0-27-generic/kernel/drivers/net/ethernet/intel/ice/ice.ko + out = self.dut.send_expect(f"modinfo {self.kdriver}", "# ") + pattern = "/lib/modules/(.*?)/updates/drivers" + regex = re.compile(pattern) + mo = regex.search(out) + if mo: + search_results = mo.group(0) + else: + search_results = '' + if "updates" in search_results and not self.default_stats: + self.verify( + False, + f"{self.kdriver} driver out tree does not have vf-vlan-pruning flag. Please confirm whether the driver is correct.", + ) + if ( + any([self.is_eth_series_nic(800), self.kdriver == "i40e"]) + and self.default_stats + ): self.dut.send_expect( "ethtool --set-priv-flags %s %s on" % (self.host_intf, self.flag), "# " ) @@ -119,7 +138,6 @@ class TestKernelpfIavf(TestCase): self.dut.send_expect( "ip link set %s vf 0 mac %s" % (self.host_intf, self.vf_mac), "# " ) - try: for port in self.sriov_vfs_port: @@ -453,7 +471,11 @@ class TestKernelpfIavf(TestCase): time.sleep(1) tcpdump_out = self.get_tcpdump_package() receive_pkt = re.findall("vlan %s" % random_vlan, tcpdump_out) - if self.kdriver == "i40e" and self.driver_version < "2.13.10": + if ( + (self.kdriver == "i40e" and self.driver_version < "2.13.10") + or (self.kdriver == "i40e" and not self.default_stats) + or (self.kdriver == "ice" and not self.default_stats) + ): self.verify(len(receive_pkt) == 2, "Failed to received vlan packet!!!") else: self.verify(len(receive_pkt) == 1, "Failed to received vlan packet!!!") @@ -853,7 +875,11 @@ 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": + if ( + (self.kdriver == "i40e" and self.driver_version < "2.13.10") + or (self.kdriver == "i40e" and not self.default_stats) + or (self.kdriver == "ice" and not self.default_stats) + ): self.verify(packets == 10, "Not receive expected packet") else: self.verify(packets == 0, "Receive expected packet") From patchwork Tue Jul 5 07:18:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 113669 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 086CDA0543; Tue, 5 Jul 2022 09:18:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91729410E5; Tue, 5 Jul 2022 09:18:44 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 596E8400D7 for ; Tue, 5 Jul 2022 09:18:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657005523; x=1688541523; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CV9CmP/oakkOaI0ZIgUjKFptHCKRHbisMYvQrTaqpNw=; b=HrGUnlaUa4iGevwNYrSLPGPwNJ2upuamzA2DcctSJCB5mOCIjwaW6gcV MwBfS/Sd81xtW6o4bE5BIpbt0eNBUhwNtfZvmODolO6kpOGKtJbLfbxt1 nVlN+n/+M3Hp1AQMPcQIAktbOX+bZw8C8CNzM26EEfxvUS7IFJ1hOL8Ld AEgc0/A0fOMFg0ZTDxIPgLvfa1vXr2LHC2yAprf8VyJMIi7iEQ0laDjvX JafT316mSg0QL8tihzv5I6X8fbYk9xlkQjELh2lUmAEKrNqU1UwBO4S1S 9IVtEuwS0e/0A8bmjFMlXrN8+OeWfq/eMP4meg5pA/dmVjrax93iVSPtY Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10398"; a="308814502" X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="308814502" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 00:18:42 -0700 X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="625346207" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 00:18:41 -0700 From: Weiyuan Li To: dts@dpdk.org, yuan.peng@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V1 2/4] test_plans/kernelpf_iavf: update dts code for driver change Date: Tue, 5 Jul 2022 15:18:33 +0800 Message-Id: <20220705071835.17187-2-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220705071835.17187-1-weiyuanx.li@intel.com> References: <20220705071835.17187-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 The out-tree driver has vf-vlan-pruning option,but in-tree driver has not. So we need different action to enable vlan filter when we validate the vlan filter function with in-tree and out-tree kernel drvier. Signed-off-by: Weiyuan Li --- test_plans/kernelpf_iavf_test_plan.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test_plans/kernelpf_iavf_test_plan.rst b/test_plans/kernelpf_iavf_test_plan.rst index 8c7d1ad5..f044e3cc 100644 --- a/test_plans/kernelpf_iavf_test_plan.rst +++ b/test_plans/kernelpf_iavf_test_plan.rst @@ -28,6 +28,9 @@ Get the pci device id of DUT, for example:: 0000:18:00.0 'Device 1592' if=enp24s0f0 drv=ice unused=igb_uio 0000:18:00.1 'Device 1592' if=enp24s0f1 drv=ice unused=igb_uio +If the driver is out tree enable pf vf-vlan-pruning flags:: + ethtool --set-priv-flags $PF_INTF vf-vlan-pruning on + Create 1 VF from 1 kernel PF:: echo 1 > /sys/bus/pci/devices/0000\:18\:00.0/sriov_numvfs From patchwork Tue Jul 5 07:18:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 113670 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 BED6EA0542; Tue, 5 Jul 2022 09:18:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B492742684; Tue, 5 Jul 2022 09:18:46 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 2FC8B400D7 for ; Tue, 5 Jul 2022 09:18:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657005525; x=1688541525; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LwFNuVZXA7I3TtUfBqGHSOMQjRZX4qzo9VQj5Vz3p8I=; b=aJ73E7n64DSabUQijGXdoFLEPSTR4/mb0nDkHrIdtOw5N2WXxSlcypo0 Gp92Nd6l3hNxr5mHyxdPd7+6uocZY2/BQt8jSTPlaeAXZhCGvQUtqzQ5x lnuekI3mM5S/SMAKpoxOcz63GZGoQfijhjbRkVMB2gQnIEsiIHHKIM37P 6+5uUooZRdj8z+kZJi0a+tew2JjyKTM4r19Oi1pQC+QhZIUgBZlVvjjFT nWiIctfdIriyvc1g8WpbS08jb38ODMoakpExaIqy3PEnDS7yCGGkW7ZWn GyHwt+kEuzpqg6kzItpCcCL8KOpZwEybZ+N0T0NGULupNt6DrUuHobiGq g==; X-IronPort-AV: E=McAfee;i="6400,9594,10398"; a="308814509" X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="308814509" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 00:18:44 -0700 X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="625346210" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 00:18:42 -0700 From: Weiyuan Li To: dts@dpdk.org, yuan.peng@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V1 3/4] tests/vf_vlan: update dts code for driver change Date: Tue, 5 Jul 2022 15:18:34 +0800 Message-Id: <20220705071835.17187-3-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220705071835.17187-1-weiyuanx.li@intel.com> References: <20220705071835.17187-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 The out-tree driver has vf-vlan-pruning option,but in-tree driver has not. So we need different action to enable vlan filter when we validate the vlan filter function with in-tree and out-tree kernel drvier. Signed-off-by: Weiyuan Li --- tests/TestSuite_vf_vlan.py | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_vf_vlan.py b/tests/TestSuite_vf_vlan.py index e73ad479..4986a21b 100644 --- a/tests/TestSuite_vf_vlan.py +++ b/tests/TestSuite_vf_vlan.py @@ -62,7 +62,26 @@ class TestVfVlan(TestCase): self.host_intf0 = self.dut.ports_info[self.used_dut_port_0]["intf"] tester_port = self.tester.get_local_port(self.used_dut_port_0) self.tester_intf0 = self.tester.get_interface(tester_port) - if self.is_eth_series_nic(800) and self.default_stats: + # check out tree driver whether there is flag vf-vlan-pruning. + # out tree path: /lib/modules/4.18.0-305.19.1.el8_4.x86_64/updates/drivers/net/ethernet/intel/i40e/i40e.ko + # in tree path:/lib/modules/5.15.0-27-generic/kernel/drivers/net/ethernet/intel/ice/ice.ko + out = self.dut.send_expect(f"modinfo {self.kdriver}", "# ") + pattern = "/lib/modules/(.*?)/updates/drivers" + regex = re.compile(pattern) + mo = regex.search(out) + if mo: + search_results = mo.group(0) + else: + search_results = '' + if "updates" in search_results and not self.default_stats: + self.verify( + False, + f"{self.kdriver} driver out tree does not have vf-vlan-pruning flag. Please confirm whether the driver is correct.", + ) + if ( + any([self.is_eth_series_nic(800), self.kdriver == "i40e"]) + and self.default_stats + ): self.dut.send_expect( "ethtool --set-priv-flags %s %s on" % (self.host_intf0, self.flag), "# " ) @@ -233,7 +252,11 @@ class TestVfVlan(TestCase): self.vm0_testpmd.execute_cmd("start") out = self.send_and_getout(vlan=random_vlan, pkt_type="VLAN_UDP") - if self.kdriver == "i40e" and self.driver_version < "2.13.10": + if ( + (self.kdriver == "i40e" and self.driver_version < "2.13.10") + or (self.kdriver == "i40e" and not self.default_stats) + or (self.kdriver == "ice" and not self.default_stats) + ): self.verify("received" in out, "Failed to received vlan packet!!!") else: self.verify("received" not in out, "Received vlan packet without pvid!!!") @@ -354,7 +377,11 @@ class TestVfVlan(TestCase): # send packet with vlan out = self.send_and_getout(vlan=random_vlan, pkt_type="VLAN_UDP") - if self.kdriver == "i40e" and self.driver_version < "2.13.10": + if ( + (self.kdriver == "i40e" and self.driver_version < "2.13.10") + or (self.kdriver == "i40e" and not self.default_stats) + or (self.kdriver == "ice" and not self.default_stats) + ): self.verify( "received 1 packets" in out, "Received mismatched vlan packet while vlan filter on", From patchwork Tue Jul 5 07:18:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 113671 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 E07BAA0543; Tue, 5 Jul 2022 09:18:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D897540E50; Tue, 5 Jul 2022 09:18:47 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 585B7400D7 for ; Tue, 5 Jul 2022 09:18:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657005526; x=1688541526; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SS1MgMYo9kgxmBliHnEgJrTGrAnaypTMAORqS0sSc0M=; b=L6pdDfqrrRZrCo6uTOFIqxrl3q6/76LQDRXXTRMjpnNV6KK2FCymf3W+ k1s2R/XfJCK0i3X7l5ZAgn1F6Vb2YfYmd/bqgc6cjuYLCdxJvxWPjIYd4 ht1Zmzi4g1B3GLdsqAZbXW9QX4scXqufVoYPBgaqncnquGD5dGhyPY9xM 4oaoomhnOhbQ3/uvsWAM5ebyZry7kjyjTemXv0msQLdWS6aNg+LdBd5x4 IGpwoAMMcrrqMaKGGTTC97tcwlNtAzFgkCcGpQkLSskUgCqQhPrzfZW7O g/4PI4pUDj/eDoCbchnO3+9ahsMI71LMfDtPkq1I23wilc+o4a6QehRHk w==; X-IronPort-AV: E=McAfee;i="6400,9594,10398"; a="308814518" X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="308814518" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 00:18:45 -0700 X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="625346216" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 00:18:44 -0700 From: Weiyuan Li To: dts@dpdk.org, yuan.peng@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V1 4/4] test_plans/vf_vlan: update dts code for driver change Date: Tue, 5 Jul 2022 15:18:35 +0800 Message-Id: <20220705071835.17187-4-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220705071835.17187-1-weiyuanx.li@intel.com> References: <20220705071835.17187-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 The out-tree driver has vf-vlan-pruning option,but in-tree driver has not. So we need different action to enable vlan filter when we validate the vlan filter function with in-tree and out-tree kernel drvier. Signed-off-by: Weiyuan Li --- test_plans/vf_vlan_test_plan.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test_plans/vf_vlan_test_plan.rst b/test_plans/vf_vlan_test_plan.rst index c183b3d6..a3d8df6b 100644 --- a/test_plans/vf_vlan_test_plan.rst +++ b/test_plans/vf_vlan_test_plan.rst @@ -21,6 +21,10 @@ Prerequisites 0000:87:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f0 drv=i40e unused= 0000:87:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f1 drv=i40e unused= + If the driver is out tree enable pf vf-vlan-pruning flags: + ethtool --set-priv-flags ens259f0 vf-vlan-pruning on + ethtool --set-priv-flags ens259f1 vf-vlan-pruning on + echo 1 > /sys/bus/pci/devices/0000\:87\:00.0/sriov_numvfs echo 1 > /sys/bus/pci/devices/0000\:87\:00.1/sriov_numvfs