From patchwork Tue Feb 21 14:50:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 124264 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 95C1741CF8; Tue, 21 Feb 2023 07:33:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91CCB43163; Tue, 21 Feb 2023 07:33:10 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id AB16C40E5A for ; Tue, 21 Feb 2023 07:33:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676961188; x=1708497188; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=oABYbbhJD/wlXyvCncAdVCwhEhLE8g/p0lWmuJ1fGaE=; b=QQAWIu9HL8tS7l8OHqMnSopS+cvgKhlmFBAbzjGNKYnHQbhys63Rct65 ruflhXS86ZTtS+/uJlSiY+syRi9LlvRpsQ+Op3gariNu+2+AWiSQpWKB4 rtRu4y+mGScUtrP9HC5PJUjS7Ho0Ard5oF1ZTzGcXtO5JEMx7bFP/gXDS 0P/4Ubex0xvQdoVsgOyVD3jKsZwALTDYhRx+3Qsiojmc45ywJREqHFPV+ mjhT8dqqsId4w5gnyFtEJleIjLe1rT1BkALSO4W40K/tBLxvSVkd8XBtM UXtshKbHAKddyjQYJYFRN2c9mpJKB01ClGIfzQUj/cKopwy4Np8mQlD69 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="330275968" X-IronPort-AV: E=Sophos;i="5.97,314,1669104000"; d="scan'208";a="330275968" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 22:33:08 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="1000483914" X-IronPort-AV: E=Sophos;i="5.97,314,1669104000"; d="scan'208";a="1000483914" Received: from unknown (HELO localhost.localdomain) ([10.239.252.93]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 22:33:07 -0800 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V1 2/2] tests/ice_dcf_switch_filter: optimize max vfs script Date: Tue, 21 Feb 2023 22:50:59 +0800 Message-Id: <20230221145059.10655-2-hongbox.li@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230221145059.10655-1-hongbox.li@intel.com> References: <20230221145059.10655-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 3560d065..4a84d084 100644 --- a/tests/TestSuite_ice_dcf_switch_filter.py +++ b/tests/TestSuite_ice_dcf_switch_filter.py @@ -2951,10 +2951,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