test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jin Ling <jin.ling@intel.com>
To: dts@dpdk.org
Cc: Jin Ling <jin.ling@intel.com>
Subject: [DTS][PATCH V1 08/10] framework/project_dpdk: optimize code
Date: Sun, 16 Jul 2023 17:07:52 +0800	[thread overview]
Message-ID: <20230716090753.1590148-9-jin.ling@intel.com> (raw)
In-Reply-To: <20230716090753.1590148-1-jin.ling@intel.com>

    Optimizing functions to prevent errors when testing with mev

Signed-off-by: Jin Ling <jin.ling@intel.com>
---
 framework/project_dpdk.py | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 3f34ee02..732eea12 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -98,9 +98,14 @@ class DPDKdut(Dut):
                     "echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode",
                     "#",
                 )
-            out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
-            assert "vfio_pci" in out, "load vfio_pci failed"
-
+            # out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
+            # assert "vfio_pci" in out, "load vfio_pci failed"
+            if "mev" not in self.nic.name:
+                out = self.send_expect("ls /sys/module|grep vfio_pci", "#")
+                assert "vfio_pci" in out , "load vfio_pci failed"
+            
+            
+            
         elif drivername == "uio_pci_generic":
             self.send_expect("modprobe uio", "#", 70)
             self.send_expect("modprobe uio_pci_generic", "#", 70)
@@ -415,9 +420,13 @@ class DPDKdut(Dut):
 
         current_nic = 0
         for port_info in self.ports_info:
-            if nics_to_bind is None or current_nic in nics_to_bind:
-                binding_list += "%s " % (port_info["pci"])
-            current_nic += 1
+            # if nics_to_bind is None or current_nic in nics_to_bind:
+            #     binding_list += "%s " % (port_info["pci"])
+            if port_info["pci"] not in binding_list:
+                if nics_to_bind is None or current_nic in nics_to_bind:
+                    binding_list += "%s " % (port_info["pci"])
+                current_nic += 1
+            # current_nic += 1
 
         bind_script_path = self.get_dpdk_bind_script()
         return self.send_expect(
-- 
2.34.1


  parent reply	other threads:[~2023-07-16  9:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-16  9:07 [DTS][PATCH V1 00/10] add functions to test MEV Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 01/10] conf/crbs.cfg: add parameters Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 02/10] execution.cfg: add parameters to choose datapath and create vport when running test scripts Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 03/10] framework/config: save the serial port connection info of imc and acc to the self.crb Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 04/10] framework/crb:modify code when pexpect contains '#', replace '#' with 'mev-acc' Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 05/10] framework/dts: add global variables Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 06/10] framework/dut: add new functions to set up test mev env Jin Ling
2023-07-16  9:07 ` [DTS][PATCH V1 07/10] framework/pmd_output: optimize function start_testpmd Jin Ling
2023-07-16  9:07 ` Jin Ling [this message]
2023-07-16  9:07 ` [DTS][PATCH V1 09/10] framework/settings: add drivers and NICs for mev Jin Ling

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=20230716090753.1590148-9-jin.ling@intel.com \
    --to=jin.ling@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).