From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: passt.top; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=VedkoK+z; dkim-atps=neutral Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by passt.top (Postfix) with ESMTPS id 61E6F5A026E for ; Sun, 02 Aug 2026 15:23:24 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-47db714766aso2064419f8f.0 for ; Sun, 02 Aug 2026 06:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785677004; x=1786281804; darn=passt.top; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=6aVBfLyIZBAjPiM/b9/JcUGQHiUjSy0eI7S+Iht1wqA=; b=VedkoK+z0FX/ckpywGhQxH1HMuzYI69ggukpSQ5Cb4uon4s6ZlDZjWFRm4Fr4Uqvmu uSubSxUn82wxhIutvrlU9i8Sv3gQ/vrCIgovFGHT521bO9T9u9/0Rl/62d/xtES7wPI7 oHVkT9j70jSayRjchsNtxF46uh+OokTVkG7sbdOYq9LyP/NXtL7rWRSZLxCdBGQBaGXp qL+6vgd8ZNqq535LF8DEPrZiN3a+piOPB3XuoH5YbTcfXU5wvA1jsicLByn2RXLk50/d nFug6R1AKE8bJN75lkpe59zrQ5dxJjJOQNz1K5sVgSqd+7cOtjNaUqtSycSXudM3bwSc s6kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785677004; x=1786281804; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6aVBfLyIZBAjPiM/b9/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:a42:b0:495:69eb:27d3 with SMTP id 5b1f17b1804b1-4980eba0a6fmr122816635e9.8.1785677003546; Sun, 02 Aug 2026 06:23:23 -0700 (PDT) Received: from localhost.localdomain ([196.137.15.128]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4980869106csm180745155e9.9.2026.08.02.06.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2026 06:23:23 -0700 (PDT) From: Ammar Yasser To: passt-dev@passt.top Subject: [RFC v3 0/8] Add vhost-net kernel support to pasta Date: Sun, 2 Aug 2026 13:21:47 +0000 Message-Id: <20260802132155.870796-1-aerosound161@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 5BCWXJHCGTENFBWKCHWYFGQLVR3JESXV X-Message-ID-Hash: 5BCWXJHCGTENFBWKCHWYFGQLVR3JESXV 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: eperezma@redhat.com, Ammar Yasser 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, 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