public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [RFC v3 0/8] Add vhost-net kernel support to pasta
@ 2026-08-02 13:21 Ammar Yasser
  2026-08-02 13:21 ` [RFC v3 1/8] tap: Move the tap_hdr file to a separate file Ammar Yasser
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Ammar Yasser @ 2026-08-02 13:21 UTC (permalink / raw)
  To: passt-dev; +Cc: eperezma, Ammar Yasser

This work is based on the original v2 RFC by Eugenio Perez, and continues its
version numbering.

Link: https://archives.passt.top/passt-dev/20250709174748.3514693-1-eperezma@redhat.com/

vhost-net is a kernel device that allows reading and writing packets to a tap
device using virtqueues instead of read(2) and 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.

This RFC introduces an option to pasta, --vhost, which if specified will
leverage this mode of acceleration.

I haven't benchmarked this against the existing path yet, so the performance
argument above is so far unquantified.

TODO: test what happens when the namespace wants to send data but we don't have
available rx descriptors, and vice versa for tx.

TODO: tap_send_frames() currently carries an implicit contract that it is
synchronous: once it returns, the caller is free to reuse its frame buffers.
That holds for writev() and for vhost-user, but not for vhost-kernel, where
returning only means the descriptors have been queued. pasta can overwrite 
a buffer while the kernel vhost worker thread is still reading the descriptor
pointing at it.

I haven't settled on how to restore that contract, and would appreciate
direction before building further on top of it.

Ammar Yasser (8):
  tap: Move the tap_hdr file to a separate file
  udp,tcp: Make protocol specific buffers public
  conf: Add context fields, epoll types and the --vhost flag to pasta
  virtio: Define the pasta vhost interface
  virtio: Implement the pasta vhost functions
  virtio: Implement pasta vhost acceleration guest->pasta path
  pasta: Implement pasta vhost TX (pasta->guest) prerequisites
  tap: Implement pasta vhost TX

 conf.c         |   6 +
 epoll_type.h   |   4 +
 passt.c        |   9 ++
 passt.h        |  17 ++-
 tap.c          | 317 +++++++++++++++++++++++++++++++++++++++++--------
 tap.h          |  10 +-
 tap_hdr.h      |  19 +++
 tcp_buf.c      |  51 +++++---
 tcp_buf.h      |  14 +++
 udp.c          |  68 ++++++-----
 udp.h          |  53 +++++++++
 udp_internal.h |  13 --
 virtio.c       | 283 ++++++++++++++++++++++++++++++++++++++++++-
 virtio.h       |  76 ++++++++++++
 14 files changed, 827 insertions(+), 113 deletions(-)
 create mode 100644 tap_hdr.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-08-02 13:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-02 13:21 [RFC v3 0/8] Add vhost-net kernel support to pasta Ammar Yasser
2026-08-02 13:21 ` [RFC v3 1/8] tap: Move the tap_hdr file to a separate file Ammar Yasser
2026-08-02 13:21 ` [RFC v3 2/8] udp,tcp: Make protocol specific buffers public Ammar Yasser
2026-08-02 13:21 ` [RFC v3 3/8] conf: Add context fields, epoll types and the --vhost flag to pasta Ammar Yasser
2026-08-02 13:21 ` [RFC v3 4/8] virtio: Define the pasta vhost interface Ammar Yasser
2026-08-02 13:21 ` [RFC v3 5/8] virtio: Implement the pasta vhost functions Ammar Yasser
2026-08-02 13:21 ` [RFC v3 6/8] virtio: Implement pasta vhost acceleration guest->pasta path Ammar Yasser
2026-08-02 13:21 ` [RFC v3 7/8] pasta: Implement pasta vhost TX (pasta->guest) prerequisites Ammar Yasser
2026-08-02 13:21 ` [RFC v3 8/8] tap: Implement pasta vhost TX Ammar Yasser

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).