DPDK patches and discussions
 help / color / mirror / Atom feed
From: jspewock@iol.unh.edu
To: npratte@iol.unh.edu, thomas@monjalon.net, alex.chapman@arm.com,
	probb@iol.unh.edu, wathsala.vithanage@arm.com,
	Luca.Vizzarro@arm.com, Honnappa.Nagarahalli@arm.com,
	yoan.picchi@foss.arm.com, paul.szczepanek@arm.com,
	juraj.linkes@pantheon.tech
Cc: dev@dpdk.org, Jeremy Spewock <jspewock@iol.unh.edu>
Subject: [PATCH v1 2/3] dts: parameterize ports used in pf_smoke suite
Date: Fri,  6 Sep 2024 13:37:08 -0400	[thread overview]
Message-ID: <20240906173709.17487-3-jspewock@iol.unh.edu> (raw)
In-Reply-To: <20240906173709.17487-1-jspewock@iol.unh.edu>

From: Jeremy Spewock <jspewock@iol.unh.edu>

Currently the pf_smoke testing suite only uses the default ports for
sending and receiving packets. When looking at that suite in isolation,
this is fine since its primary goal is to test the physical functions
in the test run (which the defaults should represent). However, since
this suite represents the same coverage that should be tested on VFs, it
makes sense to parameterize the ports that are in use in the suite so
that the same test cases can be used for testing VFs.

Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
 dts/tests/TestSuite_pf_smoke_tests.py | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/dts/tests/TestSuite_pf_smoke_tests.py b/dts/tests/TestSuite_pf_smoke_tests.py
index 287132e9dd..984a193e8b 100644
--- a/dts/tests/TestSuite_pf_smoke_tests.py
+++ b/dts/tests/TestSuite_pf_smoke_tests.py
@@ -18,6 +18,7 @@
 from framework.params.testpmd import SimpleForwardingModes
 from framework.remote_session.testpmd_shell import TestPmdShell
 from framework.test_suite import TestSuite
+from framework.testbed_model.port import Port
 
 
 class TestPfSmokeTests(TestSuite):
@@ -35,6 +36,8 @@ class TestPfSmokeTests(TestSuite):
     is_blocking: ClassVar[bool] = True
     jumbo_frame_len: ClassVar[int] = 9000
     num_queues: int = 4
+    sut_egress_port: Port | None = None
+    sut_ingress_port: Port | None = None
 
     def set_up_suite(self) -> None:
         """Increase the MTU of the traffic generator to support jumboframes."""
@@ -48,12 +51,17 @@ def test_jumbo_frame_support(self) -> None:
             max_pkt_len=self.jumbo_frame_len,
             mbuf_size=[self.jumbo_frame_len + 128],
             forward_mode=SimpleForwardingModes.mac,
+            ports=[self.sut_egress_port, self.sut_ingress_port]
+            if self.sut_egress_port is not None and self.sut_ingress_port is not None
+            else None,
         ) as testpmd:
             testpmd.start()
             # Take 26 bytes off the MTU size to account for Ethernet headers
             payload_len = self.jumbo_frame_len - 26
             packet = Ether() / Raw("X" * payload_len)
-            recv = self.send_packet_and_capture(packet)
+            recv = self.send_packet_and_capture(
+                packet, sut_ingress=self.sut_ingress_port, sut_egress=self.sut_egress_port
+            )
             self.verify(
                 any(hasattr(p, "load") and "X" * 20 in str(p.load) for p in recv),
                 f"Jumboframe was not received even when MTU was set to {self.jumbo_frame_len}.",
@@ -73,6 +81,9 @@ def test_rss_functionality(self) -> None:
             forward_mode=SimpleForwardingModes.rxonly,
             rx_queues=self.num_queues,
             tx_queues=self.num_queues,
+            ports=[self.sut_egress_port, self.sut_ingress_port]
+            if self.sut_egress_port is not None and self.sut_ingress_port is not None
+            else None,
         ) as testpmd:
             testpmd.set_verbose(1)
             src_max = "00:00:00:00:00:01"
@@ -80,7 +91,7 @@ def test_rss_functionality(self) -> None:
                 Ether(src=src_max) / IP(dst=f"192.168.0.{i+1}") for i in range(self.num_queues * 4)
             ]
             testpmd.start()
-            self.send_packets(send_pkts)
+            self.send_packets(send_pkts, sut_ingress=self.sut_ingress_port)
             verbose_stats = TestPmdShell.extract_verbose_output(testpmd.stop())
             # Filter down the packets to only the ones with the correct source MAC
             verbose_stats = list(filter(lambda x: x.src_mac == src_max, verbose_stats))
@@ -105,7 +116,12 @@ def test_rss_functionality(self) -> None:
     def test_runtime_modify_num_queues(self) -> None:
         """Ensure that the number of queues on a port can be changed at runtime."""
         with TestPmdShell(
-            self.sut_node, rx_queues=self.num_queues, tx_queues=self.num_queues
+            self.sut_node,
+            rx_queues=self.num_queues,
+            tx_queues=self.num_queues,
+            ports=[self.sut_egress_port, self.sut_ingress_port]
+            if self.sut_egress_port is not None and self.sut_ingress_port is not None
+            else None,
         ) as testpmd:
             try:
                 testpmd.set_num_queues_all(2, True, verify=True)
-- 
2.46.0


  parent reply	other threads:[~2024-09-06 17:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 17:37 [PATCH v1 0/3] dts: port vf_smoke to new DTS jspewock
2024-09-06 17:37 ` [PATCH v1 1/3] dts: allow specifying ingress port in send_packets jspewock
2024-09-06 17:37 ` jspewock [this message]
2024-09-06 17:37 ` [PATCH v1 3/3] dts: add vf_smoke tests suite jspewock
2024-09-26 20:39 ` [PATCH v2 0/3] dts: port vf_smoke to new DTS jspewock
2024-09-26 20:39   ` [PATCH v2 1/3] dts: allow specifying ingress port in send_packets jspewock
2024-09-26 20:39   ` [PATCH v2 2/3] dts: parameterize ports used in pf_smoke suite jspewock
2024-09-26 20:39   ` [PATCH v2 3/3] dts: add vf_smoke tests suite jspewock

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=20240906173709.17487-3-jspewock@iol.unh.edu \
    --to=jspewock@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=alex.chapman@arm.com \
    --cc=dev@dpdk.org \
    --cc=juraj.linkes@pantheon.tech \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    --cc=wathsala.vithanage@arm.com \
    --cc=yoan.picchi@foss.arm.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).