From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 7A7795A004E for ; Fri, 21 Jun 2024 16:56:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718981805; 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; bh=O1eav2503fCMevmxtWZV1GgGU0jIJ/o2ZVszl59rxOM=; b=R9sumd+L22P4VMWJiRTN14mnvYgm+LMMHhBMVZY3lWT9fJqyKWL7aROsqvh23fuyKLzeAQ MK9bVrSQ39slpFa3yoOmVCibtxVldKzAJjyqAW0o4EWKVvk94dyFXjwLqqvloT3F/vlxaN 8s3ibGMnrROZ1+YCl8+wiVEz8fQp75I= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-504-xJd74O2iMTSPxqa2ggilTg-1; Fri, 21 Jun 2024 10:56:43 -0400 X-MC-Unique: xJd74O2iMTSPxqa2ggilTg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C4AB9195609E for ; Fri, 21 Jun 2024 14:56:42 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.221]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DA0B43000601; Fri, 21 Jun 2024 14:56:41 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 0/5] Add vhost-user support to passt. (part 3) Date: Fri, 21 Jun 2024 16:56:35 +0200 Message-ID: <20240621145640.1914287-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AI5JHF6VQSWJECXKIORUVX4FLSVOOR2A X-Message-ID-Hash: AI5JHF6VQSWJECXKIORUVX4FLSVOOR2A X-MailFrom: lvivier@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: Laurent Vivier 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 series of patches adds vhost-user support to passt=0D and then allows passt to connect to QEMU network backend using=0D virtqueue rather than a socket.=0D =0D With QEMU, rather than using to connect:=0D =0D -netdev stream,id=3Ds,server=3Doff,addr.type=3Dunix,addr.path=3D/tmp/pass= t_1.socket=0D =0D we will use:=0D =0D -chardev socket,id=3Dchr0,path=3D/tmp/passt_1.socket=0D -netdev vhost-user,id=3Dnetdev0,chardev=3Dchr0=0D -device virtio-net,netdev=3Dnetdev0=0D -object memory-backend-memfd,id=3Dmemfd0,share=3Don,size=3D$RAMSIZE=0D -numa node,memdev=3Dmemfd0=0D =0D The memory backend is needed to share data between passt and QEMU.=0D =0D Performance comparison between "-netdev stream" and "-netdev vhost-user":= =0D =0D $ iperf3 -c localhost -p 10001 -t 60 -6 -u -b 50G=0D =0D socket:=0D [ 5] 0.00-60.05 sec 95.6 GBytes 13.7 Gbits/sec 0.017 ms 6998988/101= 32413 (69%) receiver=0D vhost-user:=0D [ 5] 0.00-60.04 sec 237 GBytes 33.9 Gbits/sec 0.006 ms 53673/78137= 70 (0.69%) receiver=0D =0D $ iperf3 -c localhost -p 10001 -t 60 -4 -u -b 50G=0D =0D socket:=0D [ 5] 0.00-60.05 sec 98.9 GBytes 14.1 Gbits/sec 0.018 ms 6260735/950= 1832 (66%) receiver=0D vhost-user:=0D [ 5] 0.00-60.05 sec 235 GBytes 33.7 Gbits/sec 0.008 ms 37581/77526= 99 (0.48%) receiver=0D =0D $ iperf3 -c localhost -p 10001 -t 60 -6=0D =0D socket:=0D [ 5] 0.00-60.00 sec 17.3 GBytes 2.48 Gbits/sec 0 sende= r=0D [ 5] 0.00-60.06 sec 17.3 GBytes 2.48 Gbits/sec recei= ver=0D vhost-user:=0D [ 5] 0.00-60.00 sec 191 GBytes 27.4 Gbits/sec 0 sende= r=0D [ 5] 0.00-60.05 sec 191 GBytes 27.3 Gbits/sec recei= ver=0D =0D $ iperf3 -c localhost -p 10001 -t 60 -4=0D =0D socket:=0D [ 5] 0.00-60.00 sec 15.6 GBytes 2.24 Gbits/sec 0 sende= r=0D [ 5] 0.00-60.06 sec 15.6 GBytes 2.24 Gbits/sec recei= ver=0D vhost-user:=0D [ 5] 0.00-60.00 sec 189 GBytes 27.1 Gbits/sec 0 sende= r=0D [ 5] 0.00-60.04 sec 189 GBytes 27.0 Gbits/sec recei= ver=0D =0D Laurent Vivier (5):=0D packet: replace struct desc by struct iovec=0D vhost-user: introduce virtio API=0D vhost-user: introduce vhost-user API=0D iov: add iov_count()=0D vhost-user: add vhost-user=0D =0D Makefile | 4 +-=0D checksum.c | 1 -=0D conf.c | 18 +-=0D iov.c | 35 +-=0D iov.h | 2 +=0D packet.c | 81 ++--=0D packet.h | 16 +-=0D passt.c | 14 +-=0D passt.h | 10 +=0D pcap.c | 1 -=0D tap.c | 106 ++++-=0D tap.h | 5 +-=0D tcp.c | 17 +-=0D tcp_vu.c | 547 ++++++++++++++++++++++++=0D tcp_vu.h | 9 +=0D udp.c | 54 ++-=0D udp_internal.h | 39 ++=0D udp_vu.c | 237 +++++++++++=0D udp_vu.h | 8 +=0D util.h | 11 +=0D vhost_user.c | 1077 ++++++++++++++++++++++++++++++++++++++++++++++++=0D vhost_user.h | 137 ++++++=0D virtio.c | 442 ++++++++++++++++++++=0D virtio.h | 122 ++++++=0D 24 files changed, 2886 insertions(+), 107 deletions(-)=0D create mode 100644 tcp_vu.c=0D create mode 100644 tcp_vu.h=0D create mode 100644 udp_internal.h=0D create mode 100644 udp_vu.c=0D create mode 100644 udp_vu.h=0D create mode 100644 vhost_user.c=0D create mode 100644 vhost_user.h=0D create mode 100644 virtio.c=0D create mode 100644 virtio.h=0D =0D --=20=0D 2.45.2=0D =0D