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 mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by passt.top (Postfix) with ESMTPS id 4A6E45A0265 for ; Fri, 16 Oct 2026 22:33:06 +0200 (CEST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4a1d665a5efso3589545e9.3 for ; Fri, 16 Oct 2026 13:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792182786; x=1792787586; darn=passt.top; h=content-transfer-encoding:mime-version:subject:cc:to:from :message-id:date:content-type:from:to:cc:subject:date:message-id :reply-to:content-type; bh=y2CvOZX+1bXdzeSH8KbsGtP+C3MHrEkniusEUHVXaQM=; b=mMnRE2yxtBk+omhM1zj9FmKvaVWN5lYYAz3a9JxytNRT5xu60jz+cdKfICL+WDm1E2 AajHufo/KG88PvOGrBUqz2Z7Uhq+msSVURJEancmSKNbZ9ptM38uSFh8rnk/ngoPhOff UfCBDCKbX9bE/HVF9hozgsV1ael2ICcYfHQRTmjYJ6++B4OCrO2UrGgW02NhViPWxVPA BO2VhesHdJthBhmJH0jTDPDjvNyI5+pDR3LNN9SRXfJggmlfyGanOQ27rvUyIeztYENf BYYF++JwrfwMxTXuwduXFjpYFQyt6PNu66FFNpF2v2rTdccNDLgC6Cj7WT291Lyw0Q95 pb0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792182786; x=1792787586; h=content-transfer-encoding:mime-version:subject:cc:to:from :message-id:date:content-type:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=y2CvOZX+1bXdzeSH8KbsGtP+C3MHrEkniusEUHVXaQM=; b=te9I4Au4Arh5TMJwCMuWmRzEl67GvtRKfakAfAXWytrM6+xX+bZdNZoBzB6EP5ztEi 31g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 Oct 2026 13:33:05 -0700 (PDT) Received: from localhost ([196.157.71.229]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a1bd91c55bsm155091085e9.0.2026.10.16.13.33.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Oct 2026 13:33:05 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 Date: Fri, 16 Oct 2026 23:33:03 +0300 Message-Id: From: "Ammar Yasser" To: Subject: [PATCH v2 0/7] Add vhost-net kernel support to pasta MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: KDZUSFYPIZUN6NI4RVNOJQDKUGVBHYTD X-Message-ID-Hash: KDZUSFYPIZUN6NI4RVNOJQDKUGVBHYTD X-MailFrom: aerosound161@gmail.com 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: =?utf-8?q?Eugenio_P=C3=A9rez?= 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 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)