From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B39EC4360F for ; Wed, 3 Apr 2019 12:37:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C2BE2084C for ; Wed, 3 Apr 2019 12:37:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eY/Y3HZa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726536AbfDCMg7 (ORCPT ); Wed, 3 Apr 2019 08:36:59 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42351 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbfDCMg6 (ORCPT ); Wed, 3 Apr 2019 08:36:58 -0400 Received: by mail-wr1-f68.google.com with SMTP id g3so21106228wrx.9 for ; Wed, 03 Apr 2019 05:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DvoQABcOsrfQD5fAnQwwPPhzZhMX4ixfarRL9/prB9Q=; b=eY/Y3HZaWmyyc1DyAYQBCujPf8zL36PvceJPFwF9XEAi11qYRVhp87lsG48UnnAZv0 54c+zlLXHzHhKdXUp3aUYsHEGhI9CL4sNsroc+Mzt6nP21Sl4hmGULSR6l+2uqVORmWU pLi7PhuGst/ExgzMeF2RmL9i87eYMrk++5+OEITSL3E4k+yNYPrbkHuUgmcaBBMctuxT VMoDL4/YD0l4B0PV/cQyJkltWUQ/C7g2ztd5/xQ4RB0SkY+NTi0iWeyWGGLAM0++WbWh xWrE3nDYkwfZW3T5XgMGAbER9QcYA9dxZHSNo1QuF1o4RZruXWmlqL5aMr9kY2bWkqS1 x6jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DvoQABcOsrfQD5fAnQwwPPhzZhMX4ixfarRL9/prB9Q=; b=aPjBF0UTQtKahTuhaSvOV8bjtuZC5Q9+D5TaPn5R4NdRUZcUcmvmIYhE7RTE4xhA8P gWZLVEIJwsamUnrV1Dq8TbxshwI2Lp+blbeayhYV1AlkawPL9OipQeCWUQZCR+j8S2Sq DTNK4yZ6sE7B5vJmYb4AEs5XDebZ/VoJ/fXHzYLXjO87TXDqZGdXlHUdZls0YKN/gUaQ ebJr9fBVpTdvSiq96cmIr5B3JVbbJE+xmzDj2SSo/IAl4D2WowdaOkPiyed0CPvySuZp ByY+kBi9DhSTowlSRZxAP5xRq3PE6Db04E2UvrfuBa3ct8IoquIbOJSgrt/VBYnXaV+O +www== X-Gm-Message-State: APjAAAWVtnR9wj9S/WJv2AJJTssRX2+XzhlRQggQDuPZptIG8/IfUX9a jbVSmgvNT+dNcNnXLxWZRKs= X-Google-Smtp-Source: APXvYqyFSn0NWX0kGJ1tX5jo9GgdWFRx4wSUGMiSeT7ZVoCGiWejXtyq20xpIWGpWWzgonfXcv0zkg== X-Received: by 2002:a5d:4f8b:: with SMTP id d11mr47741718wru.150.1554295015822; Wed, 03 Apr 2019 05:36:55 -0700 (PDT) Received: from localhost ([51.15.41.238]) by smtp.gmail.com with ESMTPSA id v6sm19775818wrt.56.2019.04.03.05.36.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 05:36:54 -0700 (PDT) Date: Wed, 3 Apr 2019 13:36:54 +0100 From: Stefan Hajnoczi To: Stefano Garzarella Cc: Alex =?iso-8859-1?Q?Benn=E9e?= , netdev@vger.kernel.org, qemu devel list , Stefan Hajnoczi Subject: Re: [Qemu-devel] VSOCK benchmark and optimizations Message-ID: <20190403123654.GF32425@stefanha-x1.localdomain> References: <20190401163240.xw24ezsloy5ds2hz@steredhat> <87zhp9599u.fsf@zen.linaroharston> <20190402073706.7t5w5gyj5tf7quwk@steredhat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i3lJ51RuaGWuFYNw" Content-Disposition: inline In-Reply-To: <20190402073706.7t5w5gyj5tf7quwk@steredhat> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org --i3lJ51RuaGWuFYNw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 02, 2019 at 09:37:06AM +0200, Stefano Garzarella wrote: > On Tue, Apr 02, 2019 at 04:19:25AM +0000, Alex Benn=E9e wrote: > >=20 > > Stefano Garzarella writes: > >=20 > > > Hi Alex, > > > I'm sending you some benchmarks and information about VSOCK CCing qem= u-devel > > > and linux-netdev (maybe this info could be useful for others :)) > > > > > > One of the VSOCK advantages is the simple configuration: you don't ne= ed to set > > > up IP addresses for guest/host, and it can be used with the standard = POSIX > > > socket API. [1] > > > > > > I'm currently working on it, so the "optimized" values are still work= in > > > progress and I'll send the patches upstream (Linux) as soon as possib= le. > > > (I hope in 1 or 2 weeks) > > > > > > Optimizations: > > > + reducing the number of credit update packets > > > - RX side sent, on every packet received, an empty packet only to i= nform the > > > TX side about the space in the RX buffer. > > > + increase RX buffers size to 64 KB (from 4 KB) > > > + merge packets to fill RX buffers > > > > > > As benchmark tool I used iperf3 [2] modified with VSOCK support: > > > > > > host -> guest [Gbps] guest -> host [Gbps] > > > pkt_size before opt. optimized before opt. optimized > > > 1K 0.5 1.6 1.4 1.4 > > > 2K 1.1 3.1 2.3 2.5 > > > 4K 2.0 5.6 4.2 4.4 > > > 8K 3.2 10.2 7.2 7.5 > > > 16K 6.4 14.2 9.4 11.3 > > > 32K 9.8 18.9 9.2 17.8 > > > 64K 13.8 22.9 8.8 25.0 > > > 128K 17.6 24.5 7.7 25.7 > > > 256K 19.0 24.8 8.1 25.6 > > > 512K 20.8 25.1 8.1 25.4 > > > > > > > > > How to reproduce: > > > > > > host$ modprobe vhost_vsock > > > host$ qemu-system-x86_64 ... -device vhost-vsock-pci,guest-cid=3D3 > > > # Note: Guest CID should be >=3D 3 > > > # (0, 1 are reserved and 2 identify the host) > > > > > > guest$ iperf3 --vsock -s > > > > > > host$ iperf3 --vsock -c 3 -l ${pkt_size} # host -> guest > > > host$ iperf3 --vsock -c 3 -l ${pkt_size} -R # guest -> host > > > > > > > > > If you want, I can do a similar benchmark (with iperf3) using a netwo= rking > > > card (do you have a specific configuration?). > >=20 > > My main interest is how it stacks up against: > >=20 > > --device virtio-net-pci and I guess the vhost equivalent >=20 > I'll do some tests with virtio-net and vhost. >=20 > >=20 > > AIUI one of the motivators was being able to run something like NFS for > > a guest FS over vsock instead of the overhead from UDP and having to > > deal with the additional complication of having a working network setup. > >=20 >=20 > CCing Stefan. >=20 > I know he is working on virtio-fs that maybe suite better with your use c= ases. > He also worked on VSOCK support for NFS, but I think it is not merged ups= tream. Hi Alex, David Gilbert, Vivek Goyal, Miklos Szeredi, and I are working on virtio-fs for host<->guest file sharing. It performs better than virtio-9p and we're currently working on getting it upstream (first the VIRTIO device spec, then Linux and QEMU patches). You can read about it and try it here: https://virtio-fs.gitlab.io/ Stefan --i3lJ51RuaGWuFYNw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcpKjlAAoJEJykq7OBq3PIBLgH+we8Y7SMD5r9vD79slqKba9E bnyNw0vQAi/n619FOeIhl5cEUcxXk7ytqKxnZ2Q1mf8dKScnO0mCSTBPfffmCLw7 Tl5MDbzhwoz3pDWeQiEFFNxCiyiouxi4vEfA51tFwUzzMb5hM4/pl+D0ofTbiNqn PMsecLz13/MTvjWJ6hrLbcswkPaBLohM3qgHNwVBJAbBGDBYRK1VyZiQ4PtXnWpQ su39PDLK6gmTsI5iiIQcvewSpOEiMl7VW2E0iWtdAOwiq8WU9bdCQtgOTV/6Sxmi 5QGbvrmUNte/yGjtm3XWnnVzEbgLTedUwLBpepCJVRZh/yMva7qOMnQX5QZVzdY= =6r78 -----END PGP SIGNATURE----- --i3lJ51RuaGWuFYNw--