DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dean Marx <dmarx@iol.unh.edu>
To: Luca Vizzarro <luca.vizzarro@arm.com>
Cc: probb@iol.unh.edu, yoan.picchi@foss.arm.com,
	Honnappa.Nagarahalli@arm.com,  paul.szczepanek@arm.com,
	dev@dpdk.org
Subject: Re: [PATCH v1 2/2] dts: add virtio forwarding test suite
Date: Fri, 3 Oct 2025 14:14:37 -0400	[thread overview]
Message-ID: <CABD7UXNptEpXZjn4ym5Nd5R-K_S1u++12p+wKXt0yg6ahwjknA@mail.gmail.com> (raw)
In-Reply-To: <175862694193.36951.18019709083217178912.luca.vizzarro@arm.com>

> Would it be worth introducing a TextParser class that will actually
> parse the forwarding stats and present them properly to the test?

Yes I think that would be useful moving forward, I'll add one to the
next version.

<snip>
> > +        with TestPmdShell(
> > +            prefix="vhost",
> > +            no_pci=True,
> > +            memory_channels=4,
> > +            vdevs=[VirtualDevice("eth_vhost0,iface=/tmp/vhost-net,client=1")],
> > +        ) as vhost:
> > +            with TestPmdShell(
> > +                prefix="virtio",
> > +                no_pci=True,
> > +                memory_channels=4,
> > +                vdevs=[
> > +                    VirtualDevice(
> > +                        "net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/vhost-net,server=1"
> > +                    )
> > +                ],
> > +            ) as virtio:
> > +                pass
> > +            # end session and reconnect
> how could this is launched twice? Could use some explanation here.

Essentially the way it works is by launching a vhost-user testpmd
session, which waits for a virtio-user testpmd session to connect to:

EAL: Detected CPU lcores: 32
EAL: Detected NUMA nodes: 2
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/virtio_27338_20251003172250/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized
VIRTIO_DRIVER: vhost_user_start_server(): (/tmp/vhost-net) waiting for
client connection...

Then, when the virtio-user session is launched, it connects to the
vhost-user socket /tmp/vhost-net:

VHOST_CONFIG: (/tmp/vhost-net) connected
...
VHOST_CONFIG: (/tmp/vhost-net) new device status(0x0000000f):
VHOST_CONFIG: (/tmp/vhost-net)  -RESET: 0
VHOST_CONFIG: (/tmp/vhost-net)  -ACKNOWLEDGE: 1
VHOST_CONFIG: (/tmp/vhost-net)  -DRIVER: 1
VHOST_CONFIG: (/tmp/vhost-net)  -FEATURES_OK: 1
VHOST_CONFIG: (/tmp/vhost-net)  -DRIVER_OK: 1
VHOST_CONFIG: (/tmp/vhost-net)  -DEVICE_NEED_RESET: 0
VHOST_CONFIG: (/tmp/vhost-net)  -FAILED: 0

By launching the virtio-user session through the context manager, then
closing it and starting a new session with a new context manager, the
original virtio-user session is closed, disconnecting the client. The
test case is verifying that the vhost-user socket can support multiple
sequential client connections.

> > +            with TestPmdShell(
> > +                prefix="virtio",
> > +                no_pci=True,
> > +                memory_channels=4,
> > +                vdevs=[
> > +                    VirtualDevice(
> > +                        "net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/vhost-net,server=1"
> > +                    )
> Wouldn't it make more sense to store the vdev in a variable and re-use
> it?

Definitely, I'll fix that

<snip>
> > +        self.sut_node = self._ctx.sut_node
> > +        if not isinstance(self._ctx.sut_node.main_session, LinuxSession):
> surely you could just use the `self.sut_node` you've just created :D

Good catch thanks

I'll send out a new version within the next week addressing these
points. Thanks for the review!

  reply	other threads:[~2025-10-03 18:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 20:04 [PATCH v1 1/2] dts: add start Tx first method to testpmd shell Dean Marx
2025-09-16 20:04 ` [PATCH v1 2/2] dts: add virtio forwarding test suite Dean Marx
2025-09-23 11:38   ` Luca Vizzarro
2025-10-03 18:14     ` Dean Marx [this message]
2025-09-23 11:27 ` [PATCH v1 1/2] dts: add start Tx first method to testpmd shell Luca Vizzarro
2025-10-03 19:27 ` [PATCH v2 " Dean Marx
2025-10-03 19:27   ` [PATCH v2 2/2] dts: add virtio forwarding test suite Dean Marx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABD7UXNptEpXZjn4ym5Nd5R-K_S1u++12p+wKXt0yg6ahwjknA@mail.gmail.com \
    --to=dmarx@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=luca.vizzarro@arm.com \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=yoan.picchi@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).