From: Eugenio Perez Martin <eperezma@redhat.com>
To: Ammar Yasser <aerosound161@gmail.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v2 0/7] Add vhost-net kernel support to pasta
Date: Wed, 21 Oct 2026 12:41:26 +0200 [thread overview]
Message-ID: <CAJaqyWeJTS1HfRzOrWdeYBb+Hi8iWPQYg6Yr+yVU8PFQua=Jsg@mail.gmail.com> (raw)
In-Reply-To: <DM6JRWPVD4T4.1AYMH6HN8K293@gmail.com>
On Fri, Oct 16, 2026 at 10:33 PM Ammar Yasser <aerosound161@gmail.com> wrote:
>
> This work is based on the original v2 RFC by Eugenio Perez:
>
> Link:
> https://archives.passt.top/passt-dev/20250709174748.3514693-1-eperezma@redhat.com/
>
> It is the first finished patch series for vhost-kernel support after a
> third RFC was submitted:
>
> Link:
> https://archives.passt.top/passt-dev/20260802132155.870796-1-aerosound161@gmail.com/
>
> vhost-net is a kernel device that allows reading and writing packets to a
> tap device using virtqueues instead of read(2), write(2), and their
> vectored counterparts. Frames are handed over through a shared descriptor
> ring, so several of them can be passed to the kernel at once rather than
> issuing a syscall per frame.
>
> The v3 RFC didn't yield any performance improvements because, to retain
> correctness, sends between pasta and the vhost-kernel thread had to be
> synchronous. This patch series fixes this problem through the changes
> introduced in the last commit, titled:
>
> "tap/tcp: Replace tcp_payload_used with a ring buffer style index"
>
> The changes reliably yield a roughly 2x speedup on the TX path (container
> to host).
>
> Numbers were obtained through iperf3 with the following methodology and
> results:
>
> Pasta command:
> ./pasta -f --runas 0:0 --map-guest-addr 192.168.0.5
> --vhost-kernel on --config-net 2729785
>
> Host:
> iperf3 -s1J
>
> Container:
> iperf3 -c 192.168.0.5 -t 10 -P4 -l 1M -w 32M -i1
>
> With --vhost-kernel on:
>
> [SUM] 0.00-10.00 sec 1.36 GBytes 1.17 Gbits/sec 3643 sender
> [SUM] 0.00-10.00 sec 1.16 GBytes 999 Mbits/sec receiver
>
> With --vhost-kernel off:
>
> [SUM] 0.00-10.00 sec 700 MBytes 587 Mbits/sec 3556 sender
> [SUM] 0.00-10.10 sec 495 MBytes 411 Mbits/sec receiver
>
Sounds good :). Sorry I didn't have the time to review the series
properly, but I suspect you can use VIRTIO F IN ORDER to both:
* Increase the performance even more.
* Make the code simpler as pasta fits (or it used to fit) very nicely
with it. It would have make *my* code simpler at least, so I'm
suspecting it will make this series simpler too.
Does that help?
Thanks!
> v2:
> - removed all use of epoll_ctl in vhost_setup_eventfds in favor of epoll_add
> - prevent all functions that register memory regions into the vhost_memory
> object from overflowing
> - remove the unions with flexible array members in vring_avail_pasta and
> vring_used_pasta in favor of hardcoding the ring array to have VHOST_NDESCS
> entries to avoid having to ignore Wpedantic
> - remove the && operator with TCP_CURR_IDX when computing no_csum
> - make desc_id in tx_reap a uint32_t
> - don't make vhost-kernel a required argument
>
> Ammar Yasser (7):
> tap: Move the tap_hdr file to a separate file
> conf: Add context fields, epoll types and --vhost-kernel flag to pasta
> virtio: Add the pasta vhost-net interface and implementation
> tap: Implement the pasta vhost-net from-guest path
> tap, tcp, udp: Prepare the to-guest path for vhost-net
> tap: Implement the pasta vhost-net to-guest path
> tap/tcp: Replace tcp_payload_used with a ring buffer style index
>
> Makefile | 2 +-
> conf.c | 19 +++
> epoll_type.h | 4 +
> passt.c | 9 ++
> passt.h | 79 ++++++++++-
> tap.c | 368 +++++++++++++++++++++++++++++++++++++++++++++------
> tap.h | 47 ++-----
> tap_hdr.h | 23 ++++
> tcp_buf.c | 149 ++++++++++++++++-----
> tcp_buf.h | 4 +
> udp.c | 47 +++++--
> udp.h | 3 +
> util.c | 18 +++
> util.h | 2 +
> vhost.c | 295 +++++++++++++++++++++++++++++++++++++++++
> vhost.h | 91 +++++++++++++
> 16 files changed, 1036 insertions(+), 124 deletions(-)
> create mode 100644 tap_hdr.h
> create mode 100644 vhost.c
> create mode 100644 vhost.h
>
> --
> 2.39.5 (Apple Git-154)
>
next prev parent reply other threads:[~2026-10-21 10:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 20:33 Ammar Yasser
2026-10-21 10:41 ` Eugenio Perez Martin [this message]
2026-10-16 20:45 aerosouund
2026-10-16 20:49 aerosouund
2026-10-16 20:55 aerosouund
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='CAJaqyWeJTS1HfRzOrWdeYBb+Hi8iWPQYg6Yr+yVU8PFQua=Jsg@mail.gmail.com' \
--to=eperezma@redhat.com \
--cc=aerosound161@gmail.com \
--cc=passt-dev@passt.top \
/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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).