On Tue, Nov 10, 2026 at 7:50 AM Luca Vizzarro <[email protected]> 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!