test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@corigine.com>
To: dts@dpdk.org
Cc: oss-drivers@corigine.com, "Qin Ke" <qin.ke@corigine.com>,
	"Niklas Söderlund" <niklas.soderlund@corigine.com>
Subject: [PATCH 2/2] tests/blocklist: optimize case of bl_one_port to adapt to more scenarios
Date: Mon,  3 Jul 2023 21:34:59 +0200	[thread overview]
Message-ID: <20230703193459.41870-3-niklas.soderlund@corigine.com> (raw)
In-Reply-To: <20230703193459.41870-1-niklas.soderlund@corigine.com>

From: Qin Ke <qin.ke@corigine.com>

when one port blocked, the port with same PCIADRESS will also be blocked,
optimize it to adapt to more scenarios whether the PCIADRESS of ports are
same or not.

Signed-off-by: Qin Ke <qin.ke@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by Dano Teixeira <dano.teixeira@corigine.com>
---
 tests/TestSuite_blocklist.py | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_blocklist.py b/tests/TestSuite_blocklist.py
index 9d12c8319b23..61b5bf6800cd 100644
--- a/tests/TestSuite_blocklist.py
+++ b/tests/TestSuite_blocklist.py
@@ -78,10 +78,25 @@ class TestBlockList(TestCase):
         Run testpmd with one port blocklisted.
         """
         self.dut.kill_all()
+        blocked_pci_address = self.dut.ports_info[0]["pci"]
         out = self.pmdout.start_testpmd(
-            "Default", eal_param="-b %s" % self.dut.ports_info[0]["pci"]
+            "Default", eal_param="-b %s" % blocked_pci_address
         )
-        self.check_blocklisted_ports(out, self.ports[1:])
+
+        """
+        To multi-port NIC with one PCIADRESS, port has same PCIADRESS will also
+        be blocked when selected port blocked.
+        """
+        ports_to_blocklist = []
+        ports_no_blocklist = []
+        for port in self.ports:
+            if self.dut.ports_info[port]["pci"] == blocked_pci_address:
+                ports_to_blocklist.append(port)
+            else:
+                ports_no_blocklist.append(port)
+
+        self.check_blocklisted_ports(out, ports_to_blocklist, True)
+        self.check_blocklisted_ports(out, ports_no_blocklist)
 
     def test_bl_all_but_one_port_blocklisted(self):
         """
-- 
2.41.0


      parent reply	other threads:[~2023-07-03 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 19:34 [PATCH 0/2] tests/blocklist: Add support for NFP PMD Niklas Söderlund
2023-07-03 19:34 ` [PATCH 1/2] tests/blocklist: optimize logic to match more driver name of pmd Niklas Söderlund
2023-07-03 19:34 ` Niklas Söderlund [this message]

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=20230703193459.41870-3-niklas.soderlund@corigine.com \
    --to=niklas.soderlund@corigine.com \
    --cc=dts@dpdk.org \
    --cc=oss-drivers@corigine.com \
    --cc=qin.ke@corigine.com \
    /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).