From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dJv1ZaeO; dkim-atps=neutral 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 6CD425A0282 for ; Thu, 10 Jul 2025 11:47:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752140822; 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=Uct9ZTGFRk+vBPYmv2HYH7jlN88H/1zz/SOxRmNeOm4=; b=dJv1ZaeOIo7EUj+N3hijX3muUkevOmBwO5wytW6hcpj8v6LijTSEEGDOB/ei5SlnWJT+Hn /8cEwH3B+xl0pTaBkFNykyiZyg3UUgx8m9WI+DWMrSMx1JI0sifAoIPrLtW91fsopkeHhe Dg+hUBGJGmBfTFH45xB8yFNFQBBD/U4= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-124-ShUE0UZNNG6ZgrCkVIWu-w-1; Thu, 10 Jul 2025 05:47:01 -0400 X-MC-Unique: ShUE0UZNNG6ZgrCkVIWu-w-1 X-Mimecast-MFC-AGG-ID: ShUE0UZNNG6ZgrCkVIWu-w_1752140820 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3122368d82bso1418652a91.0 for ; Thu, 10 Jul 2025 02:47:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752140819; x=1752745619; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uct9ZTGFRk+vBPYmv2HYH7jlN88H/1zz/SOxRmNeOm4=; b=U2UMiYVzjD82pUxe5mfrwG4NeBL5E8QNkFaf0hB/RA+0HV8tk23w70idbuN3rZsIkI A5wyiFe/il6GG1XVMiJNA4oclRAboEkG0zNMoqUyHyHf9g50cr17WcwtwUGy7Pd38L0O QSjRfP23vaEo6BReeVV8C6AbNoyJKgwYw2QnrQDo9s2BZH2PJkvNrh4BEmTuuAYE+FAV Br4fnJUJpM090/ZygRxLu7X17/BG9gLEm1x29DZxKxRV9exZset6xLi8d2OcxKAWEUv0 UNHJ0H0LN0fXtJp9WdPCaBEE4xzlxy6vTyIk/3TUS3eocQhu4jUQaL49rQlF6sNg5/pX EW5A== X-Gm-Message-State: AOJu0YyybC/6rOiz1Ipzh66vtJVjQcEY90y89zDghyda2AXcektG1fjq 5NAv+jQUmVUYFqEGISI/RD2P0K5FgMdVjfBPKjN0S2KXFuHINxufyt2WrW8/jYHG0/bLGaJQ3vX GF0pMzA702k3c014M0377Wy06DxpcbGBSEBUgcPKBaMSyhtcrUJVLRbBbu0w02YDAG7E2j8XTlf ygJo6bOs3CasNPV6lcVszi1ofN69qzijvdOqrHbFg= X-Gm-Gg: ASbGnctA0GoLC59rJI3YBfLcjWS38GLBGj9eZA+ioWFDYc4SL5AFJo1CdXvXuLb7qHg e9bJ7V3fB1d2zNjfS+FGubSY5xp+i7TnB09vsEH6JJ+2YYotHlFFjcvK3/vPh1Fvw72PcZRhtLr K8Qw== X-Received: by 2002:a17:90b:4d0e:b0:311:f05b:869a with SMTP id 98e67ed59e1d1-31c3ef617c5mr3631165a91.8.1752140819480; Thu, 10 Jul 2025 02:46:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFdNrXMK75/k2ay8pNtcOUowNSmmZelUYZBSwwrz1Yiu6I7lwXpWqoc3puz4Qd5hvRg7B68cvvd/q5qQ9Lfjc= X-Received: by 2002:a17:90b:4d0e:b0:311:f05b:869a with SMTP id 98e67ed59e1d1-31c3ef617c5mr3631133a91.8.1752140819037; Thu, 10 Jul 2025 02:46:59 -0700 (PDT) MIME-Version: 1.0 References: <20250709174748.3514693-1-eperezma@redhat.com> In-Reply-To: <20250709174748.3514693-1-eperezma@redhat.com> From: Eugenio Perez Martin Date: Thu, 10 Jul 2025 11:46:21 +0200 X-Gm-Features: Ac12FXwCvcuclm7cAhfztum7V_WUkg6Iwc1e7XaiJkoG9scC1iEwLAY6vgMPr9o Message-ID: Subject: Re: [RFC v2 00/11] Add vhost-net kernel support To: passt-dev@passt.top X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1Og28E41aJHjA_6letdhnqhFuQPKW_xGuS_7vFMQK1M_1752140820 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MQLDTGXQ5TJ52TNJZACLE7NGANWIOJS7 X-Message-ID-Hash: MQLDTGXQ5TJ52TNJZACLE7NGANWIOJS7 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: jasowang@redhat.com 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 Wed, Jul 9, 2025 at 7:48=E2=80=AFPM Eugenio P=C3=A9rez wrote: > > vhost-net is a kernel device that allows to read packets from a tap > device using virtio queues instead of regular read(2) and write(2). > This enables a more eficient packet processing, as the memory can > be written directly by the kernel to the userspace and back, instead > of wasting bandwith on copies, and it enables to batch many packets > in a single notification (through eventfds) both tx and rx. > > Namespace tx performance improves from ~26.3Gbit/s to ~36.9Gbit/s. > > Namespace rx performance improves from ~16BGbit/s to ~17.26Gbit/s. > For reference, iperf without namespaces and veth both reaches ~47.8Gbit/s in both directions. > RFC: At this moment only these are supported: > * Receive l2 packets from the vhost kernel to pasta > * Send l4 tcp socket received data through vhost-kernel to namespace. > > TODO: Add vhost zerocopy in the tests, and compare with veth. > TODO: Implement at least UDP tx. Or maybe we want UDP to be write(2) bec= ause > of latency? > TODO: Check style for variable declarations in for loops and use of curly > brackets as long as they wrap more than a line. > TODO: kerneldoc style function header comments > > -- > v2: Add TCP tx, and integrated some comments from the previous series. Pl= ease > check each patch message for details. > > Eugenio P=C3=A9rez (11): > tap: implement vhost_call_cb > tap: add die() on vhost error > Replace tx tap hdr with virtio_nethdr_mrg_rxbuf > tcp: export memory regions to vhost > virtio: Fill .next in tx queue > tap: move static iov_sock to tcp_buf_data_from_sock > tap: support tx through vhost > tap: add tap_free_old_xmit > tcp: start conversion to circular buffer > Add poll(2) to used_idx > tcp_buf: adding TCP tx circular buffer > > arp.c | 2 +- > epoll_type.h | 4 + > passt.c | 12 +- > passt.h | 11 +- > tap.c | 489 +++++++++++++++++++++++++++++++++++++++++++++++++-- > tap.h | 13 +- > tcp.c | 2 +- > tcp_buf.c | 179 +++++++++++++++---- > tcp_buf.h | 19 ++ > udp.c | 2 +- > 10 files changed, 675 insertions(+), 58 deletions(-) > > -- > 2.50.0 >