* [RFC PATCH] dts: add pvp multi paths virtio performance testsuite
@ 2026-09-01 18:37 Koushik Bhargav Nimoji
2026-09-03 20:11 ` [PATCH v1] " Koushik Bhargav Nimoji
` (2 more replies)
0 siblings, 3 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-09-01 18:37 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997, dev
Cc: dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths virtio single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with two and one core respectively,
and tests the virtio single core throughputperformance.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
...ti_paths_virtio_single_core_performance.py | 399 ++++++++++++++++++
1 file changed, 399 insertions(+)
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
diff --git a/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
new file mode 100644
index 0000000000..aefc29facf
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
@@ -0,0 +1,399 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2025 University of New Hampshire
+
+"""Virtio-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding throughput of DPDK's virtio-user PMD running on a
+single CPU core. Performance is evaluated across multiple virtio path implementations, including
+packed versus split rings, in-order delivery, mergeable buffers, and SIMD vectorization.
+Test cases are parameterized using combinations of frame sizes, RX/TX descriptor ring counts,
+and target MPPS baselines specified in the test configuration. High-speed traffic is injected
+from an external generator through the physical host ports into the virtio-user instance,
+looped back, and returned to the generator. The aggregate MPPS processed by the single virtio
+core is verified against configured expected performance baselines to determine the test result.
+"""
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.test import verify, write_performance_json
+from api.testpmd import TestPmd
+from api.testpmd.config import PortTopology, RXRingParams, SimpleForwardingModes, TXRingParams
+from framework.params.eal import VirtualDevice
+from framework.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from framework.test_suite import BaseConfig, TestSuite, perf_test
+
+
+class Config(BaseConfig):
+ """Performance test metrics."""
+
+ test_parameters: list[dict[str, int | float]] = [
+ {"frame_size": 64, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 128, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 256, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 512, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1024, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1518, "num_descriptors": 1024, "expected_mpps": 1.00},
+ ]
+ delta_tolerance: float = 0.05
+
+
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVirtioSingleCorePerformance(TestSuite):
+ """pvp multi paths virtio single core performance test suite."""
+
+ config: Config
+
+ def set_up_suite(self):
+ """Assign test parameters."""
+ self.test_parameters = self.config.test_parameters
+ self.delta_tolerance = self.config.delta_tolerance
+
+ def set_up_test_case(self):
+ """Delete stale vhost-user Unix domain socket files."""
+ self._ctx.sut_node.main_session.send_command("rm -rf /tmp/vhost-net*", privileged=True)
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Create a testpmd session with every rule in the given list, verify jump behavior.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ ):
+ """Create testpmd instance with specified params and send traffic."""
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ "queues=1,"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.test_parameters:
+ frame_size = params["frame_size"]
+ num_descriptors = params["num_descriptors"]
+
+ default_args = {
+ "tx_ring": TXRingParams(descriptors=num_descriptors),
+ "rx_ring": RXRingParams(descriptors=num_descriptors),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ with (
+ TestPmd(
+ prefix="vhost",
+ allowed_ports=[],
+ memory_channels=4,
+ port_topology=PortTopology.chained,
+ vdevs=[vhost_user_vdev],
+ lcore_list=LogicalCoreList([1, 2, 3]),
+ nb_cores=2,
+ **default_args,
+ ) as vhost,
+ TestPmd(
+ prefix="virtio",
+ no_pci=True,
+ memory_channels=4,
+ allowed_ports=[],
+ vdevs=[virtio_user_vdev],
+ lcore_list=LogicalCoreList([4, 5]),
+ nb_cores=1,
+ **extra_args,
+ **default_args,
+ ) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.io)
+ virtio.set_forward_mode(SimpleForwardingModes.mac)
+ vhost.set_portlist([0, 2, 1])
+
+ params["measured_mpps"] = round(
+ self._transmit(vhost, virtio, frame_size, repetitions=5), 3
+ )
+ params["performance_delta"] = round(
+ (float(params["measured_mpps"]) - float(params["expected_mpps"]))
+ / float(params["expected_mpps"]),
+ 3,
+ )
+ params["pass"] = float(params["performance_delta"]) >= -self.delta_tolerance
+
+ self._produce_stats_table(self.test_parameters)
+ for params in self.test_parameters:
+ verify(
+ params["pass"] is True,
+ f"""Packets forwarded is less than {(1 - self.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[dict[str, int | float]]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print("-" * len(header))
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": RSSSetting.SetIPOnly(),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": RSSSetting.SetIPOnly(),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": RSSSetting.SetIPOnly(),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": RSSSetting.SetIPOnly(),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": RSSSetting.SetIPOnly(),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": RSSSetting.SetIPOnly(),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(ring_format=0, buffers=1, in_order=0, vectorized=0, extra_args={})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": RSSSetting.SetIPOnly(),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {"rss": RSSSetting.SetIPOnly()}
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self):
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {"rss": RSSSetting.SetIPOnly()}
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=1, extra_args=extra_args
+ )
--
2.55.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH v1] dts: add pvp multi paths virtio performance testsuite
2026-09-01 18:37 [RFC PATCH] dts: add pvp multi paths virtio performance testsuite Koushik Bhargav Nimoji
@ 2026-09-03 20:11 ` Koushik Bhargav Nimoji
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
2026-10-20 18:20 ` [RFC PATCH] dts: add pvp multi paths virtio performance testsuite Koushik Bhargav Nimoji
2 siblings, 0 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-09-03 20:11 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths virtio single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with two and one core respectively,
and tests the virtio single core throughputperformance.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
...ti_paths_virtio_single_core_performance.py | 411 ++++++++++++++++++
1 file changed, 411 insertions(+)
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
diff --git a/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
new file mode 100644
index 0000000000..8a97d3ee95
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
@@ -0,0 +1,411 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2025 University of New Hampshire
+
+"""Virtio-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding throughput of DPDK's virtio-user PMD running on a
+single CPU core. Performance is evaluated across multiple virtio path implementations, including
+packed versus split rings, in-order delivery, mergeable buffers, and SIMD vectorization.
+Test cases are parameterized using combinations of frame sizes, RX/TX descriptor ring counts,
+and target MPPS baselines specified in the test configuration. High-speed traffic is injected
+from an external generator through the physical host ports into the virtio-user instance,
+looped back, and returned to the generator. The aggregate MPPS processed by the single virtio
+core is verified against configured expected performance baselines to determine the test result.
+"""
+
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.testpmd import TestPmd
+from api.testpmd.config import PortTopology, RXRingParams, SimpleForwardingModes, TXRingParams
+from framework.params.eal import Params, VirtualDevice
+from framework.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from framework.test_suite import BaseConfig, TestSuite, perf_test
+
+
+class Config(BaseConfig):
+ """Performance test metrics."""
+
+ test_parameters: list[dict[str, int | float]] = [
+ {"frame_size": 64, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 128, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 256, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 512, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1024, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1518, "num_descriptors": 1024, "expected_mpps": 1.00},
+ ]
+ delta_tolerance: float = 0.05
+
+
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVirtioSingleCorePerformance(TestSuite):
+ """pvp multi paths virtio single core performance test suite."""
+
+ config: Config
+
+ def set_up_suite(self):
+ """Assign test parameters."""
+ self.test_parameters = self.config.test_parameters
+ self.delta_tolerance = self.config.delta_tolerance
+
+ def set_up_test_case(self):
+ """Delete stale vhost-user Unix domain socket files."""
+ self._ctx.sut_node.main_session.send_command("rm -rf /tmp/vhost-net*", privileged=True)
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ queues: int = 1,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic."""
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice(f"net_vhost0,iface=/tmp/vhost-net,queues={queues}")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ f"queues={queues},"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.test_parameters:
+ frame_size = params["frame_size"]
+ num_descriptors = params["num_descriptors"]
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=num_descriptors),
+ "rx_ring": RXRingParams(descriptors=num_descriptors),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2, 3]),
+ "nb_cores": 2,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([4, 5]),
+ "nb_cores": 1,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.io)
+ virtio.set_forward_mode(SimpleForwardingModes.mac)
+ vhost.set_portlist([0, 2, 1])
+
+ params["measured_mpps"] = round(
+ self._transmit(vhost, virtio, frame_size, repetitions=5), 3
+ )
+ params["performance_delta"] = round(
+ (float(params["measured_mpps"]) - float(params["expected_mpps"]))
+ / float(params["expected_mpps"]),
+ 3,
+ )
+ params["pass"] = float(params["performance_delta"]) >= -self.delta_tolerance
+
+ self._produce_stats_table(self.test_parameters)
+ for params in self.test_parameters:
+ verify(
+ params["pass"] is True,
+ f"""Packets forwarded is less than {(1 - self.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[dict[str, int | float]]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args={})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=1, extra_args=extra_args, queues=2
+ )
--
2.55.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH v2 1/2] dts: add pvp multi paths vhost performance testsuite
2026-09-01 18:37 [RFC PATCH] dts: add pvp multi paths virtio performance testsuite Koushik Bhargav Nimoji
2026-09-03 20:11 ` [PATCH v1] " Koushik Bhargav Nimoji
@ 2026-10-08 19:11 ` Koushik Bhargav Nimoji
2026-10-08 19:11 ` [PATCH v2 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
` (5 more replies)
2026-10-20 18:20 ` [RFC PATCH] dts: add pvp multi paths virtio performance testsuite Koushik Bhargav Nimoji
2 siblings, 6 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-10-08 19:11 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths vhost single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with one and two cores respectively,
and tests the vhost single core throughput performance.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
...pvp_multi_paths_vhost_single_core_perf.rst | 8 +
dts/configurations/tests_config.example.yaml | 12 +
dts/framework/testbed_model/linux_session.py | 4 +
dts/framework/testbed_model/os_session.py | 4 +
..._pvp_multi_paths_vhost_single_core_perf.py | 467 ++++++++++++++++++
5 files changed, 495 insertions(+)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
new file mode 100644
index 0000000000..4fcc6b6c91
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_vhost_single_core_perf Test Suite
+=================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_vhost_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index ce67385b0b..f765526442 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -18,6 +18,18 @@ hello_world:
# num_descriptors: 1024
# expected_mpps: 1.0
# delta_tolerance: 0.05
+# pvp_multi_paths_vhost_single_core_forward_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
# pmd_rss:
# NUM_QUEUES: 4
# ACTUAL_KEY_SIZE: 52
diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
index c118f803b6..d0225d0063 100644
--- a/dts/framework/testbed_model/linux_session.py
+++ b/dts/framework/testbed_model/linux_session.py
@@ -460,3 +460,7 @@ def configure_ipv4_forwarding(self, enable: bool) -> None:
"""Overrides :meth:`~.os_session.OSSession.configure_ipv4_forwarding`."""
state = 1 if enable else 0
self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", privileged=True)
+
+ def clean_up_vhost(self) -> None:
+ """Overrides :meth:`~.os_session.OSSession.clean_up_vhost`."""
+ self.send_command("rm -rf /tmp/vhost-net*", privileged=True)
diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py
index 4551c7fffe..7ffbf7d657 100644
--- a/dts/framework/testbed_model/os_session.py
+++ b/dts/framework/testbed_model/os_session.py
@@ -719,3 +719,7 @@ def get_pci_addr_of_crypto_vfs(self, pf_port: Port) -> list[str]:
A list containing all of the PCI addresses of the VFs on the port. If the port has no
VFs then the list will be empty.
"""
+
+ @abstractmethod
+ def clean_up_vhost(self) -> None:
+ """Deletes stale vhost-user Unix domain socket files."""
diff --git a/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
new file mode 100644
index 0000000000..558afc51f7
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
@@ -0,0 +1,467 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2026 University of New Hampshire
+
+"""Vhost-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding performance of DPDK's vhost-user PMD running on a
+single CPU core in a Physical-Virtual-Physical (PVP) topology. Performance is evaluated across
+multiple virtio-user backend options, including packed versus split ring formats, in-order packet
+processing, mergeable buffers, and SIMD vectorization. Test cases are parameterized using
+combinations of frame sizes, descriptor ring sizes, and target MPPS baselines specified in the
+test configuration. High-speed traffic is injected from an external generator through SUT physical
+interfaces, routed through Vhost and Virtio loops, and returned to the generator to measure
+aggregate MPPS.
+"""
+
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.testpmd import TestPmd
+from api.testpmd.config import (
+ Params,
+ PortTopology,
+ RXRingParams,
+ SimpleForwardingModes,
+ TXRingParams,
+)
+from framework.params.eal import VirtualDevice
+from framework.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from framework.test_suite import BaseConfig, TestSuite, perf_test
+
+
+class Config(BaseConfig):
+ """Performance test metrics."""
+
+ test_parameters: list[dict[str, int | float]] = [
+ {"frame_size": 64, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 128, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 256, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 512, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1024, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1518, "num_descriptors": 1024, "expected_mpps": 1.00},
+ ]
+ delta_tolerance: float = 0.05
+
+
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVhostSingleCorePerf(TestSuite):
+ """pvp multi paths vhost single core performance test suite."""
+
+ config: Config
+
+ def set_up_suite(self) -> None:
+ """Assign test parameters."""
+ self.test_parameters = self.config.test_parameters
+ self.delta_tolerance = self.config.delta_tolerance
+
+ def set_up_test_case(self) -> None:
+ """Delete stale vhost-user Unix domain socket files."""
+ self._ctx.sut_node.main_session.clean_up_vhost()
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ "queues=1,"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.test_parameters:
+ frame_size = params["frame_size"]
+ num_descriptors = params["num_descriptors"]
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2]),
+ "nb_cores": 1,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([3, 4, 5]),
+ "nb_cores": 2,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.mac)
+ virtio.set_forward_mode(SimpleForwardingModes.io)
+ vhost.set_portlist([0, 2, 1])
+
+ assert params["expected_mpps"] > 0, "Invalid expected mpps, must be greater than 0."
+ params["measured_mpps"] = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+ params["performance_delta"] = round(
+ (float(params["measured_mpps"]) - float(params["expected_mpps"]))
+ / float(params["expected_mpps"]),
+ 3,
+ )
+ params["pass"] = float(params["performance_delta"]) >= -self.delta_tolerance
+
+ self._produce_stats_table(self.test_parameters)
+ for params in self.test_parameters:
+ verify(
+ params["pass"] is True,
+ f"""Packets forwarded is less than {(1 - self.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[dict[str, int | float]]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print("-" * len(header))
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args={},
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {"rss": cast(RSSSetting, RSSSetting.SetIPOnly())}
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=1,
+ extra_args=extra_args,
+ )
--
2.55.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH v2 2/2] dts: add pvp multi paths virtio performance testsuite
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
@ 2026-10-08 19:11 ` Koushik Bhargav Nimoji
2026-10-19 18:58 ` Andrew Bailey
2026-10-19 18:36 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Andrew Bailey
` (4 subsequent siblings)
5 siblings, 1 reply; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-10-08 19:11 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths virtio single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with two and one core respectively,
and tests the virtio single core throughputperformance.
Depends-on: series-39456 ("dts: add pvp multi paths vhost performance")
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
...vp_multi_paths_virtio_single_core_perf.rst | 8 +
dts/configurations/tests_config.example.yaml | 12 +
...pvp_multi_paths_virtio_single_core_perf.py | 421 ++++++++++++++++++
3 files changed, 441 insertions(+)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
new file mode 100644
index 0000000000..853d04ad40
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_virtio_single_core_perf Test Suite
+==================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_virtio_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index f765526442..14715014fb 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -30,6 +30,18 @@ hello_world:
# num_descriptors: 1024
# expected_mpps: 1.0
# delta_tolerance: 0.05
+# pvp_multi_paths_virtio_single_core_forward_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
# pmd_rss:
# NUM_QUEUES: 4
# ACTUAL_KEY_SIZE: 52
diff --git a/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
new file mode 100644
index 0000000000..b18ec01a15
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
@@ -0,0 +1,421 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2025 University of New Hampshire
+
+"""Virtio-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding throughput of DPDK's virtio-user PMD running on a
+single CPU core. Performance is evaluated across multiple virtio path implementations, including
+packed versus split rings, in-order delivery, mergeable buffers, and SIMD vectorization.
+Test cases are parameterized using combinations of frame sizes, RX/TX descriptor ring counts,
+and target MPPS baselines specified in the test configuration. High-speed traffic is injected
+from an external generator through the physical host ports into the virtio-user instance,
+looped back, and returned to the generator. The aggregate MPPS processed by the single virtio
+core is verified against configured expected performance baselines to determine the test result.
+"""
+
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.testpmd import TestPmd
+from api.testpmd.config import PortTopology, RXRingParams, SimpleForwardingModes, TXRingParams
+from framework.params.eal import Params, VirtualDevice
+from framework.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from framework.test_suite import BaseConfig, TestSuite, perf_test
+
+
+class Config(BaseConfig):
+ """Performance test metrics."""
+
+ test_parameters: list[dict[str, int | float]] = [
+ {"frame_size": 64, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 128, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 256, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 512, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1024, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1518, "num_descriptors": 1024, "expected_mpps": 1.00},
+ ]
+ delta_tolerance: float = 0.05
+
+
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVirtioSingleCorePerf(TestSuite):
+ """pvp multi paths virtio single core performance test suite."""
+
+ config: Config
+
+ def set_up_suite(self) -> None:
+ """Assign test parameters."""
+ self.test_parameters = self.config.test_parameters
+ self.delta_tolerance = self.config.delta_tolerance
+
+ def set_up_test_case(self) -> None:
+ """Delete stale vhost-user Unix domain socket files."""
+ self._ctx.sut_node.main_session.clean_up_vhost()
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ queues: int = 1,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ queues: number of rx/tx queues allocated to virtio device.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice(f"net_vhost0,iface=/tmp/vhost-net,queues={queues}")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ f"queues={queues},"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.test_parameters:
+ frame_size = params["frame_size"]
+ num_descriptors = params["num_descriptors"]
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2, 3]),
+ "nb_cores": 2,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([4, 5]),
+ "nb_cores": 1,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.io)
+ virtio.set_forward_mode(SimpleForwardingModes.mac)
+ vhost.set_portlist([0, 2, 1])
+
+ assert params["expected_mpps"] > 0, "Invalid expected mpps, must be greater than 0."
+ params["measured_mpps"] = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+ params["performance_delta"] = round(
+ (float(params["measured_mpps"]) - float(params["expected_mpps"]))
+ / float(params["expected_mpps"]),
+ 3,
+ )
+ params["pass"] = float(params["performance_delta"]) >= -self.delta_tolerance
+
+ self._produce_stats_table(self.test_parameters)
+ for params in self.test_parameters:
+ verify(
+ params["pass"] is True,
+ f"""Packets forwarded is less than {(1 - self.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[dict[str, int | float]]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args={})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=1, extra_args=extra_args, queues=2
+ )
--
2.55.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH v2 1/2] dts: add pvp multi paths vhost performance testsuite
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
2026-10-08 19:11 ` [PATCH v2 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
@ 2026-10-19 18:36 ` Andrew Bailey
2026-10-20 17:30 ` [PATCH v3 " Koushik Bhargav Nimoji
` (3 subsequent siblings)
5 siblings, 0 replies; 28+ messages in thread
From: Andrew Bailey @ 2026-10-19 18:36 UTC (permalink / raw)
To: Koushik Bhargav Nimoji
Cc: luca.vizzarro, patrickrobb1997, dev, dladd, lylavoie
[-- Attachment #1: Type: text/plain, Size: 336 bytes --]
>
>
> +from framework.params.eal import VirtualDevice
> +from framework.params.types import LogicalCoreList, RSSSetting,
> TestPmdParamsDict
> +from framework.test_suite import BaseConfig, TestSuite, perf_test
>
Same issue as the 2/2 patch, Imports must be updated to import from api.
Reviewed-by: Andrew Bailey <abailey@iol.unh.edu>
[-- Attachment #2: Type: text/html, Size: 628 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v2 2/2] dts: add pvp multi paths virtio performance testsuite
2026-10-08 19:11 ` [PATCH v2 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
@ 2026-10-19 18:58 ` Andrew Bailey
0 siblings, 0 replies; 28+ messages in thread
From: Andrew Bailey @ 2026-10-19 18:58 UTC (permalink / raw)
To: Koushik Bhargav Nimoji
Cc: luca.vizzarro, patrickrobb1997, dev, dladd, lylavoie
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
>
>
>
> +from framework.params.eal import Params, VirtualDevice
> +from framework.params.types import LogicalCoreList, RSSSetting,
> TestPmdParamsDict
> +from framework.test_suite import BaseConfig, TestSuite, perf_test
The locations of these imports have been changed with the api refactor and
need to be updated here.
Fix these imports and this patch should be good.
Reviewed-by: Andrew Bailey <abailey@iol.unh.edu>
[-- Attachment #2: Type: text/html, Size: 768 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v3 1/2] dts: add pvp multi paths vhost performance testsuite
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
2026-10-08 19:11 ` [PATCH v2 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-10-19 18:36 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Andrew Bailey
@ 2026-10-20 17:30 ` Koushik Bhargav Nimoji
2026-10-20 17:30 ` [PATCH v3 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-10-29 16:53 ` [PATCH v3 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
2026-11-03 22:02 ` [PATCH v4 " Koushik Bhargav Nimoji
` (2 subsequent siblings)
5 siblings, 2 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-10-20 17:30 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths vhost single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with one and two cores respectively,
and tests the vhost single core throughput performance.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
...pvp_multi_paths_vhost_single_core_perf.rst | 8 +
dts/configurations/tests_config.example.yaml | 12 +
dts/framework/testbed_model/linux_session.py | 4 +
dts/framework/testbed_model/os_session.py | 4 +
..._pvp_multi_paths_vhost_single_core_perf.py | 467 ++++++++++++++++++
5 files changed, 495 insertions(+)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
new file mode 100644
index 0000000000..4fcc6b6c91
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_vhost_single_core_perf Test Suite
+=================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_vhost_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index ce67385b0b..f765526442 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -18,6 +18,18 @@ hello_world:
# num_descriptors: 1024
# expected_mpps: 1.0
# delta_tolerance: 0.05
+# pvp_multi_paths_vhost_single_core_forward_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
# pmd_rss:
# NUM_QUEUES: 4
# ACTUAL_KEY_SIZE: 52
diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
index 8cc0d09d01..b5cc0a78a9 100644
--- a/dts/framework/testbed_model/linux_session.py
+++ b/dts/framework/testbed_model/linux_session.py
@@ -460,3 +460,7 @@ def configure_ipv4_forwarding(self, enable: bool) -> None:
"""Overrides :meth:`~.os_session.OSSession.configure_ipv4_forwarding`."""
state = 1 if enable else 0
self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", privileged=True)
+
+ def clean_up_vhost(self) -> None:
+ """Overrides :meth:`~.os_session.OSSession.clean_up_vhost`."""
+ self.send_command("rm -rf /tmp/vhost-net*", privileged=True)
diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py
index 3f588acd44..a107bfdf1d 100644
--- a/dts/framework/testbed_model/os_session.py
+++ b/dts/framework/testbed_model/os_session.py
@@ -719,3 +719,7 @@ def get_pci_addr_of_crypto_vfs(self, pf_port: Port) -> list[str]:
A list containing all of the PCI addresses of the VFs on the port. If the port has no
VFs then the list will be empty.
"""
+
+ @abstractmethod
+ def clean_up_vhost(self) -> None:
+ """Deletes stale vhost-user Unix domain socket files."""
diff --git a/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
new file mode 100644
index 0000000000..bc220b34b9
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
@@ -0,0 +1,467 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2026 University of New Hampshire
+
+"""Vhost-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding performance of DPDK's vhost-user PMD running on a
+single CPU core in a Physical-Virtual-Physical (PVP) topology. Performance is evaluated across
+multiple virtio-user backend options, including packed versus split ring formats, in-order packet
+processing, mergeable buffers, and SIMD vectorization. Test cases are parameterized using
+combinations of frame sizes, descriptor ring sizes, and target MPPS baselines specified in the
+test configuration. High-speed traffic is injected from an external generator through SUT physical
+interfaces, routed through Vhost and Virtio loops, and returned to the generator to measure
+aggregate MPPS.
+"""
+
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.params.eal import VirtualDevice
+from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.test_suite import BaseConfig, TestSuite, perf_test
+from api.testpmd import TestPmd
+from api.testpmd.config import (
+ Params,
+ PortTopology,
+ RXRingParams,
+ SimpleForwardingModes,
+ TXRingParams,
+)
+
+
+class Config(BaseConfig):
+ """Performance test metrics."""
+
+ test_parameters: list[dict[str, int | float]] = [
+ {"frame_size": 64, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 128, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 256, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 512, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1024, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1518, "num_descriptors": 1024, "expected_mpps": 1.00},
+ ]
+ delta_tolerance: float = 0.05
+
+
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVhostSingleCorePerf(TestSuite):
+ """pvp multi paths vhost single core performance test suite."""
+
+ config: Config
+
+ def set_up_suite(self) -> None:
+ """Assign test parameters."""
+ self.test_parameters = self.config.test_parameters
+ self.delta_tolerance = self.config.delta_tolerance
+
+ def set_up_test_case(self) -> None:
+ """Delete stale vhost-user Unix domain socket files."""
+ self._ctx.sut_node.main_session.clean_up_vhost()
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ "queues=1,"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.test_parameters:
+ frame_size = params["frame_size"]
+ num_descriptors = params["num_descriptors"]
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2]),
+ "nb_cores": 1,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([3, 4, 5]),
+ "nb_cores": 2,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.mac)
+ virtio.set_forward_mode(SimpleForwardingModes.io)
+ vhost.set_portlist([0, 2, 1])
+
+ assert params["expected_mpps"] > 0, "Invalid expected mpps, must be greater than 0."
+ params["measured_mpps"] = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+ params["performance_delta"] = round(
+ (float(params["measured_mpps"]) - float(params["expected_mpps"]))
+ / float(params["expected_mpps"]),
+ 3,
+ )
+ params["pass"] = float(params["performance_delta"]) >= -self.delta_tolerance
+
+ self._produce_stats_table(self.test_parameters)
+ for params in self.test_parameters:
+ verify(
+ params["pass"] is True,
+ f"""Packets forwarded is less than {(1 - self.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[dict[str, int | float]]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print("-" * len(header))
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args={},
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {"rss": cast(RSSSetting, RSSSetting.SetIPOnly())}
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=1,
+ extra_args=extra_args,
+ )
--
2.55.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH v3 2/2] dts: add pvp multi paths virtio performance testsuite
2026-10-20 17:30 ` [PATCH v3 " Koushik Bhargav Nimoji
@ 2026-10-20 17:30 ` Koushik Bhargav Nimoji
2026-10-29 17:01 ` Luca Vizzarro
2026-10-29 16:53 ` [PATCH v3 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
1 sibling, 1 reply; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-10-20 17:30 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths virtio single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with two and one core respectively,
and tests the virtio single core throughputperformance.
Depends-on: series-39456 ("dts: add pvp multi paths vhost performance")
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
...vp_multi_paths_virtio_single_core_perf.rst | 8 +
dts/configurations/tests_config.example.yaml | 12 +
...pvp_multi_paths_virtio_single_core_perf.py | 421 ++++++++++++++++++
3 files changed, 441 insertions(+)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
new file mode 100644
index 0000000000..853d04ad40
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_virtio_single_core_perf Test Suite
+==================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_virtio_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index f765526442..14715014fb 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -30,6 +30,18 @@ hello_world:
# num_descriptors: 1024
# expected_mpps: 1.0
# delta_tolerance: 0.05
+# pvp_multi_paths_virtio_single_core_forward_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
# pmd_rss:
# NUM_QUEUES: 4
# ACTUAL_KEY_SIZE: 52
diff --git a/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
new file mode 100644
index 0000000000..b5397074e0
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
@@ -0,0 +1,421 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2025 University of New Hampshire
+
+"""Virtio-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding throughput of DPDK's virtio-user PMD running on a
+single CPU core. Performance is evaluated across multiple virtio path implementations, including
+packed versus split rings, in-order delivery, mergeable buffers, and SIMD vectorization.
+Test cases are parameterized using combinations of frame sizes, RX/TX descriptor ring counts,
+and target MPPS baselines specified in the test configuration. High-speed traffic is injected
+from an external generator through the physical host ports into the virtio-user instance,
+looped back, and returned to the generator. The aggregate MPPS processed by the single virtio
+core is verified against configured expected performance baselines to determine the test result.
+"""
+
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.params.eal import Params, VirtualDevice
+from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.test_suite import BaseConfig, TestSuite, perf_test
+from api.testpmd import TestPmd
+from api.testpmd.config import PortTopology, RXRingParams, SimpleForwardingModes, TXRingParams
+
+
+class Config(BaseConfig):
+ """Performance test metrics."""
+
+ test_parameters: list[dict[str, int | float]] = [
+ {"frame_size": 64, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 128, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 256, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 512, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1024, "num_descriptors": 1024, "expected_mpps": 1.00},
+ {"frame_size": 1518, "num_descriptors": 1024, "expected_mpps": 1.00},
+ ]
+ delta_tolerance: float = 0.05
+
+
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVirtioSingleCorePerf(TestSuite):
+ """pvp multi paths virtio single core performance test suite."""
+
+ config: Config
+
+ def set_up_suite(self) -> None:
+ """Assign test parameters."""
+ self.test_parameters = self.config.test_parameters
+ self.delta_tolerance = self.config.delta_tolerance
+
+ def set_up_test_case(self) -> None:
+ """Delete stale vhost-user Unix domain socket files."""
+ self._ctx.sut_node.main_session.clean_up_vhost()
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ queues: int = 1,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ queues: number of rx/tx queues allocated to virtio device.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice(f"net_vhost0,iface=/tmp/vhost-net,queues={queues}")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ f"queues={queues},"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.test_parameters:
+ frame_size = params["frame_size"]
+ num_descriptors = params["num_descriptors"]
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2, 3]),
+ "nb_cores": 2,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([4, 5]),
+ "nb_cores": 1,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.io)
+ virtio.set_forward_mode(SimpleForwardingModes.mac)
+ vhost.set_portlist([0, 2, 1])
+
+ assert params["expected_mpps"] > 0, "Invalid expected mpps, must be greater than 0."
+ params["measured_mpps"] = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+ params["performance_delta"] = round(
+ (float(params["measured_mpps"]) - float(params["expected_mpps"]))
+ / float(params["expected_mpps"]),
+ 3,
+ )
+ params["pass"] = float(params["performance_delta"]) >= -self.delta_tolerance
+
+ self._produce_stats_table(self.test_parameters)
+ for params in self.test_parameters:
+ verify(
+ params["pass"] is True,
+ f"""Packets forwarded is less than {(1 - self.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[dict[str, int | float]]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args={})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=1, extra_args=extra_args, queues=2
+ )
--
2.55.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [RFC PATCH] dts: add pvp multi paths virtio performance testsuite
2026-09-01 18:37 [RFC PATCH] dts: add pvp multi paths virtio performance testsuite Koushik Bhargav Nimoji
2026-09-03 20:11 ` [PATCH v1] " Koushik Bhargav Nimoji
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
@ 2026-10-20 18:20 ` Koushik Bhargav Nimoji
2 siblings, 0 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-10-20 18:20 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997, dev; +Cc: dladd, abailey, lylavoie
[-- Attachment #1: Type: text/plain, Size: 19386 bytes --]
Recheck-request:intel-Testing
On Tue, Sep 1, 2026 at 2:37 PM Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
wrote:
> This patch adds the pvp multi paths virtio single core forward
> performance testsuite, which launches testpmd using the vhost
> and virtio virtual devices with two and one core respectively,
> and tests the virtio single core throughputperformance.
>
> Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
> ---
> ...ti_paths_virtio_single_core_performance.py | 399 ++++++++++++++++++
> 1 file changed, 399 insertions(+)
> create mode 100644
> dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
>
> diff --git
> a/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
> b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
> new file mode 100644
> index 0000000000..aefc29facf
> --- /dev/null
> +++ b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py
> @@ -0,0 +1,399 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2025 University of New Hampshire
> +
> +"""Virtio-user single-core forwarding performance test suite.
> +
> +This suite measures the packet forwarding throughput of DPDK's
> virtio-user PMD running on a
> +single CPU core. Performance is evaluated across multiple virtio path
> implementations, including
> +packed versus split rings, in-order delivery, mergeable buffers, and SIMD
> vectorization.
> +Test cases are parameterized using combinations of frame sizes, RX/TX
> descriptor ring counts,
> +and target MPPS baselines specified in the test configuration. High-speed
> traffic is injected
> +from an external generator through the physical host ports into the
> virtio-user instance,
> +looped back, and returned to the generator. The aggregate MPPS processed
> by the single virtio
> +core is verified against configured expected performance baselines to
> determine the test result.
> +"""
> +
> +from scapy.layers.inet import IP
> +from scapy.layers.l2 import Ether
> +from scapy.packet import Raw
> +
> +from api.capabilities import (
> + LinkTopology,
> + requires_link_topology,
> +)
> +from api.packet import assess_performance_by_packet
> +from api.test import verify, write_performance_json
> +from api.testpmd import TestPmd
> +from api.testpmd.config import PortTopology, RXRingParams,
> SimpleForwardingModes, TXRingParams
> +from framework.params.eal import VirtualDevice
> +from framework.params.types import LogicalCoreList, RSSSetting,
> TestPmdParamsDict
> +from framework.test_suite import BaseConfig, TestSuite, perf_test
> +
> +
> +class Config(BaseConfig):
> + """Performance test metrics."""
> +
> + test_parameters: list[dict[str, int | float]] = [
> + {"frame_size": 64, "num_descriptors": 1024, "expected_mpps":
> 1.00},
> + {"frame_size": 128, "num_descriptors": 1024, "expected_mpps":
> 1.00},
> + {"frame_size": 256, "num_descriptors": 1024, "expected_mpps":
> 1.00},
> + {"frame_size": 512, "num_descriptors": 1024, "expected_mpps":
> 1.00},
> + {"frame_size": 1024, "num_descriptors": 1024, "expected_mpps":
> 1.00},
> + {"frame_size": 1518, "num_descriptors": 1024, "expected_mpps":
> 1.00},
> + ]
> + delta_tolerance: float = 0.05
> +
> +
> +@requires_link_topology(LinkTopology.TWO_LINKS)
> +class TestPvpMultiPathsVirtioSingleCorePerformance(TestSuite):
> + """pvp multi paths virtio single core performance test suite."""
> +
> + config: Config
> +
> + def set_up_suite(self):
> + """Assign test parameters."""
> + self.test_parameters = self.config.test_parameters
> + self.delta_tolerance = self.config.delta_tolerance
> +
> + def set_up_test_case(self):
> + """Delete stale vhost-user Unix domain socket files."""
> + self._ctx.sut_node.main_session.send_command("rm -rf
> /tmp/vhost-net*", privileged=True)
> +
> + def _transmit(
> + self, vhost: TestPmd, virtio: TestPmd, frame_size: int,
> repetitions: int = 1
> + ) -> float:
> + """Create a testpmd session with every rule in the given list,
> verify jump behavior.
> +
> + Args:
> + vhost: the running vhost testpmd shell.
> + virtio: the running virtio testpmd shell.
> + frame_size: The size of the frame to transmit.
> + repetitions: The number of times to rerun the transmission.
> +
> + Returns:
> + The MPPS (millions of packets per second) forwarded by the
> SUT.
> + """
> + assert repetitions > 0, "Invalid number of repetitions given."
> + # Build packet with dummy values, and account for the 14B and 20B
> Ether and IP headers
> + packet = (
> + Ether(src="52:00:00:00:00:00")
> + / IP(src="1.2.3.4", dst="192.18.1.0")
> + / Raw(load="x" * (frame_size - 14 - 20))
> + )
> +
> + vhost.start()
> + virtio.start()
> + rx_avg = 0.0
> +
> + for _ in range(repetitions):
> + # Transmit for 5 seconds.
> + stats = assess_performance_by_packet(packet=packet,
> duration=5)
> + rx_avg += stats.rx_pps
> + return rx_avg / (repetitions * 1_000_000)
> +
> + def _create_and_transmit(
> + self,
> + ring_format: int,
> + in_order: int,
> + buffers: int,
> + vectorized: int,
> + extra_args: TestPmdParamsDict,
> + ):
> + """Create testpmd instance with specified params and send
> traffic."""
> + sut_dpdk_driver =
> self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
> + vhost_user_vdev =
> VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
> + virtio_user_vdev = VirtualDevice(
> + "net_virtio_user0,"
> + "mac=00:11:22:33:44:10,"
> + "path=/tmp/vhost-net,"
> + "queues=1,"
> + f"packed_vq={ring_format},"
> + f"mrg_rxbuf={buffers},"
> + f"in_order={in_order},"
> + f"vectorized={vectorized}"
> + )
> +
> + for params in self.test_parameters:
> + frame_size = params["frame_size"]
> + num_descriptors = params["num_descriptors"]
> +
> + default_args = {
> + "tx_ring": TXRingParams(descriptors=num_descriptors),
> + "rx_ring": RXRingParams(descriptors=num_descriptors),
> + }
> +
> + if sut_dpdk_driver == "mlx5_core":
> + default_args["burst"] = 64
> + default_args["mbcache"] = 512
> + elif sut_dpdk_driver == "i40e":
> + default_args["rx_queues"] = 1
> + default_args["tx_queues"] = 1
> +
> + with (
> + TestPmd(
> + prefix="vhost",
> + allowed_ports=[],
> + memory_channels=4,
> + port_topology=PortTopology.chained,
> + vdevs=[vhost_user_vdev],
> + lcore_list=LogicalCoreList([1, 2, 3]),
> + nb_cores=2,
> + **default_args,
> + ) as vhost,
> + TestPmd(
> + prefix="virtio",
> + no_pci=True,
> + memory_channels=4,
> + allowed_ports=[],
> + vdevs=[virtio_user_vdev],
> + lcore_list=LogicalCoreList([4, 5]),
> + nb_cores=1,
> + **extra_args,
> + **default_args,
> + ) as virtio,
> + ):
> + vhost.set_forward_mode(SimpleForwardingModes.io)
> + virtio.set_forward_mode(SimpleForwardingModes.mac)
> + vhost.set_portlist([0, 2, 1])
> +
> + params["measured_mpps"] = round(
> + self._transmit(vhost, virtio, frame_size,
> repetitions=5), 3
> + )
> + params["performance_delta"] = round(
> + (float(params["measured_mpps"]) -
> float(params["expected_mpps"]))
> + / float(params["expected_mpps"]),
> + 3,
> + )
> + params["pass"] = float(params["performance_delta"]) >=
> -self.delta_tolerance
> +
> + self._produce_stats_table(self.test_parameters)
> + for params in self.test_parameters:
> + verify(
> + params["pass"] is True,
> + f"""Packets forwarded is less than {(1 -
> self.delta_tolerance) * 100}%
> + of the expected baseline.
> + Measured MPPS = {params["measured_mpps"]}
> + Expected MPPS = {params["expected_mpps"]}""",
> + )
> +
> + def _produce_stats_table(self, test_parameters: list[dict[str, int |
> float]]) -> None:
> + """Display performance results in table format and write to
> structured JSON file.
> +
> + Args:
> + test_parameters: The expected and real stats per set of test
> parameters.
> + """
> + header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real
> MPPS':>12} | {'Expected MPPS':>14}"
> + print("-" * len(header))
> + print(header)
> + print("-" * len(header))
> + for params in test_parameters:
> + print(f"{params['frame_size']:>12} |
> {params['num_descriptors']:>12} | ", end="")
> + print(f"{params['measured_mpps']:>12} |
> {params['expected_mpps']:>14}")
> + print("-" * len(header))
> +
> + write_performance_json({"results": test_parameters})
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio11_mergeable(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: ring_format=1, buffers=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {
> + "tx_offloads": 0,
> + "enable_hw_vlan_strip": True,
> + "rss": RSSSetting.SetIPOnly(),
> + }
> + self._create_and_transmit(
> + ring_format=1, buffers=1, in_order=0, vectorized=0,
> extra_args=extra_args
> + )
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio11_non_mergeable(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: ring_format=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {
> + "tx_offloads": 0,
> + "enable_hw_vlan_strip": True,
> + "rss": RSSSetting.SetIPOnly(),
> + }
> + self._create_and_transmit(
> + ring_format=1, buffers=0, in_order=0, vectorized=0,
> extra_args=extra_args
> + )
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio_inorder_mergeable(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: buffers=1, in_order=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {
> + "tx_offloads": 0,
> + "enable_hw_vlan_strip": True,
> + "rss": RSSSetting.SetIPOnly(),
> + }
> + self._create_and_transmit(
> + ring_format=0, buffers=1, in_order=1, vectorized=0,
> extra_args=extra_args
> + )
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: in_order=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {
> + "tx_offloads": 0,
> + "enable_hw_vlan_strip": True,
> + "rss": RSSSetting.SetIPOnly(),
> + }
> + self._create_and_transmit(
> + ring_format=0, buffers=0, in_order=1, vectorized=0,
> extra_args=extra_args
> + )
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio_mergeable(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: buffers=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {
> + "tx_offloads": 0,
> + "enable_hw_vlan_strip": True,
> + "rss": RSSSetting.SetIPOnly(),
> + }
> + self._create_and_transmit(
> + ring_format=0, buffers=1, in_order=0, vectorized=0,
> extra_args=extra_args
> + )
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio_nonmergeable(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: vectorized=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {
> + "tx_offloads": 0,
> + "enable_hw_vlan_strip": True,
> + "rss": RSSSetting.SetIPOnly(),
> + }
> + self._create_and_transmit(
> + ring_format=0, buffers=0, in_order=0, vectorized=1,
> extra_args=extra_args
> + )
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio_vectorized(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: buffers=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + self._create_and_transmit(ring_format=0, buffers=1, in_order=0,
> vectorized=0, extra_args={})
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio11_inorder_mergeable(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: ring_format=1, buffers=1,
> in_order=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {
> + "tx_offloads": 0,
> + "enable_hw_vlan_strip": True,
> + "rss": RSSSetting.SetIPOnly(),
> + }
> + self._create_and_transmit(
> + ring_format=1, buffers=1, in_order=1, vectorized=0,
> extra_args=extra_args
> + )
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: ring_format=1, in_order=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {"rss": RSSSetting.SetIPOnly()}
> + self._create_and_transmit(
> + ring_format=1, buffers=0, in_order=1, vectorized=0,
> extra_args=extra_args
> + )
> +
> + @perf_test
> + def test_perf_vhost_single_core_virtio11_vectorized(self):
> + """Validate expected single core forwarding performance.
> +
> + Steps:
> + * Set TestPMD virtio parameters: ring_format=1, in_order=1,
> vectorized=1.
> + * Create a packet according to the frame size specified in
> the test config.
> + * Transmit from the traffic generator's ports 0 and 1 at
> above the expect.
> + * Forward on TestPMD's interfaces 0 and 1 with 1 core.
> +
> + Verify:
> + * The resulting MPPS forwarded is greater than
> expected_mpps*(1-delta_tolerance).
> + """
> + extra_args: TestPmdParamsDict = {"rss": RSSSetting.SetIPOnly()}
> + self._create_and_transmit(
> + ring_format=1, buffers=0, in_order=1, vectorized=1,
> extra_args=extra_args
> + )
> --
> 2.55.0
>
>
[-- Attachment #2: Type: text/html, Size: 23615 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v3 1/2] dts: add pvp multi paths vhost performance testsuite
2026-10-20 17:30 ` [PATCH v3 " Koushik Bhargav Nimoji
2026-10-20 17:30 ` [PATCH v3 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
@ 2026-10-29 16:53 ` Luca Vizzarro
2026-11-03 20:28 ` Koushik Bhargav Nimoji
1 sibling, 1 reply; 28+ messages in thread
From: Luca Vizzarro @ 2026-10-29 16:53 UTC (permalink / raw)
To: Koushik Bhargav Nimoji, patrickrobb1997; +Cc: dev, dladd, abailey, lylavoie
Hi Koushik,
thank you for the wait!
On 20/10/2026 18:30, Koushik Bhargav Nimoji wrote:
> This patch adds the pvp multi paths vhost single core forward
> performance testsuite, which launches testpmd using the vhost
> and virtio virtual devices with one and two cores respectively,
> and tests the vhost single core throughput performance.
>
> Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
> ---
> ...pvp_multi_paths_vhost_single_core_perf.rst | 8 +
> dts/configurations/tests_config.example.yaml | 12 +
> dts/framework/testbed_model/linux_session.py | 4 +
> dts/framework/testbed_model/os_session.py | 4 +
> ..._pvp_multi_paths_vhost_single_core_perf.py | 467 ++++++++++++++++++
> 5 files changed, 495 insertions(+)
> create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
> create mode 100644 dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
>
> diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
> new file mode 100644
> index 0000000000..4fcc6b6c91
> --- /dev/null
> +++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
> @@ -0,0 +1,8 @@
> +.. SPDX-License-Identifier: BSD-3-Clause
> +
> +pvp_multi_paths_vhost_single_core_perf Test Suite
> +=================================================
> +
> +.. automodule:: tests.TestSuite_pvp_multi_paths_vhost_single_core_perf
> + :members:
> + :show-inheritance:
> diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
> index ce67385b0b..f765526442 100644
> --- a/dts/configurations/tests_config.example.yaml
> +++ b/dts/configurations/tests_config.example.yaml
> @@ -18,6 +18,18 @@ hello_world:
> # num_descriptors: 1024
> # expected_mpps: 1.0
> # delta_tolerance: 0.05
> +# pvp_multi_paths_vhost_single_core_forward_perf:
Is this meant to be:
pvp_multi_paths_vhost_single_core_perf
> +# test_parameters: # Add frame size / descriptor count combinations as needed
> +# - frame_size: 64
> +# num_descriptors: 512
> +# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
> +# - frame_size: 64
> +# num_descriptors: 1024
> +# expected_mpps: 1.0
> +# - frame_size: 512
> +# num_descriptors: 1024
> +# expected_mpps: 1.0
> +# delta_tolerance: 0.05
> # pmd_rss:
> # NUM_QUEUES: 4
> # ACTUAL_KEY_SIZE: 52
> diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
> index 8cc0d09d01..b5cc0a78a9 100644
> --- a/dts/framework/testbed_model/linux_session.py
> +++ b/dts/framework/testbed_model/linux_session.py
> @@ -460,3 +460,7 @@ def configure_ipv4_forwarding(self, enable: bool) -> None:
> """Overrides :meth:`~.os_session.OSSession.configure_ipv4_forwarding`."""
> state = 1 if enable else 0
> self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", privileged=True)
> +
> + def clean_up_vhost(self) -> None:
> + """Overrides :meth:`~.os_session.OSSession.clean_up_vhost`."""
> + self.send_command("rm -rf /tmp/vhost-net*", privileged=True)
I am not particularly pleased with the idea of deleting every
vhost-net*, just thinking in case this would disrupt any other
application. Would there be any better way of doing this?
> diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py
> index 3f588acd44..a107bfdf1d 100644
> --- a/dts/framework/testbed_model/os_session.py
> +++ b/dts/framework/testbed_model/os_session.py
> @@ -719,3 +719,7 @@ def get_pci_addr_of_crypto_vfs(self, pf_port: Port) -> list[str]:
> A list containing all of the PCI addresses of the VFs on the port. If the port has no
> VFs then the list will be empty.
> """
> +
> + @abstractmethod
> + def clean_up_vhost(self) -> None:
> + """Deletes stale vhost-user Unix domain socket files."""
> diff --git a/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
> new file mode 100644
> index 0000000000..bc220b34b9
> --- /dev/null
> +++ b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
> @@ -0,0 +1,467 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2026 University of New Hampshire
> +
> +"""Vhost-user single-core forwarding performance test suite.
> +
> +This suite measures the packet forwarding performance of DPDK's vhost-user PMD running on a
> +single CPU core in a Physical-Virtual-Physical (PVP) topology. Performance is evaluated across
> +multiple virtio-user backend options, including packed versus split ring formats, in-order packet
> +processing, mergeable buffers, and SIMD vectorization. Test cases are parameterized using
> +combinations of frame sizes, descriptor ring sizes, and target MPPS baselines specified in the
> +test configuration. High-speed traffic is injected from an external generator through SUT physical
> +interfaces, routed through Vhost and Virtio loops, and returned to the generator to measure
> +aggregate MPPS.
> +"""
> +
> +from typing import cast
> +
> +from scapy.layers.inet import IP
> +from scapy.layers.l2 import Ether
> +from scapy.packet import Raw
> +
> +from api.capabilities import (
> + LinkTopology,
> + requires_link_topology,
> +)
> +from api.packet import assess_performance_by_packet
> +from api.params.eal import VirtualDevice
> +from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
> +from api.test import get_current_test_case_name, verify, write_performance_json
> +from api.test_suite import BaseConfig, TestSuite, perf_test
> +from api.testpmd import TestPmd
> +from api.testpmd.config import (
> + Params,
> + PortTopology,
> + RXRingParams,
> + SimpleForwardingModes,
> + TXRingParams,
> +)
> +
> +
> +class Config(BaseConfig):
> + """Performance test metrics."""
> +
> + test_parameters: list[dict[str, int | float]] = [
dict[str, int | float] is too permissive.
/If you require the keys to be these ones then you need to explicitly
specify them otherwise the parser will happily validate junk. Just a
TypedDict will do the job here:
class TestParameter(TypedDict):
frame_size: int
...
> + {"frame_size": 64, "num_descriptors": 1024, "expected_mpps": 1.00},
> + {"frame_size": 128, "num_descriptors": 1024, "expected_mpps": 1.00},
> + {"frame_size": 256, "num_descriptors": 1024, "expected_mpps": 1.00},
> + {"frame_size": 512, "num_descriptors": 1024, "expected_mpps": 1.00},
> + {"frame_size": 1024, "num_descriptors": 1024, "expected_mpps": 1.00},
> + {"frame_size": 1518, "num_descriptors": 1024, "expected_mpps": 1.00},
> + ]
> + delta_tolerance: float = 0.05
> +
> +
> +@requires_link_topology(LinkTopology.TWO_LINKS)
> +class TestPvpMultiPathsVhostSingleCorePerf(TestSuite):
> + """pvp multi paths vhost single core performance test suite."""
> +
> + config: Config
> +
> + def set_up_suite(self) -> None:
> + """Assign test parameters."""
> + self.test_parameters = self.config.test_parameters
> + self.delta_tolerance = self.config.delta_tolerance
> +
> + def set_up_test_case(self) -> None:
> + """Delete stale vhost-user Unix domain socket files."""
> + self._ctx.sut_node.main_session.clean_up_vhost()
A test suite should not access the context from _ctx. This is more like
meant to be __ctx, but due to some old rules we agreed to only stick to
_ctx. Basically anything private or protected shouldn't be used in test
suites. TestSuite provides all helpers etc just for the actual test suite.
Finally, ideally main_session shouldn't be accessed by test suites
either but interfaces that serve the test suites. So the API, as the
internal specification is bound to change we need to have a consistent API.
> + def _create_and_transmit(
> + self,
> + ring_format: int,
> + in_order: int,
> + buffers: int,
> + vectorized: int,
> + extra_args: TestPmdParamsDict,
> + ) -> None:
> + """Create testpmd instances with specified params and send traffic.
> +
> + Args:
> + ring_format: selects the virtio queue descriptor layout.
> + in_order: toggles in-order packet processing.
> + buffers: enables mergeable rx buffers.
> + vectorized: enables SIMD vectorized rx/tx data paths.
> + extra_args: extra/generic TestPmd arguments.
> + """
> + sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
> + vhost_user_vdev = VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
> + virtio_user_vdev = VirtualDevice(
> + "net_virtio_user0,"
> + "mac=00:11:22:33:44:10,"
> + "path=/tmp/vhost-net,"
> + "queues=1,"
> + f"packed_vq={ring_format},"
> + f"mrg_rxbuf={buffers},"
> + f"in_order={in_order},"
> + f"vectorized={vectorized}"
> + )
> +
> + for params in self.test_parameters:
> + frame_size = params["frame_size"]
> + num_descriptors = params["num_descriptors"]
> +
> + default_args: TestPmdParamsDict = {
> + "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
> + "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
> + }
> +
> + if sut_dpdk_driver == "mlx5_core":
> + default_args["burst"] = 64
> + default_args["mbcache"] = 512
> + elif sut_dpdk_driver == "i40e":
> + default_args["rx_queues"] = 1
> + default_args["tx_queues"] = 1
This could be a problematic bit as we tried our best in the past to make
test suites as driver-agnostic as possible. Would these undermine that
ability? Perhaps a comment is needed here.
> +
> + vhost_params: TestPmdParamsDict = {
> + "prefix": "vhost",
> + "allowed_ports": [],
> + "memory_channels": 4,
> + "port_topology": PortTopology.chained,
> + "vdevs": [vhost_user_vdev],
> + "lcore_list": LogicalCoreList([1, 2]),
> + "nb_cores": 1,
> + **default_args,
> + }
> +
> + virtio_params: TestPmdParamsDict = {
> + "prefix": "virtio",
> + "no_pci": True,
> + "memory_channels": 4,
> + "allowed_ports": [],
> + "vdevs": [virtio_user_vdev],
> + "lcore_list": LogicalCoreList([3, 4, 5]),
> + "nb_cores": 2,
> + **extra_args,
> + **default_args,
> + }
> +
> + with (
> + TestPmd(**vhost_params) as vhost,
> + TestPmd(**virtio_params) as virtio,
> + ):
> + vhost.set_forward_mode(SimpleForwardingModes.mac)
> + virtio.set_forward_mode(SimpleForwardingModes.io)
> + vhost.set_portlist([0, 2, 1])
> +
> + assert params["expected_mpps"] > 0, "Invalid expected mpps, must be greater than 0."
> + params["measured_mpps"] = round(
> + self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
> + )
> + params["performance_delta"] = round(
> + (float(params["measured_mpps"]) - float(params["expected_mpps"]))
> + / float(params["expected_mpps"]),
> + 3,
> + )
> + params["pass"] = float(params["performance_delta"]) >= -self.delta_tolerance
> +
> + self._produce_stats_table(self.test_parameters)
> + for params in self.test_parameters:
> + verify(
> + params["pass"] is True,
> + f"""Packets forwarded is less than {(1 - self.delta_tolerance) * 100}%
> + of the expected baseline.
> + Measured MPPS = {params["measured_mpps"]}
> + Expected MPPS = {params["expected_mpps"]}""",
> + )
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v3 2/2] dts: add pvp multi paths virtio performance testsuite
2026-10-20 17:30 ` [PATCH v3 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
@ 2026-10-29 17:01 ` Luca Vizzarro
2026-11-03 15:37 ` Koushik Bhargav Nimoji
0 siblings, 1 reply; 28+ messages in thread
From: Luca Vizzarro @ 2026-10-29 17:01 UTC (permalink / raw)
To: Koushik Bhargav Nimoji, patrickrobb1997; +Cc: dev, dladd, abailey, lylavoie
I am a bit loss here. Is this a duplicate of 1/2?
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v3 2/2] dts: add pvp multi paths virtio performance testsuite
2026-10-29 17:01 ` Luca Vizzarro
@ 2026-11-03 15:37 ` Koushik Bhargav Nimoji
2026-11-03 15:47 ` Luca Vizzarro
0 siblings, 1 reply; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-03 15:37 UTC (permalink / raw)
To: Luca Vizzarro; +Cc: patrickrobb1997, dev, dladd, abailey, lylavoie
[-- Attachment #1: Type: text/plain, Size: 437 bytes --]
Hi Luca, this is the virtio single core performance test suite, very
similar to the vhost single core performance test suite. The difference
between the two is that in this test suite the virtio virtual device is
provided one core while the vhost is provided two cores, and vice versa in
the vhost single core performance test suite. I will apply the changes
mentioned in the 1/2 in this patch as well, and send new versions in
shortly.
[-- Attachment #2: Type: text/html, Size: 463 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v3 2/2] dts: add pvp multi paths virtio performance testsuite
2026-11-03 15:37 ` Koushik Bhargav Nimoji
@ 2026-11-03 15:47 ` Luca Vizzarro
0 siblings, 0 replies; 28+ messages in thread
From: Luca Vizzarro @ 2026-11-03 15:47 UTC (permalink / raw)
To: Koushik Bhargav Nimoji; +Cc: patrickrobb1997, dev, dladd, abailey, lylavoie
On 03/11/2026 15:37, Koushik Bhargav Nimoji wrote:
> Hi Luca, this is the virtio single core performance test suite, very
> similar to the vhost single core performance test suite. The difference
> between the two is that in this test suite the virtio virtual device is
> provided one core while the vhost is provided two cores, and vice versa
> in the vhost single core performance test suite. I will apply the
> changes mentioned in the 1/2 in this patch as well, and send new
> versions in shortly.
Oh, alright! Thank you for clarifying! The difference was so subtle I
struggled to notice! In that case the comments I made for the vhost
patches apply here too as, as you picked up already.
Luca
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v3 1/2] dts: add pvp multi paths vhost performance testsuite
2026-10-29 16:53 ` [PATCH v3 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
@ 2026-11-03 20:28 ` Koushik Bhargav Nimoji
0 siblings, 0 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-03 20:28 UTC (permalink / raw)
To: Luca Vizzarro; +Cc: patrickrobb1997, dev, dladd, abailey, lylavoie
[-- Attachment #1: Type: text/plain, Size: 4095 bytes --]
>
> > diff --git a/dts/framework/testbed_model/linux_session.py
> b/dts/framework/testbed_model/linux_session.py
> > index 8cc0d09d01..b5cc0a78a9 100644
> > --- a/dts/framework/testbed_model/linux_session.py
> > +++ b/dts/framework/testbed_model/linux_session.py
> > @@ -460,3 +460,7 @@ def configure_ipv4_forwarding(self, enable: bool) ->
> None:
> > """Overrides
> :meth:`~.os_session.OSSession.configure_ipv4_forwarding`."""
> > state = 1 if enable else 0
> > self.send_command(f"sysctl -w net.ipv4.ip_forward={state}",
> privileged=True)
> > +
> > + def clean_up_vhost(self) -> None:
> > + """Overrides :meth:`~.os_session.OSSession.clean_up_vhost`."""
> > + self.send_command("rm -rf /tmp/vhost-net*", privileged=True)
>
> I am not particularly pleased with the idea of deleting every
> vhost-net*, just thinking in case this would disrupt any other
> application. Would there be any better way of doing this?
>
>
The command should not interfere with other vhost-net files, as I point
specifically at the /tmp/vhost-net directory when creating the socket files
for the virtual devices in this specific testsuite. This was also the
command specified in the pvp_multi_paths_vhost_single_core_perf test plan,
so I believe it wouldn't affect other virtual devices.
> > + def _create_and_transmit(
> > + self,
> > + ring_format: int,
> > + in_order: int,
> > + buffers: int,
> > + vectorized: int,
> > + extra_args: TestPmdParamsDict,
> > + ) -> None:
> > + """Create testpmd instances with specified params and send
> traffic.
> > +
> > + Args:
> > + ring_format: selects the virtio queue descriptor layout.
> > + in_order: toggles in-order packet processing.
> > + buffers: enables mergeable rx buffers.
> > + vectorized: enables SIMD vectorized rx/tx data paths.
> > + extra_args: extra/generic TestPmd arguments.
> > + """
> > + sut_dpdk_driver =
> self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
> > + vhost_user_vdev =
> VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
> > + virtio_user_vdev = VirtualDevice(
> > + "net_virtio_user0,"
> > + "mac=00:11:22:33:44:10,"
> > + "path=/tmp/vhost-net,"
> > + "queues=1,"
> > + f"packed_vq={ring_format},"
> > + f"mrg_rxbuf={buffers},"
> > + f"in_order={in_order},"
> > + f"vectorized={vectorized}"
> > + )
> > +
> > + for params in self.test_parameters:
> > + frame_size = params["frame_size"]
> > + num_descriptors = params["num_descriptors"]
> > +
> > + default_args: TestPmdParamsDict = {
> > + "tx_ring":
> TXRingParams(descriptors=int(num_descriptors)),
> > + "rx_ring":
> RXRingParams(descriptors=int(num_descriptors)),
> > + }
> > +
> > + if sut_dpdk_driver == "mlx5_core":
> > + default_args["burst"] = 64
> > + default_args["mbcache"] = 512
> > + elif sut_dpdk_driver == "i40e":
> > + default_args["rx_queues"] = 1
> > + default_args["tx_queues"] = 1
>
> This could be a problematic bit as we tried our best in the past to make
> test suites as driver-agnostic as possible. Would these undermine that
> ability? Perhaps a comment is needed here.
>
I copied this over from the single_core_forward_perf testsuite, as it was
necessary to meet the performance baseline across different drivers. The
default burst size for testpmd is 32, but Mellanox NICs typically require
burst sizes of 64 and an optimized mbuf cache of 512 as the Mellanox
NIC capabilities are higher than the other NICs. Additionally, Intel NICs
require rx_queues and tx_queues to be manually set to 1 to ensure hardware
does not distribute traffic over multiple queues, which would cause
degraded performance.
As for the other changes mentioned, I will have those in my next version as
well. Thanks!
[-- Attachment #2: Type: text/html, Size: 5578 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v4 1/2] dts: add pvp multi paths vhost performance testsuite
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
` (2 preceding siblings ...)
2026-10-20 17:30 ` [PATCH v3 " Koushik Bhargav Nimoji
@ 2026-11-03 22:02 ` Koushik Bhargav Nimoji
2026-11-03 22:02 ` [PATCH v4 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-11-10 12:50 ` [PATCH v4 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
2026-11-10 20:10 ` [PATCH v5 " Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 1/3] dts: create default performance test configuration Koushik Bhargav Nimoji
5 siblings, 2 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-03 22:02 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths vhost single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with one and two cores respectively,
and tests the vhost single core throughput performance.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
v4:
*Refactored testsuite config parameters, moved test case
setup logic outside of test suite setup
---
...pvp_multi_paths_vhost_single_core_perf.rst | 8 +
dts/api/testbed_model/virtual_device.py | 8 +
dts/configurations/tests_config.example.yaml | 24 +
..._pvp_multi_paths_vhost_single_core_perf.py | 523 ++++++++++++++++++
4 files changed, 563 insertions(+)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
new file mode 100644
index 0000000000..4fcc6b6c91
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_vhost_single_core_perf Test Suite
+=================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_vhost_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/api/testbed_model/virtual_device.py b/dts/api/testbed_model/virtual_device.py
index 1a4794e695..8ac9a625f5 100644
--- a/dts/api/testbed_model/virtual_device.py
+++ b/dts/api/testbed_model/virtual_device.py
@@ -6,6 +6,8 @@
Alongside support for physical hardware, DPDK can create various virtual devices.
"""
+from api.context import get_ctx
+
class VirtualDevice:
"""Base class for virtual devices used by DPDK.
@@ -27,3 +29,9 @@ def __init__(self, name: str) -> None:
def __str__(self) -> str:
"""This corresponds to the name used for DPDK devices."""
return self.name
+
+
+def clean_up_vhost() -> None:
+ """Deletes stale vhost-user Unix domain socket files."""
+ ctx = get_ctx()
+ ctx.sut_node.main_session.send_command("rm -rf /tmp/vhost-net*", privileged=True)
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index ce67385b0b..36a0e7c2f1 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -18,6 +18,30 @@ hello_world:
# num_descriptors: 1024
# expected_mpps: 1.0
# delta_tolerance: 0.05
+# pvp_multi_paths_vhost_single_core_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
+# pvp_multi_paths_virtio_single_core_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
# pmd_rss:
# NUM_QUEUES: 4
# ACTUAL_KEY_SIZE: 52
diff --git a/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
new file mode 100644
index 0000000000..269fad1782
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
@@ -0,0 +1,523 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2026 University of New Hampshire
+
+"""Vhost-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding performance of DPDK's vhost-user PMD running on a
+single CPU core in a Physical-Virtual-Physical (PVP) topology. Performance is evaluated across
+multiple virtio-user backend options, including packed versus split ring formats, in-order packet
+processing, mergeable buffers, and SIMD vectorization. Test cases are parameterized using
+combinations of frame sizes, descriptor ring sizes, and target MPPS baselines specified in the
+test configuration. High-speed traffic is injected from an external generator through SUT physical
+interfaces, routed through Vhost and Virtio loops, and returned to the generator to measure
+aggregate MPPS.
+"""
+
+from typing import TypedDict, cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+from typing_extensions import NotRequired
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.params.eal import VirtualDevice
+from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.test_suite import BaseConfig, TestSuite, perf_suite, perf_test
+from api.testbed_model.virtual_device import clean_up_vhost
+from api.testpmd import TestPmd
+from api.testpmd.config import (
+ Params,
+ PortTopology,
+ RXRingParams,
+ SimpleForwardingModes,
+ TXRingParams,
+)
+
+
+class TestParameter(TypedDict):
+ """Performance test metrics."""
+
+ frame_size: int
+ num_descriptors: int
+ expected_mpps: float
+ performance_delta: NotRequired[float | None]
+ measured_mpps: NotRequired[float | None]
+ passing: NotRequired[float | None]
+
+
+class Config(BaseConfig):
+ """Test configuration for pvp_multi_paths_vhost_single_core_perf test suite."""
+
+ test_parameters: list[TestParameter] = [
+ {
+ "frame_size": 64,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 128,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 256,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 512,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 1024,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 1518,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ ]
+ delta_tolerance: float = 0.05
+
+
+@perf_suite
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVhostSingleCorePerf(TestSuite):
+ """pvp multi paths vhost single core performance test suite."""
+
+ config: Config
+
+ def set_up_test_case(self) -> None:
+ """Delete stale vhost-user Unix domain socket files."""
+ clean_up_vhost()
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ "queues=1,"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.config.test_parameters:
+ frame_size = params.get("frame_size")
+ num_descriptors = params.get("num_descriptors") or 1024
+ expected_mpps = params.get("expected_mpps") or 1.00
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2]),
+ "nb_cores": 1,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([3, 4, 5]),
+ "nb_cores": 2,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.mac)
+ virtio.set_forward_mode(SimpleForwardingModes.io)
+ vhost.set_portlist([0, 2, 1])
+
+ assert expected_mpps > 0, "Invalid expected mpps, must be greater than 0."
+
+ measured_mpps = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+
+ performance_delta = round(
+ (float(measured_mpps) - float(expected_mpps)) / float(expected_mpps),
+ 3,
+ )
+
+ params["measured_mpps"] = measured_mpps
+ params["performance_delta"] = performance_delta
+ params["passing"] = float(performance_delta) >= -self.config.delta_tolerance
+
+ self._produce_stats_table(self.config.test_parameters)
+ for params in self.config.test_parameters:
+ verify(
+ params["passing"] is True,
+ f"""Packets forwarded is less than {(1 - self.config.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[TestParameter]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print("-" * len(header))
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args={},
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {"rss": cast(RSSSetting, RSSSetting.SetIPOnly())}
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=1,
+ extra_args=extra_args,
+ )
--
2.56.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH v4 2/2] dts: add pvp multi paths virtio performance testsuite
2026-11-03 22:02 ` [PATCH v4 " Koushik Bhargav Nimoji
@ 2026-11-03 22:02 ` Koushik Bhargav Nimoji
2026-11-10 12:51 ` Luca Vizzarro
2026-11-10 12:50 ` [PATCH v4 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
1 sibling, 1 reply; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-03 22:02 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths virtio single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with two and one core respectively,
and tests the virtio single core throughputperformance.
Depends-on: series-39456 ("dts: add pvp multi paths vhost performance")
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
v4:
*Refactored testsuite config parameters, moved test case
setup logic outside of test suite setuo
---
...vp_multi_paths_virtio_single_core_perf.rst | 8 +
dts/api/test_suite.py | 4 +-
dts/configurations/tests_config.example.yaml | 12 +
...pvp_multi_paths_virtio_single_core_perf.py | 477 ++++++++++++++++++
4 files changed, 499 insertions(+), 2 deletions(-)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
new file mode 100644
index 0000000000..853d04ad40
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_virtio_single_core_perf Test Suite
+==================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_virtio_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/api/test_suite.py b/dts/api/test_suite.py
index 8a96a5cbad..e4d7abe6ff 100644
--- a/dts/api/test_suite.py
+++ b/dts/api/test_suite.py
@@ -107,10 +107,10 @@ def make_decorator(
determine the type of test suite.
Args:
- test_suite_type: A functional, performance, or cryptodev test suite.
+ test_suite_type: A functional or performance test suite.
Returns:
- The decorator of a functional, performance, or cryptodev test suite.
+ The decorator of a functional or performance test suite.
"""
def _decorator(test_suite_cls: TestSuiteClassType) -> TestSuiteClassType:
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index 36a0e7c2f1..25dcce89a1 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -42,6 +42,18 @@ hello_world:
# num_descriptors: 1024
# expected_mpps: 1.0
# delta_tolerance: 0.05
+# pvp_multi_paths_virtio_single_core_forward_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
# pmd_rss:
# NUM_QUEUES: 4
# ACTUAL_KEY_SIZE: 52
diff --git a/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
new file mode 100644
index 0000000000..e67ee2b09b
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
@@ -0,0 +1,477 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2025 University of New Hampshire
+
+"""Virtio-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding throughput of DPDK's virtio-user PMD running on a
+single CPU core. Performance is evaluated across multiple virtio path implementations, including
+packed versus split rings, in-order delivery, mergeable buffers, and SIMD vectorization.
+Test cases are parameterized using combinations of frame sizes, RX/TX descriptor ring counts,
+and target MPPS baselines specified in the test configuration. High-speed traffic is injected
+from an external generator through the physical host ports into the virtio-user instance,
+looped back, and returned to the generator. The aggregate MPPS processed by the single virtio
+core is verified against configured expected performance baselines to determine the test result.
+"""
+
+from typing import TypedDict, cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+from typing_extensions import NotRequired
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.params.eal import Params, VirtualDevice
+from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.test_suite import BaseConfig, TestSuite, perf_suite, perf_test
+from api.testbed_model.virtual_device import clean_up_vhost
+from api.testpmd import TestPmd
+from api.testpmd.config import PortTopology, RXRingParams, SimpleForwardingModes, TXRingParams
+
+
+class TestParameter(TypedDict):
+ """Performance test metrics."""
+
+ frame_size: int
+ num_descriptors: int
+ expected_mpps: float
+ performance_delta: NotRequired[float | None]
+ measured_mpps: NotRequired[float | None]
+ passing: NotRequired[float | None]
+
+
+class Config(BaseConfig):
+ """Test configuration for pvp_multi_paths_vhost_single_core_perf test suite."""
+
+ test_parameters: list[TestParameter] = [
+ {
+ "frame_size": 64,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 128,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 256,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 512,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 1024,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ {
+ "frame_size": 1518,
+ "num_descriptors": 1024,
+ "expected_mpps": 1.00,
+ "performance_delta": None,
+ "measured_mpps": None,
+ "passing": None,
+ },
+ ]
+ delta_tolerance: float = 0.05
+
+
+@perf_suite
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVirtioSingleCorePerf(TestSuite):
+ """pvp multi paths virtio single core performance test suite."""
+
+ config: Config
+
+ def set_up_test_case(self) -> None:
+ """Delete stale vhost-user Unix domain socket files."""
+ clean_up_vhost()
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ queues: int = 1,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ queues: number of rx/tx queues allocated to virtio device.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice(f"net_vhost0,iface=/tmp/vhost-net,queues={queues}")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ f"queues={queues},"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.config.test_parameters:
+ frame_size = params.get("frame_size")
+ num_descriptors = params.get("num_descriptors") or 1024
+ expected_mpps = params.get("expected_mpps") or 1.00
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2, 3]),
+ "nb_cores": 2,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([4, 5]),
+ "nb_cores": 1,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.io)
+ virtio.set_forward_mode(SimpleForwardingModes.mac)
+ vhost.set_portlist([0, 2, 1])
+
+ assert expected_mpps > 0, "Invalid expected mpps, must be greater than 0."
+
+ measured_mpps = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+
+ performance_delta = round(
+ (float(measured_mpps) - float(expected_mpps)) / float(expected_mpps),
+ 3,
+ )
+
+ params["measured_mpps"] = measured_mpps
+ params["performance_delta"] = performance_delta
+ params["passing"] = float(performance_delta) >= -self.config.delta_tolerance
+
+ self._produce_stats_table(self.config.test_parameters)
+ for params in self.config.test_parameters:
+ verify(
+ params["passing"] is True,
+ f"""Packets forwarded is less than {(1 - self.config.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[TestParameter]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args={})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=1, extra_args=extra_args, queues=2
+ )
--
2.56.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH v4 1/2] dts: add pvp multi paths vhost performance testsuite
2026-11-03 22:02 ` [PATCH v4 " Koushik Bhargav Nimoji
2026-11-03 22:02 ` [PATCH v4 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
@ 2026-11-10 12:50 ` Luca Vizzarro
2026-11-10 15:40 ` Koushik Bhargav Nimoji
1 sibling, 1 reply; 28+ messages in thread
From: Luca Vizzarro @ 2026-11-10 12:50 UTC (permalink / raw)
To: Koushik Bhargav Nimoji, patrickrobb1997; +Cc: dev, dladd, abailey, lylavoie
On 03/11/2026 22:02, Koushik Bhargav Nimoji wrote:
> diff --git a/dts/api/testbed_model/virtual_device.py b/dts/api/testbed_model/virtual_device.py
> index 1a4794e695..8ac9a625f5 100644
> --- a/dts/api/testbed_model/virtual_device.py
> +++ b/dts/api/testbed_model/virtual_device.py
> @@ -6,6 +6,8 @@
> Alongside support for physical hardware, DPDK can create various virtual devices.
> """
>
> +from api.context import get_ctx
> +
>
> class VirtualDevice:
> """Base class for virtual devices used by DPDK.
> @@ -27,3 +29,9 @@ def __init__(self, name: str) -> None:
> def __str__(self) -> str:
> """This corresponds to the name used for DPDK devices."""
> return self.name
> +
> +
> +def clean_up_vhost() -> None:
> + """Deletes stale vhost-user Unix domain socket files."""
> + ctx = get_ctx()
> + ctx.sut_node.main_session.send_command("rm -rf /tmp/vhost-net*", privileged=True)
I welcome this change but send_command is still something that should be
called by the relevant OSSession class. In theory main_session can be a
session for a host of any OS, be Linux, FreeBSD, Windows etc. Therefore
the changes should be OS-independent.
I've reviewed the usage better and the test suite shouldn't be able to
arbitrarily create files out of arbitrary paths. We have the class
Artifact to help abstract the remote filesystem away. On remote session
this also takes care of cleanup.
Instead of introducing this change which has no real ownership in the
framework and api packages, I'd suggest letting the test suite create
the vhost-net using the Artifact class instead.
> diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
> index ce67385b0b..36a0e7c2f1 100644
> --- a/dts/configurations/tests_config.example.yaml
> +++ b/dts/configurations/tests_config.example.yaml
> @@ -18,6 +18,30 @@ hello_world:
> # num_descriptors: 1024
> # expected_mpps: 1.0
> # delta_tolerance: 0.05
> +# pvp_multi_paths_vhost_single_core_perf:
> +# test_parameters: # Add frame size / descriptor count combinations as needed
> +# - frame_size: 64
> +# num_descriptors: 512
> +# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
> +# - frame_size: 64
> +# num_descriptors: 1024
> +# expected_mpps: 1.0
> +# - frame_size: 512
> +# num_descriptors: 1024
> +# expected_mpps: 1.0
> +# delta_tolerance: 0.05
> +# pvp_multi_paths_virtio_single_core_perf:
> +# test_parameters: # Add frame size / descriptor count combinations as needed
> +# - frame_size: 64
> +# num_descriptors: 512
> +# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
> +# - frame_size: 64
> +# num_descriptors: 1024
> +# expected_mpps: 1.0
> +# - frame_size: 512
> +# num_descriptors: 1024
> +# expected_mpps: 1.0
> +# delta_tolerance: 0.05
> # pmd_rss:
> # NUM_QUEUES: 4
> # ACTUAL_KEY_SIZE: 52
> diff --git a/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
> new file mode 100644
> index 0000000000..269fad1782
> --- /dev/null
> +++ b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
> @@ -0,0 +1,523 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2026 University of New Hampshire
> +
> +"""Vhost-user single-core forwarding performance test suite.
> +
> +This suite measures the packet forwarding performance of DPDK's vhost-user PMD running on a
> +single CPU core in a Physical-Virtual-Physical (PVP) topology. Performance is evaluated across
> +multiple virtio-user backend options, including packed versus split ring formats, in-order packet
> +processing, mergeable buffers, and SIMD vectorization. Test cases are parameterized using
> +combinations of frame sizes, descriptor ring sizes, and target MPPS baselines specified in the
> +test configuration. High-speed traffic is injected from an external generator through SUT physical
> +interfaces, routed through Vhost and Virtio loops, and returned to the generator to measure
> +aggregate MPPS.
> +"""
> +
> +from typing import TypedDict, cast
> +
> +from scapy.layers.inet import IP
> +from scapy.layers.l2 import Ether
> +from scapy.packet import Raw
> +from typing_extensions import NotRequired
> +
> +from api.capabilities import (
> + LinkTopology,
> + requires_link_topology,
> +)
> +from api.packet import assess_performance_by_packet
> +from api.params.eal import VirtualDevice
> +from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
> +from api.test import get_current_test_case_name, verify, write_performance_json
> +from api.test_suite import BaseConfig, TestSuite, perf_suite, perf_test
> +from api.testbed_model.virtual_device import clean_up_vhost
> +from api.testpmd import TestPmd
> +from api.testpmd.config import (
> + Params,
> + PortTopology,
> + RXRingParams,
> + SimpleForwardingModes,
> + TXRingParams,
> +)
> +
> +
> +class TestParameter(TypedDict):
> + """Performance test metrics."""
> +
> + frame_size: int
> + num_descriptors: int
> + expected_mpps: float
> + performance_delta: NotRequired[float | None]
> + measured_mpps: NotRequired[float | None]
> + passing: NotRequired[float | None]
I've noticed that this kind of configuration is ubiquitous across
performance test suites. I'd propose to abstract the Config and this
away as a generic PerfSuiteConfig and re-use it accordingly. In that
case you can move away from using a TypedDict and use a Pydantic
BaseConfig instead which will allow you to use more powerful constructs.
You won't need to use NotRequired – which I am assuming makes doing `|
None` redundant, in that case. Moreover the fields should be documented
appropriately similarly to what was done in the config package.> +
> +
> +class Config(BaseConfig):
> + """Test configuration for pvp_multi_paths_vhost_single_core_perf test suite."""
> +
> + test_parameters: list[TestParameter] = [
> + {
> + "frame_size": 64,
> + "num_descriptors": 1024,
> + "expected_mpps": 1.00,
> + "performance_delta": None,
> + "measured_mpps": None,
> + "passing": None,
> + },
> + {
> + "frame_size": 128,
> + "num_descriptors": 1024,
> + "expected_mpps": 1.00,
> + "performance_delta": None,
> + "measured_mpps": None,
> + "passing": None,
> + },
> + {
> + "frame_size": 256,
> + "num_descriptors": 1024,
> + "expected_mpps": 1.00,
> + "performance_delta": None,
> + "measured_mpps": None,
> + "passing": None,
> + },
> + {
> + "frame_size": 512,
> + "num_descriptors": 1024,
> + "expected_mpps": 1.00,
> + "performance_delta": None,
> + "measured_mpps": None,
> + "passing": None,
> + },
> + {
> + "frame_size": 1024,
> + "num_descriptors": 1024,
> + "expected_mpps": 1.00,
> + "performance_delta": None,
> + "measured_mpps": None,
> + "passing": None,
> + },
> + {
> + "frame_size": 1518,
> + "num_descriptors": 1024,
> + "expected_mpps": 1.00,
> + "performance_delta": None,
> + "measured_mpps": None,
> + "passing": None,
> + },
> + ]
> + delta_tolerance: float = 0.05
So all of the above could be a common Config class that can be re-used
across perf test suites.> +
> +
> +@perf_suite
> +@requires_link_topology(LinkTopology.TWO_LINKS)
> +class TestPvpMultiPathsVhostSingleCorePerf(TestSuite):
> + """pvp multi paths vhost single core performance test suite."""
> +
> + config: Config
> +
> + def set_up_test_case(self) -> None:
> + """Delete stale vhost-user Unix domain socket files."""
> + clean_up_vhost()
> +
> + def _transmit(
> + self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
> + ) -> float:
> + """Transmit packets using testpmd instances and compute average MPPS.
> +
> + Args:
> + vhost: the running vhost testpmd shell.
> + virtio: the running virtio testpmd shell.
> + frame_size: The size of the frame to transmit.
> + repetitions: The number of times to rerun the transmission.
> +
> + Returns:
> + The MPPS (millions of packets per second) forwarded by the SUT.
> + """
> + assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
> + # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
> + packet = (
> + Ether(src="52:00:00:00:00:00")
> + / IP(src="1.2.3.4", dst="192.18.1.0")
> + / Raw(load="x" * (frame_size - 14 - 20))
> + )
> +
> + vhost.start()
> + virtio.start()
> + rx_avg = 0.0
> +
> + for _ in range(repetitions):
> + # Transmit for 5 seconds.
> + stats = assess_performance_by_packet(packet=packet, duration=5)
> + rx_avg += stats.rx_pps
> + return rx_avg / (repetitions * 1_000_000)
> +
> + def _create_and_transmit(
> + self,
> + ring_format: int,
> + in_order: int,
> + buffers: int,
> + vectorized: int,
> + extra_args: TestPmdParamsDict,
> + ) -> None:
> + """Create testpmd instances with specified params and send traffic.
> +
> + Args:
> + ring_format: selects the virtio queue descriptor layout.
> + in_order: toggles in-order packet processing.
> + buffers: enables mergeable rx buffers.
> + vectorized: enables SIMD vectorized rx/tx data paths.
> + extra_args: extra/generic TestPmd arguments.
> + """
> + sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
Here you should be able to do:
vhost_iface = Artifact("sut", "vhost-net", save_local_copy=False)> +
vhost_user_vdev =
VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
VirtualDevice(f"net_vhost0,iface={vhost_iface.path},queues=1")
etc.
> + virtio_user_vdev = VirtualDevice(
> + "net_virtio_user0,"
> + "mac=00:11:22:33:44:10,"
> + "path=/tmp/vhost-net,"
> + "queues=1,"
> + f"packed_vq={ring_format},"
> + f"mrg_rxbuf={buffers},"
> + f"in_order={in_order},"
> + f"vectorized={vectorized}"
> + )
> +
> + for params in self.config.test_parameters:
> + frame_size = params.get("frame_size")
> + num_descriptors = params.get("num_descriptors") or 1024
> + expected_mpps = params.get("expected_mpps") or 1.00
Wouldn't using the default field more appropriate here? What if the
param is 0? Thinking of:
num_descriptors = params.get("num_descriptors", 1024)
expected_mpps = params.get("expected_mpps", 1.00)> +
> + default_args: TestPmdParamsDict = {
> + "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
> + "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
> + }
> +
> + if sut_dpdk_driver == "mlx5_core":
> + default_args["burst"] = 64
> + default_args["mbcache"] = 512
> + elif sut_dpdk_driver == "i40e":
> + default_args["rx_queues"] = 1
> + default_args["tx_queues"] = 1
> +
> + vhost_params: TestPmdParamsDict = {
> + "prefix": "vhost",
> + "allowed_ports": [],
> + "memory_channels": 4,
> + "port_topology": PortTopology.chained,
> + "vdevs": [vhost_user_vdev],
> + "lcore_list": LogicalCoreList([1, 2]),
> + "nb_cores": 1,
> + **default_args,
> + }
> +
> + virtio_params: TestPmdParamsDict = {
> + "prefix": "virtio",
> + "no_pci": True,
> + "memory_channels": 4,
> + "allowed_ports": [],
> + "vdevs": [virtio_user_vdev],
> + "lcore_list": LogicalCoreList([3, 4, 5]),
> + "nb_cores": 2,
> + **extra_args,
> + **default_args,
> + }
> +
> + with (
> + TestPmd(**vhost_params) as vhost,
> + TestPmd(**virtio_params) as virtio,
> + ):
> + vhost.set_forward_mode(SimpleForwardingModes.mac)
> + virtio.set_forward_mode(SimpleForwardingModes.io)
> + vhost.set_portlist([0, 2, 1])
> +
> + assert expected_mpps > 0, "Invalid expected mpps, must be greater than 0."
Is this assertion a check for a test suite bug or an actual testing
detail? If the latter then verify should be used here.
> +
> + measured_mpps = round(
> + self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
> + )
> +
> + performance_delta = round(
> + (float(measured_mpps) - float(expected_mpps)) / float(expected_mpps),
> + 3,
> + )
> +
> + params["measured_mpps"] = measured_mpps
> + params["performance_delta"] = performance_delta
> + params["passing"] = float(performance_delta) >= -self.config.delta_tolerance
> +
> + self._produce_stats_table(self.config.test_parameters)
> + for params in self.config.test_parameters:
> + verify(
> + params["passing"] is True,
> + f"""Packets forwarded is less than {(1 - self.config.delta_tolerance) * 100}%
> + of the expected baseline.
> + Measured MPPS = {params["measured_mpps"]}
> + Expected MPPS = {params["expected_mpps"]}""",
> + )
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v4 2/2] dts: add pvp multi paths virtio performance testsuite
2026-11-03 22:02 ` [PATCH v4 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
@ 2026-11-10 12:51 ` Luca Vizzarro
0 siblings, 0 replies; 28+ messages in thread
From: Luca Vizzarro @ 2026-11-10 12:51 UTC (permalink / raw)
To: Koushik Bhargav Nimoji, patrickrobb1997; +Cc: dev, dladd, abailey, lylavoie
As the test suites are very similar, the same comment as 1/2 apply here.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v4 1/2] dts: add pvp multi paths vhost performance testsuite
2026-11-10 12:50 ` [PATCH v4 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
@ 2026-11-10 15:40 ` Koushik Bhargav Nimoji
0 siblings, 0 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-10 15:40 UTC (permalink / raw)
To: Luca Vizzarro; +Cc: patrickrobb1997, dev, dladd, abailey, lylavoie
[-- Attachment #1: Type: text/plain, Size: 4180 bytes --]
On Tue, Nov 10, 2026 at 7:50 AM Luca Vizzarro <Luca.Vizzarro@arm.com> wrote:
> On 03/11/2026 22:02, Koushik Bhargav Nimoji wrote:
> > diff --git a/dts/api/testbed_model/virtual_device.py
> b/dts/api/testbed_model/virtual_device.py
> > index 1a4794e695..8ac9a625f5 100644
> > --- a/dts/api/testbed_model/virtual_device.py
> > +++ b/dts/api/testbed_model/virtual_device.py
> > @@ -6,6 +6,8 @@
> > Alongside support for physical hardware, DPDK can create various
> virtual devices.
> > """
> >
> > +from api.context import get_ctx
> > +
> >
> > class VirtualDevice:
> > """Base class for virtual devices used by DPDK.
> > @@ -27,3 +29,9 @@ def __init__(self, name: str) -> None:
> > def __str__(self) -> str:
> > """This corresponds to the name used for DPDK devices."""
> > return self.name
> > +
> > +
> > +def clean_up_vhost() -> None:
> > + """Deletes stale vhost-user Unix domain socket files."""
> > + ctx = get_ctx()
> > + ctx.sut_node.main_session.send_command("rm -rf /tmp/vhost-net*",
> privileged=True)
> I welcome this change but send_command is still something that should be
> called by the relevant OSSession class. In theory main_session can be a
> session for a host of any OS, be Linux, FreeBSD, Windows etc. Therefore
> the changes should be OS-independent.
>
> I've reviewed the usage better and the test suite shouldn't be able to
> arbitrarily create files out of arbitrary paths. We have the class
> Artifact to help abstract the remote filesystem away. On remote session
> this also takes care of cleanup.
>
> Instead of introducing this change which has no real ownership in the
> framework and api packages, I'd suggest letting the test suite create
> the vhost-net using the Artifact class instead.
>
After further digging, I've realized that the vhost socket files are
automatically deleted when testpmd quits, I've double checked this when
running DTS manually and ensured that even when I abruptly quit DTS the
vhost socket files are still deleted. I will remove all clean_up_vhost()
calls from my patch in the next version.
> +
> > +from typing import TypedDict, cast
> > +
> > +from scapy.layers.inet import IP
> > +from scapy.layers.l2 import Ether
> > +from scapy.packet import Raw
> > +from typing_extensions import NotRequired
> > +
> > +from api.capabilities import (
> > + LinkTopology,
> > + requires_link_topology,
> > +)
> > +from api.packet import assess_performance_by_packet
> > +from api.params.eal import VirtualDevice
> > +from api.params.types import LogicalCoreList, RSSSetting,
> TestPmdParamsDict
> > +from api.test import get_current_test_case_name, verify,
> write_performance_json
> > +from api.test_suite import BaseConfig, TestSuite, perf_suite, perf_test
> > +from api.testbed_model.virtual_device import clean_up_vhost
> > +from api.testpmd import TestPmd
> > +from api.testpmd.config import (
> > + Params,
> > + PortTopology,
> > + RXRingParams,
> > + SimpleForwardingModes,
> > + TXRingParams,
> > +)
> > +
> > +
> > +class TestParameter(TypedDict):
> > + """Performance test metrics."""
> > +
> > + frame_size: int
> > + num_descriptors: int
> > + expected_mpps: float
> > + performance_delta: NotRequired[float | None]
> > + measured_mpps: NotRequired[float | None]
> > + passing: NotRequired[float | None]
> I've noticed that this kind of configuration is ubiquitous across
> performance test suites. I'd propose to abstract the Config and this
> away as a generic PerfSuiteConfig and re-use it accordingly. In that
> case you can move away from using a TypedDict and use a Pydantic
> BaseConfig instead which will allow you to use more powerful constructs.
>
> You won't need to use NotRequired – which I am assuming makes doing `|
> None` redundant, in that case. Moreover the fields should be documented
> appropriately similarly to what was done in the config package.
I agree, I will create a PerfSuiteConfig in my next version.
All other mentioned changes will be reflected in my next version as well,
thanks!
[-- Attachment #2: Type: text/html, Size: 5460 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v5 1/2] dts: add pvp multi paths vhost performance testsuite
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
` (3 preceding siblings ...)
2026-11-03 22:02 ` [PATCH v4 " Koushik Bhargav Nimoji
@ 2026-11-10 20:10 ` Koushik Bhargav Nimoji
2026-11-10 20:10 ` [PATCH v5 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-11-11 16:30 ` [PATCH v5 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
2026-11-12 21:00 ` [PATCH v6 1/3] dts: create default performance test configuration Koushik Bhargav Nimoji
5 siblings, 2 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-10 20:10 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths vhost single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with one and two cores respectively,
and tests the vhost single core throughput performance.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
v4:
*Refactored testsuite config parameters, moved test case
setup logic outside of test suite setup
v5:
*Removed vhost socket file deletion logic and created a
performance-specific test suite configuration
---
...pvp_multi_paths_vhost_single_core_perf.rst | 8 +
dts/api/testpmd/config.py | 14 +
dts/configurations/tests_config.example.yaml | 24 +
..._pvp_multi_paths_vhost_single_core_perf.py | 464 ++++++++++++++++++
4 files changed, 510 insertions(+)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
new file mode 100644
index 0000000000..4fcc6b6c91
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_vhost_single_core_perf Test Suite
+=================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_vhost_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/api/testpmd/config.py b/dts/api/testpmd/config.py
index c72c1b2c90..9459cd83bb 100644
--- a/dts/api/testpmd/config.py
+++ b/dts/api/testpmd/config.py
@@ -13,6 +13,8 @@
from pathlib import PurePath
from typing import Literal, NamedTuple
+from pydantic import BaseModel, ConfigDict
+
from api.params import (
Params,
Switch,
@@ -618,3 +620,15 @@ class TestPmdParams(EalParams):
)
record_core_cycles: Switch = None
record_burst_status: Switch = None
+
+
+class PerfSuiteConfig(BaseModel):
+ """Generic performance test suite parameters."""
+
+ model_config = ConfigDict(strict=True, extra="forbid", frozen=False, from_attributes=True)
+ frame_size: int
+ num_descriptors: int
+ expected_mpps: float
+ performance_delta: float | None = None
+ measured_mpps: float | None = None
+ passing: float | None = None
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index e20edc0855..98710a5192 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -35,6 +35,30 @@ hello_world:
# test_duration: 5 # See `Optional Fields`
# test_repetitions: 5 # See `Optional Fields`
# delta_tolerance: 0.05
+# pvp_multi_paths_vhost_single_core_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
+# pvp_multi_paths_virtio_single_core_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
# pmd_rss:
# NUM_QUEUES: 4
diff --git a/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
new file mode 100644
index 0000000000..f8d2fcd69a
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
@@ -0,0 +1,464 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2026 University of New Hampshire
+
+"""Vhost-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding performance of DPDK's vhost-user PMD running on a
+single CPU core in a Physical-Virtual-Physical (PVP) topology. Performance is evaluated across
+multiple virtio-user backend options, including packed versus split ring formats, in-order packet
+processing, mergeable buffers, and SIMD vectorization. Test cases are parameterized using
+combinations of frame sizes, descriptor ring sizes, and target MPPS baselines specified in the
+test configuration. High-speed traffic is injected from an external generator through SUT physical
+interfaces, routed through Vhost and Virtio loops, and returned to the generator to measure
+aggregate MPPS.
+"""
+
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.params.eal import VirtualDevice
+from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.test_suite import BaseConfig, TestSuite, perf_suite, perf_test
+from api.testpmd import TestPmd
+from api.testpmd.config import (
+ Params,
+ PerfSuiteConfig,
+ PortTopology,
+ RXRingParams,
+ SimpleForwardingModes,
+ TXRingParams,
+)
+
+
+class Config(BaseConfig):
+ """Test configuration for pvp_multi_paths_vhost_single_core_perf test suite."""
+
+ test_parameters: list[PerfSuiteConfig] = [
+ PerfSuiteConfig(frame_size=64, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=128, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=256, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=512, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=1024, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=1518, num_descriptors=1024, expected_mpps=1.00),
+ ]
+ delta_tolerance: float = 0.05
+
+
+@perf_suite
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVhostSingleCorePerf(TestSuite):
+ """pvp multi paths vhost single core performance test suite."""
+
+ config: Config
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice("net_vhost0,iface=/tmp/vhost-net,queues=1")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ "queues=1,"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.config.test_parameters:
+ frame_size = params.frame_size
+ num_descriptors = params.num_descriptors if params.num_descriptors else 1024
+ expected_mpps = params.expected_mpps if params.expected_mpps else 1.00
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2]),
+ "nb_cores": 1,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([3, 4, 5]),
+ "nb_cores": 2,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.mac)
+ virtio.set_forward_mode(SimpleForwardingModes.io)
+ vhost.set_portlist([0, 2, 1])
+
+ verify(expected_mpps > 0, "Invalid expected mpps, must be greater than 0.")
+ measured_mpps = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+ performance_delta = round(
+ (float(measured_mpps) - float(expected_mpps)) / float(expected_mpps),
+ 3,
+ )
+
+ params.measured_mpps = measured_mpps
+ params.performance_delta = performance_delta
+ params.passing = float(performance_delta) >= -self.config.delta_tolerance
+
+ self._produce_stats_table(self.config.test_parameters)
+ for params in self.config.test_parameters:
+ verify(
+ params.passing is True,
+ f"""Packets forwarded is less than {(1 - self.config.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params.measured_mpps}
+ Expected MPPS = {params.expected_mpps}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[PerfSuiteConfig]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print("-" * len(header))
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params.frame_size:>12} | {params.num_descriptors:>12} | ", end="")
+ print(f"{params.measured_mpps:>12} | {params.expected_mpps:>14}")
+ print("-" * len(header))
+
+ serializable_results = [item.model_dump() for item in test_parameters]
+ write_performance_json({"results": serializable_results})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args={},
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {"rss": cast(RSSSetting, RSSSetting.SetIPOnly())}
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=1,
+ extra_args=extra_args,
+ )
--
2.56.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH v5 2/2] dts: add pvp multi paths virtio performance testsuite
2026-11-10 20:10 ` [PATCH v5 " Koushik Bhargav Nimoji
@ 2026-11-10 20:10 ` Koushik Bhargav Nimoji
2026-11-11 16:30 ` [PATCH v5 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
1 sibling, 0 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-10 20:10 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths virtio single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with two and one core respectively,
and tests the virtio single core throughputperformance.
Depends-on: series-39456 ("dts: add pvp multi paths vhost performance")
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
v4:
*Refactored testsuite config parameters, moved test case
setup logic outside of test suite setup
v5:
*Removed vhost socket file deletion logic and created a
performance-specific test suite configuration
---
...vp_multi_paths_virtio_single_core_perf.rst | 8 +
dts/api/test_suite.py | 4 +-
...pvp_multi_paths_virtio_single_core_perf.py | 426 ++++++++++++++++++
3 files changed, 436 insertions(+), 2 deletions(-)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
new file mode 100644
index 0000000000..853d04ad40
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_virtio_single_core_perf Test Suite
+==================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_virtio_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/api/test_suite.py b/dts/api/test_suite.py
index 8a96a5cbad..e4d7abe6ff 100644
--- a/dts/api/test_suite.py
+++ b/dts/api/test_suite.py
@@ -107,10 +107,10 @@ def make_decorator(
determine the type of test suite.
Args:
- test_suite_type: A functional, performance, or cryptodev test suite.
+ test_suite_type: A functional or performance test suite.
Returns:
- The decorator of a functional, performance, or cryptodev test suite.
+ The decorator of a functional or performance test suite.
"""
def _decorator(test_suite_cls: TestSuiteClassType) -> TestSuiteClassType:
diff --git a/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
new file mode 100644
index 0000000000..b509a14ee3
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
@@ -0,0 +1,426 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2025 University of New Hampshire
+
+"""Virtio-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding throughput of DPDK's virtio-user PMD running on a
+single CPU core. Performance is evaluated across multiple virtio path implementations, including
+packed versus split rings, in-order delivery, mergeable buffers, and SIMD vectorization.
+Test cases are parameterized using combinations of frame sizes, RX/TX descriptor ring counts,
+and target MPPS baselines specified in the test configuration. High-speed traffic is injected
+from an external generator through the physical host ports into the virtio-user instance,
+looped back, and returned to the generator. The aggregate MPPS processed by the single virtio
+core is verified against configured expected performance baselines to determine the test result.
+"""
+
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.params.eal import Params, VirtualDevice
+from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.test_suite import BaseConfig, TestSuite, perf_suite, perf_test
+from api.testpmd import TestPmd
+from api.testpmd.config import (
+ PerfSuiteConfig,
+ PortTopology,
+ RXRingParams,
+ SimpleForwardingModes,
+ TXRingParams,
+)
+
+
+class Config(BaseConfig):
+ """Test configuration for pvp_multi_paths_vhost_single_core_perf test suite."""
+
+ test_parameters: list[PerfSuiteConfig] = [
+ PerfSuiteConfig(frame_size=64, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=128, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=256, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=512, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=1024, num_descriptors=1024, expected_mpps=1.00),
+ PerfSuiteConfig(frame_size=1518, num_descriptors=1024, expected_mpps=1.00),
+ ]
+ delta_tolerance: float = 0.05
+
+
+@perf_suite
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVirtioSingleCorePerf(TestSuite):
+ """pvp multi paths virtio single core performance test suite."""
+
+ config: Config
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ queues: int = 1,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ queues: number of rx/tx queues allocated to virtio device.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice(f"net_vhost0,iface=/tmp/vhost-net,queues={queues}")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ "path=/tmp/vhost-net,"
+ f"queues={queues},"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.config.test_parameters:
+ frame_size = params.frame_size
+ num_descriptors = params.num_descriptors if params.num_descriptors else 1024
+ expected_mpps = params.expected_mpps if params.expected_mpps else 1.00
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2, 3]),
+ "nb_cores": 2,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([4, 5]),
+ "nb_cores": 1,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.io)
+ virtio.set_forward_mode(SimpleForwardingModes.mac)
+ vhost.set_portlist([0, 2, 1])
+
+ assert expected_mpps > 0, "Invalid expected mpps, must be greater than 0."
+
+ measured_mpps = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+
+ performance_delta = round(
+ (float(measured_mpps) - float(expected_mpps)) / float(expected_mpps),
+ 3,
+ )
+
+ params.measured_mpps = measured_mpps
+ params.performance_delta = performance_delta
+ params.passing = float(performance_delta) >= -self.config.delta_tolerance
+
+ self._produce_stats_table(self.config.test_parameters)
+ for params in self.config.test_parameters:
+ verify(
+ params.passing is True,
+ f"""Packets forwarded is less than {(1 - self.config.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params.measured_mpps}
+ Expected MPPS = {params.expected_mpps}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[PerfSuiteConfig]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print("-" * len(header))
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params.frame_size:>12} | {params.num_descriptors:>12} | ", end="")
+ print(f"{params.measured_mpps:>12} | {params.expected_mpps:>14}")
+ print("-" * len(header))
+
+ serializable_results = [item.model_dump() for item in test_parameters]
+ write_performance_json({"results": serializable_results})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args={})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=1, extra_args=extra_args, queues=2
+ )
--
2.56.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH v5 1/2] dts: add pvp multi paths vhost performance testsuite
2026-11-10 20:10 ` [PATCH v5 " Koushik Bhargav Nimoji
2026-11-10 20:10 ` [PATCH v5 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
@ 2026-11-11 16:30 ` Luca Vizzarro
2026-11-12 15:48 ` Koushik Bhargav Nimoji
1 sibling, 1 reply; 28+ messages in thread
From: Luca Vizzarro @ 2026-11-11 16:30 UTC (permalink / raw)
To: Koushik Bhargav Nimoji, patrickrobb1997; +Cc: dev, dladd, abailey, lylavoie
Hey Koushik,
It looks like not all of my comments were addressed, e.g. Artifact.
On 10/11/2026 20:10, Koushik Bhargav Nimoji wrote:
> diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
> new file mode 100644
> index 0000000000..4fcc6b6c91
> --- /dev/null
> +++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
> @@ -0,0 +1,8 @@
> +.. SPDX-License-Identifier: BSD-3-Clause
> +
> +pvp_multi_paths_vhost_single_core_perf Test Suite
> +=================================================
> +
> +.. automodule:: tests.TestSuite_pvp_multi_paths_vhost_single_core_perf
> + :members:
> + :show-inheritance:
> diff --git a/dts/api/testpmd/config.py b/dts/api/testpmd/config.py
> index c72c1b2c90..9459cd83bb 100644
> --- a/dts/api/testpmd/config.py
> +++ b/dts/api/testpmd/config.py
> @@ -13,6 +13,8 @@
> from pathlib import PurePath
> from typing import Literal, NamedTuple
>
> +from pydantic import BaseModel, ConfigDict
> +
> from api.params import (
> Params,
> Switch,
> @@ -618,3 +620,15 @@ class TestPmdParams(EalParams):
> )
> record_core_cycles: Switch = None
> record_burst_status: Switch = None
> +
> +
> +class PerfSuiteConfig(BaseModel):
I wouldn't call the TestParameter a PerfSuiteConfig. Also I am not sure
this is the right place for this? I think it should just live next to
BaseConfig in api.test_suite. The idea is that PerfSuiteConfig would
just be the test suite config model, as the name suggests. Instead of
replicating the model across test suites just to set defaults. These can
be a constant and then set during test suite setup as it's already done
with other test suites. We only extend the config if we have extra
special fields which are unique for said test suite. anything that is
common across all of them should be kept in a common config.
These changes can be their own commit before the test suites. Updating
other test suites using the same pattern would also be a welcome change.
> + """Generic performance test suite parameters."""
> +
> + model_config = ConfigDict(strict=True, extra="forbid", frozen=False, from_attributes=True)
> + frame_size: int
> + num_descriptors: int
> + expected_mpps: float
> + performance_delta: float | None = None
> + measured_mpps: float | None = None
> + passing: float | None = None
Still lacking documentation for the fields.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 1/2] dts: add pvp multi paths vhost performance testsuite
2026-11-11 16:30 ` [PATCH v5 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
@ 2026-11-12 15:48 ` Koushik Bhargav Nimoji
0 siblings, 0 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-12 15:48 UTC (permalink / raw)
To: Luca Vizzarro; +Cc: patrickrobb1997, dev, dladd, abailey, lylavoie
[-- Attachment #1: Type: text/plain, Size: 2482 bytes --]
On Wed, Nov 11, 2026 at 11:30 AM Luca Vizzarro <Luca.Vizzarro@arm.com>
wrote:
> Hey Koushik,
>
> It looks like not all of my comments were addressed, e.g. Artifact.
>
Hi Luca, as I mentioned in the previous email all vhost socket files are
handled by testpmd, ensuring that they are created and deleted properly. I
don't think the use of Artifact will be required here, as it will interfere
with testpmd's handling of the files.
> > +from pydantic import BaseModel, ConfigDict
> > +
> > from api.params import (
> > Params,
> > Switch,
> > @@ -618,3 +620,15 @@ class TestPmdParams(EalParams):
> > )
> > record_core_cycles: Switch = None
> > record_burst_status: Switch = None
> > +
> > +
> > +class PerfSuiteConfig(BaseModel):
>
> I wouldn't call the TestParameter a PerfSuiteConfig. Also I am not sure
> this is the right place for this? I think it should just live next to
> BaseConfig in api.test_suite. The idea is that PerfSuiteConfig would
> just be the test suite config model, as the name suggests. Instead of
> replicating the model across test suites just to set defaults. These can
> be a constant and then set during test suite setup as it's already done
> with other test suites. We only extend the config if we have extra
> special fields which are unique for said test suite. anything that is
> common across all of them should be kept in a common config.
>
> These changes can be their own commit before the test suites. Updating
> other test suites using the same pattern would also be a welcome change.
>
>
I'm a bit confused by this, do you mean to say that the PerfSuiteConfig is
something that should already hold the default values, but can be
overridden by the specific test parameters in tests_config.yaml? So this
would mean that performance test suites would only need to import this
config for usage so the config declaration in the test suites wouldn't be
necessary.
> > + """Generic performance test suite parameters."""
> > +
> > + model_config = ConfigDict(strict=True, extra="forbid",
> frozen=False, from_attributes=True)
> > + frame_size: int
> > + num_descriptors: int
> > + expected_mpps: float
> > + performance_delta: float | None = None
> > + measured_mpps: float | None = None
> > + passing: float | None = None
>
> Still lacking documentation for the fields.
>
Will add documentation in my next version, thanks!
[-- Attachment #2: Type: text/html, Size: 3407 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v6 1/3] dts: create default performance test configuration
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
` (4 preceding siblings ...)
2026-11-10 20:10 ` [PATCH v5 " Koushik Bhargav Nimoji
@ 2026-11-12 21:00 ` Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 2/3] dts: add pvp multi paths vhost performance testsuite Koushik Bhargav Nimoji
` (2 more replies)
5 siblings, 3 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-12 21:00 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
Previously, all performance test suites in DTS shared the
same test parameters but created their own configuration.
This patch creates a centralized configuration that can be shared
by all performance testsuites and provides default test parameters.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
dts/api/test_suite.py | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/dts/api/test_suite.py b/dts/api/test_suite.py
index 8a96a5cbad..1be9efd95e 100644
--- a/dts/api/test_suite.py
+++ b/dts/api/test_suite.py
@@ -107,10 +107,10 @@ def make_decorator(
determine the type of test suite.
Args:
- test_suite_type: A functional, performance, or cryptodev test suite.
+ test_suite_type: A functional or performance test suite.
Returns:
- The decorator of a functional, performance, or cryptodev test suite.
+ The decorator of a functional or performance test suite.
"""
def _decorator(test_suite_cls: TestSuiteClassType) -> TestSuiteClassType:
@@ -499,6 +499,39 @@ def discover_all(
return test_suites
+class PerfTestParameters(FrozenModel):
+ """Generic performance test suite parameters.
+
+ Attributes:
+ frame_size: Ethernet frame size in bytes
+ num_descriptors: RX/TX ring descriptor count
+ expected_mpps: Baseline throughput target
+ """
+
+ frame_size: int
+ num_descriptors: int
+ expected_mpps: float
+
+
+class PerfSuiteConfig(BaseConfig):
+ """Default test configuration for performance test suites.
+
+ Attributes:
+ test_parameters: Default performance test parameters
+ delta_tolerance: Default allowed performance delta variance
+ """
+
+ test_parameters: list[PerfTestParameters] = [
+ PerfTestParameters(frame_size=64, num_descriptors=1024, expected_mpps=1.00),
+ PerfTestParameters(frame_size=128, num_descriptors=1024, expected_mpps=1.00),
+ PerfTestParameters(frame_size=256, num_descriptors=1024, expected_mpps=1.00),
+ PerfTestParameters(frame_size=512, num_descriptors=1024, expected_mpps=1.00),
+ PerfTestParameters(frame_size=1024, num_descriptors=1024, expected_mpps=1.00),
+ PerfTestParameters(frame_size=1518, num_descriptors=1024, expected_mpps=1.00),
+ ]
+ delta_tolerance: float = 0.05
+
+
AVAILABLE_TEST_SUITES: list[TestSuiteSpec] = TestSuiteSpec.discover_all()
"""Constant to store all the available, discovered and imported test suites.
--
2.56.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH v6 2/3] dts: add pvp multi paths vhost performance testsuite
2026-11-12 21:00 ` [PATCH v6 1/3] dts: create default performance test configuration Koushik Bhargav Nimoji
@ 2026-11-12 21:00 ` Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 3/3] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-11-19 18:41 ` [PATCH v6 1/3] dts: create default performance test configuration Luca Vizzarro
2 siblings, 0 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-12 21:00 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths vhost single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with one and two cores respectively,
and tests the vhost single core throughput performance.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
...pvp_multi_paths_vhost_single_core_perf.rst | 8 +
dts/configurations/tests_config.example.yaml | 13 +
..._pvp_multi_paths_vhost_single_core_perf.py | 462 ++++++++++++++++++
3 files changed, 483 insertions(+)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
new file mode 100644
index 0000000000..4fcc6b6c91
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_vhost_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_vhost_single_core_perf Test Suite
+=================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_vhost_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index e20edc0855..1222469b3a 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -36,6 +36,19 @@ hello_world:
# test_repetitions: 5 # See `Optional Fields`
# delta_tolerance: 0.05
+# pvp_multi_paths_vhost_single_core_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
+
# pmd_rss:
# NUM_QUEUES: 4
# ACTUAL_KEY_SIZE: 52
diff --git a/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
new file mode 100644
index 0000000000..83849bb99c
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_vhost_single_core_perf.py
@@ -0,0 +1,462 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2026 University of New Hampshire
+
+"""Vhost-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding performance of DPDK's vhost-user PMD running on a
+single CPU core in a Physical-Virtual-Physical (PVP) topology. Performance is evaluated across
+multiple virtio-user backend options, including packed versus split ring formats, in-order packet
+processing, mergeable buffers, and SIMD vectorization. Test cases are parameterized using
+combinations of frame sizes, descriptor ring sizes, and target MPPS baselines specified in the
+test configuration. High-speed traffic is injected from an external generator through SUT physical
+interfaces, routed through Vhost and Virtio loops, and returned to the generator to measure
+aggregate MPPS.
+"""
+
+from pathlib import PurePath
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.artifact import Artifact
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.params.eal import VirtualDevice
+from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.test_suite import PerfSuiteConfig, TestSuite, perf_suite, perf_test
+from api.testpmd import TestPmd
+from api.testpmd.config import (
+ Params,
+ PortTopology,
+ RXRingParams,
+ SimpleForwardingModes,
+ TXRingParams,
+)
+
+
+@perf_suite
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVhostSingleCorePerf(TestSuite):
+ """pvp multi paths vhost single core performance test suite."""
+
+ config: PerfSuiteConfig
+ vhost_net_path: PurePath
+
+ def set_up_suite(self):
+ """Set up the test suite.
+
+ Creates a safe path for vhost socket files and creates an
+ editable copy of the test parameters to store results.
+ """
+ self.vhost_net_path = Artifact(
+ "sut", "vhost-net", save_local_copy=False, custom_path=PurePath(".")
+ )
+ self.test_parameters = [p.model_dump() for p in self.config.test_parameters]
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice(f"net_vhost0,iface={self.vhost_net_path},queues=1")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ f"path={self.vhost_net_path},"
+ "queues=1,"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.test_parameters:
+ frame_size = params["frame_size"]
+ num_descriptors = params["num_descriptors"]
+ expected_mpps = params["expected_mpps"]
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2]),
+ "nb_cores": 1,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([3, 4, 5]),
+ "nb_cores": 2,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.mac)
+ virtio.set_forward_mode(SimpleForwardingModes.io)
+ vhost.set_portlist([0, 2, 1])
+
+ verify(expected_mpps > 0, "Invalid expected mpps, must be greater than 0.")
+ measured_mpps = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+ performance_delta = round(
+ (float(measured_mpps) - float(expected_mpps)) / float(expected_mpps),
+ 3,
+ )
+
+ params["measured_mpps"] = measured_mpps
+ params["performance_delta"] = performance_delta
+ params["passing"] = float(performance_delta) >= -self.config.delta_tolerance
+
+ self._produce_stats_table(self.test_parameters)
+ for params in self.test_parameters:
+ verify(
+ params["passing"] is True,
+ f"""Packets forwarded is less than {(1 - self.config.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[dict]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print("-" * len(header))
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=1,
+ in_order=0,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(
+ ring_format=0,
+ buffers=0,
+ in_order=0,
+ vectorized=1,
+ extra_args={},
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=1,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {"rss": cast(RSSSetting, RSSSetting.SetIPOnly())}
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=0,
+ extra_args=extra_args,
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1,
+ buffers=0,
+ in_order=1,
+ vectorized=1,
+ extra_args=extra_args,
+ )
--
2.56.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH v6 3/3] dts: add pvp multi paths virtio performance testsuite
2026-11-12 21:00 ` [PATCH v6 1/3] dts: create default performance test configuration Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 2/3] dts: add pvp multi paths vhost performance testsuite Koushik Bhargav Nimoji
@ 2026-11-12 21:00 ` Koushik Bhargav Nimoji
2026-11-19 18:41 ` [PATCH v6 1/3] dts: create default performance test configuration Luca Vizzarro
2 siblings, 0 replies; 28+ messages in thread
From: Koushik Bhargav Nimoji @ 2026-11-12 21:00 UTC (permalink / raw)
To: luca.vizzarro, patrickrobb1997
Cc: dev, dladd, abailey, lylavoie, Koushik Bhargav Nimoji
This patch adds the pvp multi paths virtio single core forward
performance testsuite, which launches testpmd using the vhost
and virtio virtual devices with two and one core respectively,
and tests the virtio single core throughput performance.
Signed-off-by: Koushik Bhargav Nimoji <knimoji@iol.unh.edu>
---
...vp_multi_paths_virtio_single_core_perf.rst | 8 +
dts/configurations/tests_config.example.yaml | 13 +
...pvp_multi_paths_virtio_single_core_perf.py | 424 ++++++++++++++++++
3 files changed, 445 insertions(+)
create mode 100644 doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
create mode 100644 dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
diff --git a/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
new file mode 100644
index 0000000000..853d04ad40
--- /dev/null
+++ b/doc/api/dts/tests.TestSuite_pvp_multi_paths_virtio_single_core_perf.rst
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+pvp_multi_paths_virtio_single_core_perf Test Suite
+==================================================
+
+.. automodule:: tests.TestSuite_pvp_multi_paths_virtio_single_core_perf
+ :members:
+ :show-inheritance:
diff --git a/dts/configurations/tests_config.example.yaml b/dts/configurations/tests_config.example.yaml
index 1222469b3a..704b7ce07a 100644
--- a/dts/configurations/tests_config.example.yaml
+++ b/dts/configurations/tests_config.example.yaml
@@ -49,6 +49,19 @@ hello_world:
# expected_mpps: 1.0
# delta_tolerance: 0.05
+# pvp_multi_paths_virtio_single_core_perf:
+# test_parameters: # Add frame size / descriptor count combinations as needed
+# - frame_size: 64
+# num_descriptors: 512
+# expected_mpps: 1.0 # Set millions of packets per second according to your devices expected throughput for this given frame size / descriptor count
+# - frame_size: 64
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# - frame_size: 512
+# num_descriptors: 1024
+# expected_mpps: 1.0
+# delta_tolerance: 0.05
+
# pmd_rss:
# NUM_QUEUES: 4
# ACTUAL_KEY_SIZE: 52
diff --git a/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
new file mode 100644
index 0000000000..16c6feefa8
--- /dev/null
+++ b/dts/tests/TestSuite_pvp_multi_paths_virtio_single_core_perf.py
@@ -0,0 +1,424 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2025 University of New Hampshire
+
+"""Virtio-user single-core forwarding performance test suite.
+
+This suite measures the packet forwarding throughput of DPDK's virtio-user PMD running on a
+single CPU core. Performance is evaluated across multiple virtio path implementations, including
+packed versus split rings, in-order delivery, mergeable buffers, and SIMD vectorization.
+Test cases are parameterized using combinations of frame sizes, RX/TX descriptor ring counts,
+and target MPPS baselines specified in the test configuration. High-speed traffic is injected
+from an external generator through the physical host ports into the virtio-user instance,
+looped back, and returned to the generator. The aggregate MPPS processed by the single virtio
+core is verified against configured expected performance baselines to determine the test result.
+"""
+
+from pathlib import PurePath
+from typing import cast
+
+from scapy.layers.inet import IP
+from scapy.layers.l2 import Ether
+from scapy.packet import Raw
+
+from api.artifact import Artifact
+from api.capabilities import (
+ LinkTopology,
+ requires_link_topology,
+)
+from api.packet import assess_performance_by_packet
+from api.params.eal import Params, VirtualDevice
+from api.params.types import LogicalCoreList, RSSSetting, TestPmdParamsDict
+from api.test import get_current_test_case_name, verify, write_performance_json
+from api.test_suite import PerfSuiteConfig, TestSuite, perf_suite, perf_test
+from api.testpmd import TestPmd
+from api.testpmd.config import (
+ PortTopology,
+ RXRingParams,
+ SimpleForwardingModes,
+ TXRingParams,
+)
+
+
+@perf_suite
+@requires_link_topology(LinkTopology.TWO_LINKS)
+class TestPvpMultiPathsVirtioSingleCorePerf(TestSuite):
+ """pvp multi paths virtio single core performance test suite."""
+
+ config: PerfSuiteConfig
+ vhost_net_path: PurePath
+
+ def set_up_suite(self):
+ """Set up the test suite.
+
+ Creates a safe path for vhost socket files and creates an
+ editable copy of the test parameters to store results.
+ """
+ self.vhost_net_path = Artifact(
+ "sut", "vhost-net", save_local_copy=False, custom_path=PurePath(".")
+ )
+ self.test_parameters = [p.model_dump() for p in self.config.test_parameters]
+
+ def _transmit(
+ self, vhost: TestPmd, virtio: TestPmd, frame_size: int, repetitions: int = 1
+ ) -> float:
+ """Transmit packets using testpmd instances and compute average MPPS.
+
+ Args:
+ vhost: the running vhost testpmd shell.
+ virtio: the running virtio testpmd shell.
+ frame_size: The size of the frame to transmit.
+ repetitions: The number of times to rerun the transmission.
+
+ Returns:
+ The MPPS (millions of packets per second) forwarded by the SUT.
+ """
+ assert repetitions > 0, "Invalid number of repetitions given, must be greater than 0."
+ # Build packet with dummy values, and account for the 14B and 20B Ether and IP headers
+ packet = (
+ Ether(src="52:00:00:00:00:00")
+ / IP(src="1.2.3.4", dst="192.18.1.0")
+ / Raw(load="x" * (frame_size - 14 - 20))
+ )
+
+ vhost.start()
+ virtio.start()
+ rx_avg = 0.0
+
+ for _ in range(repetitions):
+ # Transmit for 5 seconds.
+ stats = assess_performance_by_packet(packet=packet, duration=5)
+ rx_avg += stats.rx_pps
+ return rx_avg / (repetitions * 1_000_000)
+
+ def _create_and_transmit(
+ self,
+ ring_format: int,
+ in_order: int,
+ buffers: int,
+ vectorized: int,
+ extra_args: TestPmdParamsDict,
+ queues: int = 1,
+ ) -> None:
+ """Create testpmd instances with specified params and send traffic.
+
+ Args:
+ ring_format: selects the virtio queue descriptor layout.
+ in_order: toggles in-order packet processing.
+ buffers: enables mergeable rx buffers.
+ vectorized: enables SIMD vectorized rx/tx data paths.
+ extra_args: extra/generic TestPmd arguments.
+ queues: number of rx/tx queues allocated to virtio device.
+ """
+ sut_dpdk_driver = self._ctx.sut_node.config.ports[0].os_driver_for_dpdk
+ vhost_user_vdev = VirtualDevice(f"net_vhost0,iface={self.vhost_net_path},queues={queues}")
+ virtio_user_vdev = VirtualDevice(
+ "net_virtio_user0,"
+ "mac=00:11:22:33:44:10,"
+ f"path={self.vhost_net_path},"
+ f"queues={queues},"
+ f"packed_vq={ring_format},"
+ f"mrg_rxbuf={buffers},"
+ f"in_order={in_order},"
+ f"vectorized={vectorized}"
+ )
+
+ for params in self.test_parameters:
+ frame_size = params["frame_size"]
+ num_descriptors = params["num_descriptors"]
+ expected_mpps = params["expected_mpps"]
+
+ default_args: TestPmdParamsDict = {
+ "tx_ring": TXRingParams(descriptors=int(num_descriptors)),
+ "rx_ring": RXRingParams(descriptors=int(num_descriptors)),
+ }
+
+ if sut_dpdk_driver == "mlx5_core":
+ default_args["burst"] = 64
+ default_args["mbcache"] = 512
+ elif sut_dpdk_driver == "i40e":
+ default_args["rx_queues"] = 1
+ default_args["tx_queues"] = 1
+
+ vhost_params: TestPmdParamsDict = {
+ "prefix": "vhost",
+ "allowed_ports": [],
+ "memory_channels": 4,
+ "port_topology": PortTopology.chained,
+ "vdevs": [vhost_user_vdev],
+ "lcore_list": LogicalCoreList([1, 2, 3]),
+ "nb_cores": 2,
+ **default_args,
+ }
+
+ virtio_params: TestPmdParamsDict = {
+ "prefix": "virtio",
+ "no_pci": True,
+ "memory_channels": 4,
+ "allowed_ports": [],
+ "vdevs": [virtio_user_vdev],
+ "lcore_list": LogicalCoreList([4, 5]),
+ "nb_cores": 1,
+ **extra_args,
+ **default_args,
+ }
+
+ with (
+ TestPmd(**vhost_params) as vhost,
+ TestPmd(**virtio_params) as virtio,
+ ):
+ vhost.set_forward_mode(SimpleForwardingModes.io)
+ virtio.set_forward_mode(SimpleForwardingModes.mac)
+ vhost.set_portlist([0, 2, 1])
+
+ assert expected_mpps > 0, "Invalid expected mpps, must be greater than 0."
+
+ measured_mpps = round(
+ self._transmit(vhost, virtio, int(frame_size), repetitions=5), 3
+ )
+
+ performance_delta = round(
+ (float(measured_mpps) - float(expected_mpps)) / float(expected_mpps),
+ 3,
+ )
+
+ params["measured_mpps"] = measured_mpps
+ params["performance_delta"] = performance_delta
+ params["passing"] = float(performance_delta) >= -self.config.delta_tolerance
+
+ self._produce_stats_table(self.test_parameters)
+ for params in self.test_parameters:
+ verify(
+ params["passing"] is True,
+ f"""Packets forwarded is less than {(1 - self.config.delta_tolerance) * 100}%
+ of the expected baseline.
+ Measured MPPS = {params["measured_mpps"]}
+ Expected MPPS = {params["expected_mpps"]}""",
+ )
+
+ def _produce_stats_table(self, test_parameters: list[dict]) -> None:
+ """Display performance results in table format and write to structured JSON file.
+
+ Args:
+ test_parameters: The expected and real stats per set of test parameters.
+ """
+ test_case = get_current_test_case_name()
+ header = f"{'Frame Size':>12} | {'TXD/RXD':>12} | {'Real MPPS':>12} | {'Expected MPPS':>14}"
+ print(f"{test_case} Results:")
+ print("-" * len(header))
+ print(header)
+ print("-" * len(header))
+ for params in test_parameters:
+ print(f"{params['frame_size']:>12} | {params['num_descriptors']:>12} | ", end="")
+ print(f"{params['measured_mpps']:>12} | {params['expected_mpps']:>14}")
+ print("-" * len(header))
+
+ write_performance_json({"results": test_parameters})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_non_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: buffers=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=1, in_order=0, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ self._create_and_transmit(ring_format=0, buffers=0, in_order=0, vectorized=1, extra_args={})
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_mergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, buffers=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "tx_offloads": 0,
+ "enable_hw_vlan_strip": True,
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=1, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_inorder_nonmergeable(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=0, extra_args=extra_args
+ )
+
+ @perf_test
+ def test_perf_vhost_single_core_virtio11_vectorized(self) -> None:
+ """Validate expected single core forwarding performance.
+
+ Steps:
+ * Set TestPMD virtio parameters: ring_format=1, in_order=1, vectorized=1.
+ * Create a packet according to the frame size specified in the test config.
+ * Transmit from the traffic generator's ports 0 and 1 at above the expect.
+ * Forward on TestPMD's interfaces 0 and 1 with 1 core.
+
+ Verify:
+ * The resulting MPPS forwarded is greater than expected_mpps*(1-delta_tolerance).
+ """
+ extra_args: TestPmdParamsDict = {
+ "rss": cast(RSSSetting, RSSSetting.SetIPOnly()),
+ "other_eal_param": Params.from_str("--force-max-simd-bitwidth=512"),
+ }
+ self._create_and_transmit(
+ ring_format=1, buffers=0, in_order=1, vectorized=1, extra_args=extra_args, queues=2
+ )
--
2.56.0
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH v6 1/3] dts: create default performance test configuration
2026-11-12 21:00 ` [PATCH v6 1/3] dts: create default performance test configuration Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 2/3] dts: add pvp multi paths vhost performance testsuite Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 3/3] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
@ 2026-11-19 18:41 ` Luca Vizzarro
2026-11-20 12:02 ` Thomas Monjalon
2 siblings, 1 reply; 28+ messages in thread
From: Luca Vizzarro @ 2026-11-19 18:41 UTC (permalink / raw)
To: Koushik Bhargav Nimoji, patrickrobb1997; +Cc: dev, dladd, abailey, lylavoie
Hi Koushik,
thank you for this. Accepted to next-dts with minor doc changes.
Luca
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v6 1/3] dts: create default performance test configuration
2026-11-19 18:41 ` [PATCH v6 1/3] dts: create default performance test configuration Luca Vizzarro
@ 2026-11-20 12:02 ` Thomas Monjalon
0 siblings, 0 replies; 28+ messages in thread
From: Thomas Monjalon @ 2026-11-20 12:02 UTC (permalink / raw)
To: Koushik Bhargav Nimoji, Luca Vizzarro
Cc: patrickrobb1997, dev, dladd, abailey, lylavoie
19/11/2026 19:41, Luca Vizzarro:
> Hi Koushik,
>
> thank you for this. Accepted to next-dts with minor doc changes.
>
> Luca
>
I've pulled it in main,
but my AI raises multiple warnings:
- With the chained port list [0, 2, 1], reverse traffic bypasses virtio
but contributes to aggregate throughput, allowing false passes.
- Virtio-user defaults to 256 descriptors:
setting testpmd’s ring sizes does not replace the missing queue_size vdev parameter.
- The queues=2 case leaves testpmd using one Rx/Tx queue;
rx_queues and tx_queues must also be set.
- allowed_ports=[] bypasses DTS’s configured port selection,
making the assumed port numbering unreliable.
- Hardcoded core IDs ignore DTS’s configured CPU selection.
- The packed vectorized case can silently fall back to scalar processing;
the selected datapath should be verified.
- In the vhost suite, virtio’s two requested forwarding cores are reduced to one
because it has only one forwarding stream.
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2026-11-20 12:02 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 18:37 [RFC PATCH] dts: add pvp multi paths virtio performance testsuite Koushik Bhargav Nimoji
2026-09-03 20:11 ` [PATCH v1] " Koushik Bhargav Nimoji
2026-10-08 19:11 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Koushik Bhargav Nimoji
2026-10-08 19:11 ` [PATCH v2 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-10-19 18:58 ` Andrew Bailey
2026-10-19 18:36 ` [PATCH v2 1/2] dts: add pvp multi paths vhost " Andrew Bailey
2026-10-20 17:30 ` [PATCH v3 " Koushik Bhargav Nimoji
2026-10-20 17:30 ` [PATCH v3 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-10-29 17:01 ` Luca Vizzarro
2026-11-03 15:37 ` Koushik Bhargav Nimoji
2026-11-03 15:47 ` Luca Vizzarro
2026-10-29 16:53 ` [PATCH v3 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
2026-11-03 20:28 ` Koushik Bhargav Nimoji
2026-11-03 22:02 ` [PATCH v4 " Koushik Bhargav Nimoji
2026-11-03 22:02 ` [PATCH v4 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-11-10 12:51 ` Luca Vizzarro
2026-11-10 12:50 ` [PATCH v4 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
2026-11-10 15:40 ` Koushik Bhargav Nimoji
2026-11-10 20:10 ` [PATCH v5 " Koushik Bhargav Nimoji
2026-11-10 20:10 ` [PATCH v5 2/2] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-11-11 16:30 ` [PATCH v5 1/2] dts: add pvp multi paths vhost " Luca Vizzarro
2026-11-12 15:48 ` Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 1/3] dts: create default performance test configuration Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 2/3] dts: add pvp multi paths vhost performance testsuite Koushik Bhargav Nimoji
2026-11-12 21:00 ` [PATCH v6 3/3] dts: add pvp multi paths virtio " Koushik Bhargav Nimoji
2026-11-19 18:41 ` [PATCH v6 1/3] dts: create default performance test configuration Luca Vizzarro
2026-11-20 12:02 ` Thomas Monjalon
2026-10-20 18:20 ` [RFC PATCH] dts: add pvp multi paths virtio performance testsuite Koushik Bhargav Nimoji
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox