DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1 0/3] dts: port vf_smoke to new DTS
@ 2024-09-06 17:37 jspewock
  2024-09-06 17:37 ` [PATCH v1 1/3] dts: allow specifying ingress port in send_packets jspewock
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jspewock @ 2024-09-06 17:37 UTC (permalink / raw)
  To: npratte, thomas, alex.chapman, probb, wathsala.vithanage,
	Luca.Vizzarro, Honnappa.Nagarahalli, yoan.picchi,
	paul.szczepanek, juraj.linkes
  Cc: dev, Jeremy Spewock

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

The VF smoke testing suite in the old DTS framework had the same test
cases as the PF smoke testing suite and, therefore, it makes sense to
have the two test suites use the same testing functions. In this series
the easiest way to do this was to simply parameterize what ports are
used for sending and receiving packets in the pf_smoke_tests suite and
then have the vf_smoke_testing suite extend from this class. This makes
it so that the two will always have the same test cases.

It was desirable to separate the testing into two different test suites
since, while their testing methods are the same, the two test suites
are testing disjoint functionality.

Depends-on: series-32935 ("dts: pf_smoke port")
Depends-on: series-32814 ("dts: add VFs to the framework")

Jeremy Spewock (3):
  dts: allow specifying ingress port in send_packets
  dts: parameterize ports used in pf_smoke suite
  dts: add vf_smoke tests suite

 dts/framework/config/conf_yaml_schema.json |  3 ++-
 dts/framework/test_suite.py                |  7 +++++-
 dts/tests/TestSuite_pf_smoke_tests.py      | 22 ++++++++++++++---
 dts/tests/TestSuite_vf_smoke_tests.py      | 28 ++++++++++++++++++++++
 4 files changed, 55 insertions(+), 5 deletions(-)
 create mode 100644 dts/tests/TestSuite_vf_smoke_tests.py

-- 
2.46.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/3] dts: allow specifying ingress port in send_packets
  2024-09-06 17:37 [PATCH v1 0/3] dts: port vf_smoke to new DTS jspewock
@ 2024-09-06 17:37 ` jspewock
  2024-09-06 17:37 ` [PATCH v1 2/3] dts: parameterize ports used in pf_smoke suite jspewock
  2024-09-06 17:37 ` [PATCH v1 3/3] dts: add vf_smoke tests suite jspewock
  2 siblings, 0 replies; 4+ messages in thread
From: jspewock @ 2024-09-06 17:37 UTC (permalink / raw)
  To: npratte, thomas, alex.chapman, probb, wathsala.vithanage,
	Luca.Vizzarro, Honnappa.Nagarahalli, yoan.picchi,
	paul.szczepanek, juraj.linkes
  Cc: dev, Jeremy Spewock

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

In order to use VFs in the framework, methods for sending packets had to
be modified so that they support choosing which ports to use when
sending and receiving. This patch creates the same support for the
send_packets method so that it can be used with VFs.

Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
 dts/framework/test_suite.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
