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 15B8CA0543; Wed, 6 Jul 2022 04:38:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0C55410D3; Wed, 6 Jul 2022 04:38:16 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id B357940395 for ; Wed, 6 Jul 2022 04:38:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657075095; x=1688611095; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ou2tuAQntfWZ91vyabKzPPryByNmWRxNAzYv7dwEWao=; b=KYzswA26KNVMTrj1j6QGFGTCYMEUwCXLKLyOFoAIGQFjauDSrLCpvyUN Jmw2SGPlCzv8+wxwOEzQPc+RVQX+LiDSRvK3SAxfNkXV5I7nM8bAxv7S6 b9o4xKFwZhJOALs3pHmnMayyunSs27uEOGJ7wp0qcVdYfL8bQkAJO5Eon yg466ZvVTc2Rx2TL0K7Qi4ngSyRWdZXk5PlD9mZSc6j50H/TIGmBA9vxY QcktnIImiNJVHZXS/aWU+tMdlDSvnnFfqfVrumbDx9JYygQOgVnlduX3x Q4kTWBLX1l5cAhQ1lQD4IWqU+6oLz1ZfxjAiYEv5RkF31BcJegmdlphHy Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10399"; a="369941346" X-IronPort-AV: E=Sophos;i="5.92,248,1650956400"; d="scan'208";a="369941346" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 19:38:15 -0700 X-IronPort-AV: E=Sophos;i="5.92,248,1650956400"; d="scan'208";a="625684834" 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 19:38:13 -0700 From: Weiyuan Li To: dts@dpdk.org, yuan.peng@intel.com Cc: Weiyuan Li Subject: [dts][PATCH V2 2/4] tests/vf_vlan: update dts code for driver change Date: Wed, 6 Jul 2022 10:38:04 +0800 Message-Id: <20220706023806.27825-2-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220706023806.27825-1-weiyuanx.li@intel.com> References: <20220706023806.27825-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 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 --- v2: -fix format issue tests/TestSuite_vf_vlan.py | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_vf_vlan.py b/tests/TestSuite_vf_vlan.py index e73ad479..2ae4b3dc 100644 --- a/tests/TestSuite_vf_vlan.py +++ b/tests/TestSuite_vf_vlan.py @@ -62,7 +62,25 @@ 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.logger.warning( + 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 +251,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 +376,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", -- 2.27.0