From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id DC0C15A0265 for ; Wed, 21 Oct 2026 12:42:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792579326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vs8Wy87vch+qhHW6kg0BS7oq5m0rj81L8FeLMNh1ahM=; b=DlHdZqWvUixs4eteI4Ye3ftmrF8BubcgQxiySRWu40r3Y4w/G+oniKujJ6fqnWZpPZQBnJ k/UwZKMNDrCFY4NYhx/f5asuvIeTUjUQ7LhzbszYftT5/IWLv/Eim4GVRBDiXun4elJ0lM mGaX9vXXRg5EQHbluUFMeLxyZ5wgMhI= Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-336-r3BuEutbNFuQCbKxYsM0Eg-1; Wed, 21 Oct 2026 06:42:05 -0400 X-MC-Unique: r3BuEutbNFuQCbKxYsM0Eg-1 X-Mimecast-MFC-AGG-ID: r3BuEutbNFuQCbKxYsM0Eg_1792579325 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-8b09ee23de2so9386487b3.0 for ; Wed, 21 Oct 2026 03:42:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792579325; x=1793184125; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=vs8Wy87vch+qhHW6kg0BS7oq5m0rj81L8FeLMNh1ahM=; b=fldRckqYraj4OdIPMubUTse6F1+MH2QRLUjiq8n00wnLOyREjyoWeLFnRkE90WpU3h 0iIK91q3ybem3W9miqGfTboboSb5fZr8Js3FIyCxP0uNHQ8mm7lA65xVAfkJBT1taqns RuteQ5TMB6ySxcBeiugVtGmGkIsR5PSSBggI+WvY/sIlsu3gEQUCs5uKKIM5lWx1eYcw 48RAY/eKXSUC61QB5hec0GnoNn3esto4LcQ5F9h8lUNxdl/TLbyye48tO1DrCAVHVcWq FF+6WnAd9BAaEThPVpGL0nxB9G2HQJT5O6M4mZdV0CKebCWt3EmbuiOSp0WTiHO1YWiG KNqw== X-Gm-Message-State: AFq9FYKfkcBnj0ipgyZ12YIPeYLlxsxNhvuPRLYpM2oW1DqL8N4pRD1S X5p5OQFTGkGTCF3YzcdHaTw56ipVA6YLbGMuDJn0qd7Y7jQLZYSGvZes5l3FPbXG64NwQ5eu3aV Q1PIcCHiMFy+ls95qRAN50DYE8UTkA0UEWU4g6N+f903sKP2xIugoGyrkOu0Tqc13yU8SA1D5NP ba59Fl1b0EAsp8WA6mUO9KsAPDifvg X-Gm-Gg: AYBFou1kqaMRwIrFzEeF5WGH6RWmMQwhW2c5h9hompm8sWIT3Q350a4FbPYVpkIW366 JASTuR9kbDMomJuua2SrSamNSWqU7pwVw1RlsybCzd7j5edZ3iXYLvYTQfhCzN5eNHDY/M9QHpF vRqyHHfefA3uoOLCxEEd+SUthuv2ORFN2hAEPcXeldqGgSVwR7jbQUh+U6HE9B+SHCgy6gzvTjS 4KYI8RZ9RhFGWJN1CLNSrBTetZYfkaRvtK2HnHLANrR2D1e/NQatcAnomE= X-Received: by 2002:a05:690c:10:b0:8b0:a28d:6444 with SMTP id 00721157ae682-8b133f55413mr7050897b3.20.1792579324665; Wed, 21 Oct 2026 03:42:04 -0700 (PDT) X-Received: by 2002:a05:690c:10:b0:8b0:a28d:6444 with SMTP id 00721157ae682-8b133f55413mr7050847b3.20.1792579324205; Wed, 21 Oct 2026 03:42:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eugenio Perez Martin Date: Wed, 21 Oct 2026 12:41:26 +0200 X-Gm-Features: AclHuK-gEHntVg57l8dcGhYx9_UQv_Nl9fsfeXSnNnk7fUy7Tatjj4S4EKCnhc4 Message-ID: Subject: Re: [PATCH v2 0/7] Add vhost-net kernel support to pasta To: Ammar Yasser X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: uIkqeqyehSDlDbbkt3A22sE42WUplZBCHrGTl1Z8d6Y_1792579325 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AJNHVHZP4X3ZQL6S7N7P4CI7C25MGEEL X-Message-ID-Hash: AJNHVHZP4X3ZQL6S7N7P4CI7C25MGEEL X-MailFrom: eperezma@redhat.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: passt-dev@passt.top 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: On Fri, Oct 16, 2026 at 10:33=E2=80=AFPM Ammar Yasser wrote: > > This work is based on the original v2 RFC by Eugenio Perez: > > Link: > https://archives.passt.top/passt-dev/20250709174748.3514693-1-eperezma@re= dhat.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_memor= y > 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_ND= ESCS > 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) >