From: Patrick Robb <probb@iol.unh.edu>
To: Dean Marx <dmarx@iol.unh.edu>
Cc: luca.vizzarro@arm.com, yoan.picchi@foss.arm.com,
Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com,
dev@dpdk.org
Subject: Re: [PATCH v4 3/3] dts: add virtio forwarding test suite
Date: Fri, 7 Nov 2025 15:48:26 -0500 [thread overview]
Message-ID: <CAJvnSUAHYDFrZ2cEZPUxdunAe95MpQbvwpU7AUtGFK9q+XRmKA@mail.gmail.com> (raw)
In-Reply-To: <20251024185056.607160-3-dmarx@iol.unh.edu>
[-- Attachment #1: Type: text/plain, Size: 3711 bytes --]
On Fri, Oct 24, 2025 at 2:51 PM Dean Marx <dmarx@iol.unh.edu> wrote:
>
> + @requires(topology_type=LinkTopology.TWO_LINKS)
> + @func_test
> + def pvp_loop(self) -> None:
> + """Test vhost/virtio physical-virtual-physical topology.
> +
> + Steps:
> + * Launch testpmd session with a physical NIC and virtio-user
> vdev
> + connected to a vhost-net socket.
> + * Configure the tap interface that is created with IP address
> and
> + set link state to UP.
> + * Launch second testpmd session with af_packet vdev connected
> to
> + the tap interface.
> + * Start packet forwarding on both testpmd sessions.
> + * Send 100 packets to the physical interface from external
> tester.
> + * Capture packets on the same physical interface.
> +
> + Verify:
> + * Vhost session receives/forwards 100+ packets.
> + * Physical interface receives all 100 sent packets.
> + """
> + self.sut_node = self._ctx.sut_node
> + if not isinstance(self.sut_node.main_session, LinuxSession):
> + verify(False, "Must be running on a Linux environment.")
> + with TestPmd(
> + prefix="virtio",
> +
> vdevs=[VirtualDevice("virtio_user0,path=/dev/vhost-net,queues=1,queue_size=1024")],
> + ) as virtio:
> + self.sut_node.main_session.set_interface_link_up(name="tap0")
>
Is it the case that if I already have tap0 created on my SUT machine, this
testsuite will create a tap1 and then the testsuite will fail to run
properly on the line above (because tap1 won't be brought up)? If there is
no way of getting around this limitation, we should add a new capability
for "tap interface names available" or something and skip if tap0 is found
in "ip a" or a similar solution.
> + with TestPmd(
> + prefix="vhost", no_pci=True,
> vdevs=[VirtualDevice("net_af_packet0,iface=tap0")]
> + ) as vhost:
> + virtio.set_forward_mode(SimpleForwardingModes.mac)
> + vhost.set_forward_mode(SimpleForwardingModes.mac)
> + vhost.start()
> + virtio.start()
> +
> + packet = Ether() / IP()
> + packets = [packet] * 100
> + captured_packets = send_packets_and_capture(packets)
> +
> + vhost.stop()
> + virtio.stop()
> +
> + vhost_forwarding_stats, vhost_raw_output =
> vhost.show_port_stats_all()
> +
> + rx_packets = vhost_forwarding_stats[0].rx_packets
> + tx_packets = vhost_forwarding_stats[0].tx_packets
> +
> + log(f"Vhost forwarding statistics:\n{vhost_raw_output}")
> +
> + verify(
> + rx_packets >= 100 and tx_packets >= 100,
> + f"PVP loop forwarding verification failed: vhost
> interface RX={rx_packets},"
> + f" TX={tx_packets} (expected ≥100 each).",
> + )
> +
> + verify(
> + len(captured_packets) >= 100, "Sent packets not
> received on physical interface."
> + )
> --
> 2.51.0
>
>
Otherwise, change the pvp requirement to ONE_LINK, set portlist to 0, 2, 1
(2 is the vdev) when 2 link topology, and 0, 1 when 1 link, and set
forwarding to chained mode so that the packet forwarding works as expected
regardless of whether we have 1 or 2 physical interfaces the testpmd
instance is using.
Thanks.
Reviewed-by: Patrick Robb <probb@iol.unh.edu>
[-- Attachment #2: Type: text/html, Size: 4939 bytes --]
next prev parent reply other threads:[~2025-11-07 20:49 UTC|newest]
Thread overview: 24+ 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
2025-10-09 13:04 ` Patrick Robb
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
2025-10-21 15:13 ` Luca Vizzarro
2025-10-21 17:35 ` Dean Marx
2025-10-23 12:59 ` Patrick Robb
2025-10-24 18:38 ` Dean Marx
2025-10-24 17:46 ` [PATCH v3 1/3] dts: add start Tx first method to testpmd shell Dean Marx
2025-10-24 17:46 ` [PATCH v3 2/3] dts: add method for bringing link of interface up Dean Marx
2025-10-24 17:47 ` [PATCH v3 3/3] dts: add virtio forwarding test suite Dean Marx
2025-10-24 18:50 ` [PATCH v4 1/3] dts: add start Tx first method to testpmd shell Dean Marx
2025-10-24 18:50 ` [PATCH v4 2/3] dts: add method for bringing link of interface up Dean Marx
2025-10-24 18:50 ` [PATCH v4 3/3] dts: add virtio forwarding test suite Dean Marx
2025-11-07 20:48 ` Patrick Robb [this message]
2025-11-07 21:53 ` Dean Marx
2025-11-07 21:50 ` [PATCH v5 1/4] dts: add start Tx first method to testpmd shell Dean Marx
2025-11-07 21:50 ` [PATCH v5 2/4] dts: add methods for runtime interface config Dean Marx
2025-11-07 21:50 ` [PATCH v5 3/4] dts: add set portlist command to testpmd shell Dean Marx
2025-11-07 21:50 ` [PATCH v5 4/4] 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=CAJvnSUAHYDFrZ2cEZPUxdunAe95MpQbvwpU7AUtGFK9q+XRmKA@mail.gmail.com \
--to=probb@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--cc=luca.vizzarro@arm.com \
--cc=paul.szczepanek@arm.com \
--cc=yoan.picchi@foss.arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).