test suite reviews and discussions
 help / color / mirror / Atom feed
From: Hongbo Li <hongbox.li@intel.com>
To: dts@dpdk.org
Cc: Hongbo Li <hongbox.li@intel.com>
Subject: [dts][PATCH V2 2/2] tests/ice_dcf_switch_filter: optimize max vfs scrip
Date: Thu,  9 Mar 2023 01:48:57 +0800	[thread overview]
Message-ID: <20230308174857.25857-2-hongbox.li@intel.com> (raw)
In-Reply-To: <20230308174857.25857-1-hongbox.li@intel.com>

Change the method of obtaining the maximum number of VF that can be created on one PF

Signed-off-by: Hongbo Li <hongbox.li@intel.com>
---
 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


  reply	other threads:[~2023-03-08  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 17:48 [dts][PATCH V2 1/2] test_plans/ice_dcf_switch_filter: optimize max vfs script Hongbo Li
2023-03-08 17:48 ` Hongbo Li [this message]
2023-03-28  0:49 ` lijuan.tu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230308174857.25857-2-hongbox.li@intel.com \
    --to=hongbox.li@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).