index b17f0c04b2..6490500610 100644
--- a/dts/framework/test_suite.py
+++ b/dts/framework/test_suite.py
@@ -221,13 +221,18 @@ def send_packet_and_capture(
     def send_packets(
         self,
         packets: list[Packet],
+        sut_ingress: Port | None = None,
     ) -> None:
         """Send packets using the traffic generator and do not capture received traffic.
 
         Args:
             packets: Packets to send.
+            sut_ingress: Optional port to use as the SUT ingress port. Defaults to
+                `self._sut_port_ingress`.
         """
-        packets = self._adjust_addresses(packets)
+        if sut_ingress is None:
+            sut_ingress = self._sut_port_ingress
+        packets = self._adjust_addresses(packets, sut_ingress, self._sut_port_egress)
         self.tg_node.send_packets(packets, self._tg_port_egress)
 
     def get_expected_packet(
-- 
2.46.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 2/3] dts: parameterize ports used in pf_smoke suite
  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
  2024-09-06 17:37 ` [PATCH v1 3/3] dts: add vf_smoke tests suite jspewock
  2 siblings, 0 replies; 4+ messages in thread
From: jspewock @ 2024-09-06 17:37 UTC (permalink / raw)
  To: npratte, thomas, alex.chapman, probb, wathsala.vithanage,
	Luca.Vizzarro, Honnappa.Nagarahalli, yoan.picchi,
	paul.szczepanek, juraj.linkes
  Cc: dev, Jeremy Spewock

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 3/3] dts: add vf_smoke tests suite
  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 ` [PATCH v1 2/3] dts: parameterize ports used in pf_smoke suite jspewock
@ 2024-09-06 17:37 ` jspewock
  2 siblings, 0 replies; 4+ messages in thread
From: jspewock @ 2024-09-06 17:37 UTC (permalink / raw)
  To: npratte, thomas, alex.chapman, probb, wathsala.vithanage,
	Luca.Vizzarro, Honnappa.Nagarahalli, yoan.picchi,
	paul.szczepanek, juraj.linkes
  Cc: dev, Jeremy Spewock

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

VFs should be tested against the same criteria as PFs, therefore the
smoke testing suite for VFs inherits the same test cases and testing
coverage from the PF smoke testing suite. The primary difference between
the two suites is that VF smoke initially creates virtual functions to
use for testing, and then tears them down at the end of testing and
resets the state of the PFs.

Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
 dts/framework/config/conf_yaml_schema.json |  3 ++-
 dts/tests/TestSuite_vf_smoke_tests.py      | 28 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 dts/tests/TestSuite_vf_smoke_tests.py

diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json
index 910134f9e4..1a9d497fbf 100644
--- a/dts/framework/config/conf_yaml_schema.json
+++ b/dts/framework/config/conf_yaml_schema.json
@@ -188,7 +188,8 @@
         "hello_world",
         "os_udp",
         "pmd_buffer_scatter",
-        "pf_smoke_tests"
+        "pf_smoke_tests",
+        "vf_smoke_tests"
       ]
     },
     "test_target": {
diff --git a/dts/tests/TestSuite_vf_smoke_tests.py b/dts/tests/TestSuite_vf_smoke_tests.py
new file mode 100644
index 0000000000..f9b6098111
--- /dev/null
+++ b/dts/tests/TestSuite_vf_smoke_tests.py
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 University of New Hampshire
+"""Virtual Function (VF) smoke testing suite.
+
+The same common DPDK functionality that is tested on physical functions (PFs) in
+:class:`.TestSuite_pf_smoke_tests.TestPfSmokeTests` should be tested on VFs. Therefore, this test
+suite inherits its test cases from the PF smoke testing suite. The primary difference in this
+testing suite is that it creates virtual functions prior to running its test cases and then removes
+them and resets the state of the PFs after it is finished.
+"""
+from .TestSuite_pf_smoke_tests import TestPfSmokeTests  # type: ignore[import-untyped]
+
+
+class TestVfSmokeTests(TestPfSmokeTests):
+    """VF smoke testing suite."""
+
+    def set_up_suite(self) -> None:
+        """Extends :meth:`TestPfSmokeTests.set_up_suite` with methods to create Rx/Tx VFs."""
+        super().set_up_suite()
+        self.sut_egress_port = self.sut_node.create_virtual_functions(1, self._sut_port_egress)[0]
+        self.sut_ingress_port = self.sut_node.create_virtual_functions(1, self._sut_port_ingress)[0]
+
+    def tear_down_suite(self) -> None:
+        """Extends :meth:`TestPfSmokeTests.tear_down_suite` with VF cleanup and PF rebinding."""
+        super().tear_down_suite()
+        self.sut_node.remove_virtual_functions(self._sut_port_egress)
+        self.sut_node.remove_virtual_functions(self._sut_port_ingress)
+        self.sut_node.bind_all_ports_to_driver()
-- 
2.46.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-06 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v1 2/3] dts: parameterize ports used in pf_smoke suite jspewock
2024-09-06 17:37 ` [PATCH v1 3/3] dts: add vf_smoke tests suite jspewock

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).