From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=none dis=none) header.from=gmail.com Received: from [10.196.169.86] (unknown [105.199.60.27]) by passt.top (Postfix) with ESMTP id 7B59C5A0262 for ; Fri, 04 Sep 2026 23:29:04 +0200 (CEST) X-FEAS-Client-IP: 10.196.169.86 Received: by Ammars-Air.localdomain (Postfix, from userid 501) id 1063EFD0F48; Sat, 5 Sep 2026 00:28:52 +0300 (EEST) From: aerosouund To: passt-dev@passt.top Subject: [PATCH 0/7] Add vhost-net kernel support to pasta Date: Sat, 5 Sep 2026 00:28:19 +0300 Message-Id: <20260904212826.41027-1-aerosound161@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID-Hash: KA77PE4TQLRW2KNNHNXU4O3UWH3IXZMY X-Message-ID-Hash: KA77PE4TQLRW2KNNHNXU4O3UWH3IXZMY X-MailFrom: ammaryasser@Ammars-Air.localdomain X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: eperezma@redhat.com, aerosouund X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 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 | 364 ++++++++++++++++++++++++++++++++++++++++++++------- tap.h | 47 ++----- tap_hdr.h | 23 ++++ tcp_buf.c | 143 +++++++++++++++----- tcp_buf.h | 4 + udp.c | 41 ++++-- udp.h | 3 + util.c | 12 ++ util.h | 2 + vhost.c | 295 +++++++++++++++++++++++++++++++++++++++++ vhost.h | 79 +++++++++++ 16 files changed, 1002 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)