Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp943114ybi; Fri, 2 Aug 2019 06:53:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzs1Q9v/OB5NQMNkDcJk+bdG+DQHVsYZ29E6VWH0Vx3hlckCxE1zLXGoPTFtoUhmTSma1Fm X-Received: by 2002:a65:60d3:: with SMTP id r19mr99579109pgv.91.1564753982881; Fri, 02 Aug 2019 06:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564753982; cv=none; d=google.com; s=arc-20160816; b=f4CfnVZoIxhtBV+r1yzTStMjo3lum+UT0rAE53HSN8GRQE/5JlMNNUehNDKj7wk4/g 3F2OBjPJ8fSm1wQBVETyuiWF5Uenhj0h28Rr16UmFznOMAne0GeWcWy5iEIxXtjLoyO8 4EBogKYtaAFP3U3GHaT+OliUjkr4ISBHD4wDgKTHUUN/DVzty5ARtCJCI8ZzWtfrt9zu 79/aXRVqIxnoy8VjaWrAcUBeE6OkLpuEkHtiAuQXDp2jOQ8cSWi8A0gQm4Bz/3ONDdKq beiRkuJtKfpxEkYB5wW26EnHcBQ7v5iQAax1klUFKbq85nn70mJjPKNZEJzd8QFKY5iz laBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=+VheU4fXBKJ7f6AGSTFH1gY5Af90v9UL4C0cGsvHyUY=; b=uuA+FqpM6W56ar+iUznjImazEGmPQOXqhtDHq9rvyPprx7OzlqGlc3qEr7SWLFjNFr of61zp+ICwbWJNfOvt155BLZuk5lEsCyIJF/UQoclCM631dBCMeIU8BO1yXbYOa8pT6G cffp4l6qmftj7jf36OvdmmrIdPI9SXRqT1xDk5kBuFXs6IGkCJgGUahJU+OgzvAgoedB upo/45RgwzDrHDlKP6f8hi7skTlK5SGHwby8W9hFsEST9VVHheFheo38eCJNiIiNq02U LfusnbA1NbQS70rzfb4Xjx5P1+U36Mr+Z7IWh73Y1ZpmCDJDmNxuy6kq5XT7T3sKUf/6 sw6Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 g17si33512740plo.406.2019.08.02.06.52.47; Fri, 02 Aug 2019 06:53:02 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730391AbfHBLBO (ORCPT + 99 others); Fri, 2 Aug 2019 07:01:14 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41837 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729751AbfHBLBN (ORCPT ); Fri, 2 Aug 2019 07:01:13 -0400 Received: by mail-wr1-f67.google.com with SMTP id c2so73496196wrm.8 for ; Fri, 02 Aug 2019 04:01:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=+VheU4fXBKJ7f6AGSTFH1gY5Af90v9UL4C0cGsvHyUY=; b=KY6cuaDO7+ukRZWeglxdCFIE2FdswXJWE50BrpPhqJvz0CtVg+x7jeuDViqEnrKCxD nnOPodXYuH5MmvBSkt2bXLu7dM6MbztIc1Lz+rk+4OTqz999tJQGm6nWxicfjBP5ccL+ xftL+MZUQJ6fSntf9/vo2AKf7/YTNNOGOhR8u1JunnbIGs4xKRZi6nzM8Rz1zYbJld3c Dj7R1YZtjEVLz29ec0nRX8T3tx64Et431lpa7XS4efsKOTFzaSYhycbMC41jjxlGBKso kXRgADCoZrCyLKvw/3rWnDswFHdDXGDsVUVNBmuiuUmMYgE/HNuytNlXo0RRQrpe91Y0 Hdqw== X-Gm-Message-State: APjAAAVnBEA0bbJ7QZ8kd5xYDFQuJqGPCCcCq0pU8C4Lb5C3iaspXMN6 0LPX1TvEya09Q0WsGBHADL5JDOAl45I= X-Received: by 2002:adf:f812:: with SMTP id s18mr9787719wrp.32.1564743671061; Fri, 02 Aug 2019 04:01:11 -0700 (PDT) Received: from dritchie.redhat.com (18.red-83-35-20.dynamicip.rima-tde.net. [83.35.20.18]) by smtp.gmail.com with ESMTPSA id x6sm79220965wrt.63.2019.08.02.04.01.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 04:01:10 -0700 (PDT) References: <20190719133135.32418-1-lifei.shirley@bytedance.com> <20190719110852-mutt-send-email-mst@kernel.org> <20190722043707-mutt-send-email-mst@kernel.org> <20190730162337-mutt-send-email-mst@kernel.org> User-agent: mu4e 1.2.0; emacs 26.2 From: Sergio Lopez To: =?utf-8?B?5p2O6I+y?= Cc: "Michael S. Tsirkin" , virtio-dev@lists.oasis-open.org, linux-kernel@vger.kernel.org, Jason Wang , Pawel Moll , Suzuki K Poulose , Fam Zheng , Xiongchun Duan Subject: Re: [External Email] Re: [PATCH v1 0/2] virtio-mmio: support multiple interrupt vectors In-reply-to: Date: Fri, 02 Aug 2019 13:01:00 +0200 Message-ID: <87tvaz25n7.fsf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E6=9D=8E=E8=8F=B2 writes: > On Wed, Jul 31, 2019 at 4:26 AM Michael S. Tsirkin wrote: >> >> On Mon, Jul 22, 2019 at 09:43:18PM +0800, =E6=9D=8E=E8=8F=B2 wrote: >> > On Mon, Jul 22, 2019 at 4:39 PM Michael S. Tsirkin wr= ote: >> > > >> > > On Mon, Jul 22, 2019 at 11:22:02AM +0800, =E6=9D=8E=E8=8F=B2 wrote: >> > > > On Fri, Jul 19, 2019 at 11:14 PM Michael S. Tsirkin wrote: >> > > > > >> > > > > On Fri, Jul 19, 2019 at 09:31:33PM +0800, Fei Li wrote: >> > > > > > Hi, >> > > > > > >> > > > > > This patch series implements multiple interrupt vectors suppor= t for >> > > > > > virtio-mmio device. This is especially useful for multiqueue v= host-net >> > > > > > device when using firecracker micro-vms as the guest. >> > > > > > >> > > > > > Test result: >> > > > > > With 8 vcpus & 8 net queues set, one vhost-net device with 8 i= rqs can >> > > > > > receive 9 times more pps comparing with only one irq: >> > > > > > - 564830.38 rxpck/s for 8 irqs on >> > > > > > - 67665.06 rxpck/s for 1 irq on >> > > > > > >> > > > > > Please help to review, thanks! >> > > > > > >> > > > > > Have a nice day >> > > > > > Fei >> > > > > >> > > > > >> > > > > Interesting. The spec says though: >> > > > > >> > > > > 4.2.3.4 >> > > > > Notifications From The Device >> > > > > The memory mapped virtio device is using a single, dedic= ated interrupt signal, which is asserted when at >> > > > > least one of the bits described in the description of In= terruptStatus is set. This is how the device sends a >> > > > > used buffer notification or a configuration change notif= ication to the device. >> > > > > >> > > > Yes, the spec needs to be updated if we want to use mult-irqs. >> > > > > >> > > > > So I'm guessing we need to change the host/guest interface? >> > > > Just to confirm, does the "the host/guest interface" you mentioned= mean how to >> > > > pass the irq information from the user space tool to guest kernel? >> > > > In this patch, we do this by passing the [irq_start, irq_end] >> > > > interface via setting guest >> > > > kernel command line, that is done in vm_cmdline_set(). >> > > > Also there is another way to do this: add two new registers descri= bing irq info >> > > > (irq_start & irq_end OR irq_start & irq_numbers) to the virtio con= fig space. >> > > > >> > > > Which one do you prefer? >> > > >> > > I'm not sure - so far irq was passed on the command line, right? >> > Yes. >> > > >> > > The first step in implementing any spec change would be to update qe= mu >> > > code to virtio 1. Which is not a huge project but so far no one >> > > bothered. >> > Emm, actually I only did the test with using firecracker to start a >> > micro-vm, but without qemu. >> > To be honest, the reason why implementing multi-irq on virtio-mmio is >> > mainly because the >> > current firecracker using virtio-mmio device and it has no pci thing, >> > thus no msi/msix to >> > handle the interruptions. >> > On the other hand, considering pci is well supported in qemu, I am >> > wondering whether we >> > still need this. If needed, we would like to do this. :) >> > >> > Have a nice day, thanks >> > Fei >> >> >> Sergio Lopez is now working on updating mmio to v1 support in qemu. >> Maybe get in touch with him on how he looks at this extension. > Thanks for the info! :) > > Hi Sergio Lopez, > I saw your [virtio-mmio: modern (v2)] patch series in Qemu mailing > list, thanks for moving this on. > And long Story Short, these two kernel patches is to add the multi-irq > support for virtio-mmio driver. > As this involves the spec change and you are now implementing > virtio-mmio v2, could you help to > give some suggestions on this extension? > I will cc you the original patch soon, thanks. I like having the possibility of using multiple irq lines for a single virtio-mmio, but I think having to specify an irq range for each device is a bit inconvenient. Usually, you want an irq line per each virtqueue. So, ideally, irq assignment should be somehow linked to the virtqueue initialization. But this isn't PCI, so the Guest can't simply request some MSI/MSI-X vectors and tell the device about them, as virtio-pci does. I think an option could be extending the specification with a new QueueVector read-only register, which would return either the irq line to be used for the virtqueue selected by QueueSel, or a value indicating there isn't a dedicated line for this particular virtqueue. This way, hypervisors could lazily allocate irq lines on demand when the QueueVector is read for the first time (or after a reset), and users (and fdt's) would still only need to specify a single interrupt for each virtio-mmio definition. >> Not asking you to work on qemu, but it makes sense >> to get an ack for guest bits from another popular hypervisor. > I agree, absolutely right. And I once work on Qemu development, hope > the combined > background could help to move this multi-irq feature forward. :) > > > Have a nice day, many thanks > Fei >> >> >> > > >> > > >> > > > > If true pls cc virtio-dev. >> > > > Sure. >> > > > > >> > > > > Also, do we need to update dt bindings documentation? >> > > > You mean the following doc? Sure. :) >> > > > https://github.com/torvalds/linux/blob/master/Documentation/device= tree/bindings/virtio/mmio.txt >> > > > >> > > > Thanks for the review! >> > > > >> > > > Have a nice day >> > > > Fei >> > > > >> > > > >> > > > > >> > > > > > >> > > > > > Fam Zheng (1): >> > > > > > virtio-mmio: Process vrings more proactively >> > > > > > >> > > > > > Fei Li (1): >> > > > > > virtio-mmio: support multiple interrupt vectors >> > > > > > >> > > > > > drivers/virtio/virtio_mmio.c | 238 ++++++++++++++++++++++++++= +++++++++-------- >> > > > > > 1 file changed, 196 insertions(+), 42 deletions(-) >> > > > > > >> > > > > > -- >> > > > > > 2.11.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEvtX891EthoCRQuii9GknjS8MAjUFAl1EF+wACgkQ9GknjS8M AjVGYw/8C7rP00l7sGK7IiCnxYa2WyKvoGxJmZ3TRPU4cKzwsIvYRwkRuKkbSVu1 Dp+VyQ3CANXLVGRlmfy7BwC4S79He3Ib3SL/+Ia8fQHa8XcjpyMgd4U/f9KIPvb9 gZjcBEbwQCPUvNciaoWj3IqD0c+IG15OTpf9WfL+zMFUGyoZRvTkUyxnI9tlMHW9 ErevPUxs3UvMNlEMg2FqCDtsKpxeM1navNH/WRzJ/J3+lazyaiNrU3g78V4ON5xl HyoU+1Tkwka2INBCC8sU8ejsmn+XFB13ZaM88/O52bzqj9OtA6AyBp9zGmdFI9iX 85JDsUG6SaR+tjN4tGXl2ssrt20Cs10M3YsgBCvuoPIFh4cRvf+ea44VCmXeJ8Aq IG8hamTjJKjjtMx/YgwpsOM7+mg95P79EI1E7KPQ3agedZ4nIDXCqHrxuApkmRE7 lQWRJo7BnWvtahcWK0NMu1x3oOvBiS2EAuXOHWFYMLM6STyIJK11Zje1ozdXp6Vg VMxeUWu6H+ffBnUoM13vVSHmY4vogsVM0a/lxAjBc02n84yp7Bh3vY4B/JR8ePWP SYdDsjXmXaA3ut8IrQynhYACPc1QDtLUEKAkIzuJPx88iOXzDm/iqbbYz3i5QZjF AZXnUrT5fReqDoAPFQkBxaQyWGlzVpw7yK0E5qBd0Sq9cEVfYV8= =2R22 -----END PGP SIGNATURE----- --=-=-=--