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=-8.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED, USER_AGENT_NEOMUTT 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 039AFC43381 for ; Mon, 1 Apr 2019 16:32:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCFAA20883 for ; Mon, 1 Apr 2019 16:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728196AbfDAQcp (ORCPT ); Mon, 1 Apr 2019 12:32:45 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:37777 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726887AbfDAQcp (ORCPT ); Mon, 1 Apr 2019 12:32:45 -0400 Received: by mail-wm1-f66.google.com with SMTP id v14so77218wmf.2 for ; Mon, 01 Apr 2019 09:32:44 -0700 (PDT) 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:mime-version :content-disposition:user-agent; bh=gWid6orUjTTOjSHhoDvv8AEOxNfGb6dFsg15l2Hforc=; b=AabFM87/FKnumk61Aa7gzf4tJd6MBV7rCrTSFK+4UCKA04hiR1zDGksFGaskKU1IGb d3lW5kytDvLxLAVgKQ8t8C3VeSr5fhYwsxn6iNYiz3Gm7f2Ki19h17Qn2kCg5jxuyClL zbexa2X8/fRHH8pk76j5bFszW12NZZ9GIu80NGKN9rPt1noo79N+HfwKWBWH3CRSHbDO iFPfm7agX1bI05puIn69rOBcf6crVR84OeKvaXG+N26+1wT0BUkuYZNEXyph8VOle7xt NJLFDV5ekC/bucqvgc3Ffd7eHdpQ7NOecXUxgTIZlfgb8GU8MpMRdVGxV0Q2LffDhw+J Xm4A== X-Gm-Message-State: APjAAAVxNiJ9ikvVtAeh+/omKAbo39wiP7Yuz1CjxXuWNBqIwEOjRj1+ 3HnFhflx3xu2zbBaY2l9gDrylQ== X-Google-Smtp-Source: APXvYqyuVQ2pvnKO5HndK1kV/PHCk4ZrGfvpCZONYKVOpymDBaej2K02Jo/gOEH3SvSdBO0Yki5CSA== X-Received: by 2002:a7b:cbd6:: with SMTP id n22mr327971wmi.57.1554136363622; Mon, 01 Apr 2019 09:32:43 -0700 (PDT) Received: from steredhat (host40-210-static.34-79-b.business.telecomitalia.it. [79.34.210.40]) by smtp.gmail.com with ESMTPSA id d17sm12012987wrw.88.2019.04.01.09.32.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Apr 2019 09:32:42 -0700 (PDT) Date: Mon, 1 Apr 2019 18:32:40 +0200 From: Stefano Garzarella To: alex.bennee@linaro.org Cc: qemu devel list , netdev@vger.kernel.org Subject: VSOCK benchmark and optimizations Message-ID: <20190401163240.xw24ezsloy5ds2hz@steredhat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20180716 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Alex, I'm sending you some benchmarks and information about VSOCK CCing qemu-devel and linux-netdev (maybe this info could be useful for others :)) One of the VSOCK advantages is the simple configuration: you don't need 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 possible. (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 inform 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=3 # Note: Guest CID should be >= 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 networking card (do you have a specific configuration?). Let me know if you need more details! Thanks, Stefano [1] https://wiki.qemu.org/Features/VirtioVsock [2] https://github.com/stefano-garzarella/iperf/