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 0CAC041E1C; Wed, 8 Mar 2023 10:33:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0619F40FAE; Wed, 8 Mar 2023 10:33:17 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 2BA7940ED6 for ; Wed, 8 Mar 2023 10:33:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678267995; x=1709803995; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=BZTeFvfVoxHYvC2xTXNtLiKp6QZmknHNQq4cL59x8wc=; b=dVaUZZ28L20zVPCbQcbsz5xrAr/MNZJHn/tE2Xpr9YPHJkGdIGkpbbYY R74wOoztRxcu1DU//NL8hpz9AkZSYfdO82lQ8JaFjDTPSmm2I0taRF9UG FPr4uH69eyCQy+QJWtk23lbcT2EOk6a1v7gxjvr2LuqwC4aWbLFSqu8h8 p/3iEwQRcH2Ff3fs9g7NhIIyZPfZ1PXkqHChxuVyMEv+w1mhnUSChai7c 2trLFmKLXSkm/YDKHtcb7jedPlpECgNyzAtMrYoKkrYYAv5J2xnHc1toP O6KNgfGpfUM3FVuzUliEiX2W/l4O6eQS73xXSim5Qcz3S0E/XYdD8Xshs g==; X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="315771020" X-IronPort-AV: E=Sophos;i="5.98,243,1673942400"; d="scan'208";a="315771020" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 01:32:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="922711086" X-IronPort-AV: E=Sophos;i="5.98,243,1673942400"; d="scan'208";a="922711086" Received: from unknown (HELO localhost.localdomain) ([10.239.252.93]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 01:32:58 -0800 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V2 2/2] tests/ice_dcf_switch_filter: optimize max vfs scrip Date: Thu, 9 Mar 2023 01:48:57 +0800 Message-Id: <20230308174857.25857-2-hongbox.li@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230308174857.25857-1-hongbox.li@intel.com> References: <20230308174857.25857-1-hongbox.li@intel.com> 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 Change the method of obtaining the maximum number of VF that can be created on one PF Signed-off-by: Hongbo Li --- tests/TestSuite_ice_dcf_switch_filter.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_ice_dcf_switch_filter.py b/tests/TestSuite_ice_dcf_switch_filter.py index c5c3ae0b..0731199a 100644 --- a/tests/TestSuite_ice_dcf_switch_filter.py +++ b/tests/TestSuite_ice_dcf_switch_filter.py @@ -3203,10 +3203,21 @@ class ICEDCFSwitchFilterTest(TestCase): def test_max_vfs(self): # get max vfs number - port_count = (1, 1, 2, 4, 4)[len(self.dut_ports)] - max_vf_number = int(256 / (port_count)) - # set up max_vf_number vfs on 1 pf environment self.used_dut_port_0 = self.dut_ports[0] + self.domain_id_0 = self.dut.ports_info[self.used_dut_port_0]["port"].domain_id + self.bus_id_0 = self.dut.ports_info[self.used_dut_port_0]["port"].bus_id + self.devfun_id_0 = self.dut.ports_info[self.used_dut_port_0]["port"].devfun_id + cmd_max_vfs = ( + "cat /sys/bus/pci/devices/" + + self.domain_id_0 + + "\\:" + + self.bus_id_0 + + "\\:" + + self.devfun_id_0 + + "/sriov_totalvfs" + ) + max_vf_number = int(self.dut.send_expect(cmd_max_vfs, "#")) + # set up max_vf_number vfs on 1 pf environment self.pf0_intf = self.dut.ports_info[self.used_dut_port_0]["intf"] out = self.dut.send_expect("ethtool -i %s" % self.pf0_intf, "#") # generate max_vf_number VFs on PF0 -- 2.17.1