Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9521076ybl; Thu, 26 Dec 2019 00:16:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwy9pxLyvAYyf2IiJrWDWl2ljQjxFUMZ4pQZro2u8P9+mJdTC3cJ7qsP947kvioQ3xrfmt6 X-Received: by 2002:a05:6830:1f89:: with SMTP id v9mr46817521otr.90.1577348178172; Thu, 26 Dec 2019 00:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577348178; cv=none; d=google.com; s=arc-20160816; b=qJd+zyVC1Q90ZnJB7LvrvXQvJbe2UFaoiaYZvdz0hpi23wQmMKQx03riMX6ept7LvV 5o++C7WOSokvQnfiU4dESF3gXPPGegy+vgAnquFCAK283h5Zd3xaUyQVo8ZJYmC+QXQp KaLaxc6545gKOmTBvyuZbShWPD8tQkteNakhiVgZGh4G1/DYkS+k5ZAC0gyDEhAyJ5YZ MBypxz3FtcelJyeEauEx8/DAZmNe0D6v6duzeJAR0jEKDvEC4PlfB+EZGdp0++vib/G5 MykIdhCGhlbp3feA2Lgblr8apzHxokEuNK8UxizU+MY9hXm5YAYnVwIOBPWC5bIzRTNb 5JGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=K3FgUA2rvbhgaHkjwQebM6fRpmsQ8B0o7y2GZRAVFEU=; b=gbkBdcGqFRO9vtfIGexVPYn2jij1ox8365vP9LVBwd+o3DykkjixIEWnqvAxfEzykW 1CxeNC674aq4DLoLI0epTW7aDfdnaSbtQ1HoSwWNCUYxQcF3vbyuktPo1qXfKtSG5QhT 9sPBEDBq4mBVtao6tBP2bZnps8AE/L4o9/0dFWloil7IYEDKRFsEC16mnOvZfuiiDuA3 l3m/13WWcTWXymh7m8BzPTkeO37+2u328uDL4ZzulPHWZ4OAZbc/yTEez5dhAKzImoDr qhko71WybO7as5vmeVz+w2bXTVl9lWakQX8fPRZWUGWKiRYg3XGHbmJ0VYoofqcDWXP9 kCbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="a0jv/YoK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si14998943oto.205.2019.12.26.00.15.39; Thu, 26 Dec 2019 00:16:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="a0jv/YoK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726134AbfLZIJ5 (ORCPT + 99 others); Thu, 26 Dec 2019 03:09:57 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:55703 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725815AbfLZIJ5 (ORCPT ); Thu, 26 Dec 2019 03:09:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577347795; 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=K3FgUA2rvbhgaHkjwQebM6fRpmsQ8B0o7y2GZRAVFEU=; b=a0jv/YoKkMWCM9B3AceN1aUrVsqLVdZAkppTP42wJPyCF/t/z88SedawLPFISf0M5giSGz J0G+L6Oy+7NApFy5HUQHDlW5nh4IJLkAZrLKsH79XKM2XUUkmm6bnBpL1E/goE93x0ndOO gPBBGYL7b5d1oYpLonuywtoD6+sUt2E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187--Ami_yBEPsSjw0kw8pcVtg-1; Thu, 26 Dec 2019 03:09:51 -0500 X-MC-Unique: -Ami_yBEPsSjw0kw8pcVtg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EFBAB189CD08; Thu, 26 Dec 2019 08:09:49 +0000 (UTC) Received: from [10.72.12.162] (ovpn-12-162.pek2.redhat.com [10.72.12.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id 196606049D; Thu, 26 Dec 2019 08:09:33 +0000 (UTC) Subject: Re: [PATCH v1 2/2] virtio-mmio: add features for virtio-mmio specification version 3 To: "Liu, Jiang" Cc: Zha Bin , linux-kernel@vger.kernel.org, mst@redhat.com, slp@redhat.com, virtio-dev@lists.oasis-open.org, jing2.liu@intel.com, chao.p.peng@intel.com References: <229e689d-10f1-2bfb-c393-14dfa9c78971@redhat.com> <0460F92A-3DF6-4F7A-903B-6434555577CC@linux.alibaba.com> From: Jason Wang Message-ID: Date: Thu, 26 Dec 2019 16:09:24 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <0460F92A-3DF6-4F7A-903B-6434555577CC@linux.alibaba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/12/25 =E4=B8=8B=E5=8D=8811:20, Liu, Jiang wrote: > >> On Dec 25, 2019, at 6:20 PM, Jason Wang wrote: >> >> >> On 2019/12/25 =E4=B8=8A=E5=8D=8810:50, Zha Bin wrote: >>> From: Liu Jiang >>> >>> Userspace VMMs (e.g. Qemu microvm, Firecracker) take advantage of usi= ng >>> virtio over mmio devices as a lightweight machine model for modern >>> cloud. The standard virtio over MMIO transport layer only supports on= e >>> legacy interrupt, which is much heavier than virtio over PCI transpor= t >>> layer using MSI. Legacy interrupt has long work path and causes speci= fic >>> VMExits in following cases, which would considerably slow down the >>> performance: >>> >>> 1) read interrupt status register >>> 2) update interrupt status register >>> 3) write IOAPIC EOI register >>> >>> We proposed to update virtio over MMIO to version 3[1] to add the >>> following new features and enhance the performance. >>> >>> 1) Support Message Signaled Interrupt(MSI), which increases the >>> interrupt performance for virtio multi-queue devices >>> 2) Support per-queue doorbell, so the guest kernel may directly write >>> to the doorbells provided by virtio devices. >>> >>> The following is the network tcp_rr performance testing report, teste= d >>> with virtio-pci device, vanilla virtio-mmio device and patched >>> virtio-mmio device (run test 3 times for each case): >>> >>> netperf -t TCP_RR -H 192.168.1.36 -l 30 -- -r 32,1024 >>> >>> Virtio-PCI Virtio-MMIO Virtio-MMIO(MSI) >>> trans/s 9536 6939 9500 >>> trans/s 9734 7029 9749 >>> trans/s 9894 7095 9318 >>> >>> [1] https://lkml.org/lkml/2019/12/20/113 >> >> Thanks for the patch. Two questions after a quick glance: >> >> 1) In PCI we choose to support MSI-X instead of MSI for having extra f= lexibility like alias, independent data and address (e.g for affinity) . = Any reason for not start from MSI-X? E.g having MSI-X table and PBA (both= of which looks pretty independent). > Hi Jason, > Thanks for reviewing patches on Christmas Day:) > The PCI MSI-x has several advantages over PCI MSI, mainly > 1) support 2048 vectors, much more than 32 vectors supported by MSI. > 2) dedicated address/data for each vector, > 3) per vector mask/pending bits. > The proposed MMIO MSI extension supports both 1) and 2), Aha right, I mis-read the patch. But more questions comes: 1) The association between vq and MSI-X vector is fixed. This means it=20 can't work for a device that have more than 2047 queues. We probably=20 need something similar to virtio-pci to allow a dynamic association. 2) The mask and unmask control is missed > but the extension doesn=E2=80=99t support 3) because > we noticed that the Linux virtio subsystem doesn=E2=80=99t really make = use of interrupt masking/unmasking. Not directly used but masking/unmasking is widely used in irq subsystem=20 which allows lots of optimizations. > > On the other hand, we want to simplify VMM implementations as simple as= possible, and mimicking the PCI MSI-x > will cause some complexity to VMM implementations. I agree to simplify VMM implementation, but it looks to me introducing=20 masking/pending won't cost too much code in the VMM implementation. Just=20 new type of command for VIRTIO_MMIO_MSI_COMMAND. Thanks > >> 2) It's better to split notify_multiplexer out of MSI support to ease = the reviewers (apply to spec patch as well) > Great suggestion, we will try to split the patch. > > Thanks, > Gerry > >> Thanks