Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18267460ybl; Thu, 2 Jan 2020 22:17:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxpz3cVjP2IQxH3P7yoSKMFA4f0+VSIJc9OQPsh1nKwrtb4Y4wEZL4xxgLr5qN1pHZGOleY X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr94108604otc.337.1578032254346; Thu, 02 Jan 2020 22:17:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578032254; cv=none; d=google.com; s=arc-20160816; b=euQ3G7OgIbKfp85Vo4Q8caUM6u4m0fW2FInZRVVOMgqsZ5cuG2Nh4Tg2sNIxbh5jf8 ayRGlCbXP40HFFBnwufrFWgOC8bYSZpsyLJO3CZblM5ZapNHv2hNDv0N+hT76DZMyCy/ 9niR3+KN40ca6nXCwmzeq+ZhhO0B/or7Wc5SG1beGrx+7U1p6BZNi94KIihSI7GvX48W 0Kvalm8eynaGH8UaryQZRWnJoEpGFXJaPZAZwp3to3uotBejeQ0TeP4OqszVYAblEAgg UVPWT9BbIDSgxt12oIlzIeJJZOPe1Rh6X0y4SM+3dEhF+mKLxiaGMw+kGnqJqMsntIbT a3VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=QZ/2gN/Gg+NtS4D0hdK5wWYOIHSd4gPo5mqo5El7CX0=; b=ep92yGbLzNKKM8Fn2CQ6FNHKCGOxi/JqoSzBXOI50cWY5oQ3KqEqm0FI6kS/DKgNZs FqNsm/IePrn/z3+rqBqyal4N9PN8IygJYJ4D81GhXBIlEnGT+d6FLfH1ZESiosqfE5aj TaWTbnKNI7qAEz3K9wa7CCvzeKjVOR7i9+L6eOFB3eD3XunrSPkESZd5q7grf87cWla0 zbrf2p8cKtM0g501criYW4A5Q1Lgpwb7r82ueumX4sFuM5a0LzjMamix0e4lus5Syea5 b72WSbtPQxG7EIkyQEuZzoppIXuScyneuvf6QK2XCi5EB6Pn5/lSd1WCQ2k9yFH2Ibn/ JeBg== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si30417700otq.144.2020.01.02.22.17.11; Thu, 02 Jan 2020 22:17:34 -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; 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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726181AbgACGPg convert rfc822-to-8bit (ORCPT + 99 others); Fri, 3 Jan 2020 01:15:36 -0500 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:44094 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgACGPg (ORCPT ); Fri, 3 Jan 2020 01:15:36 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=gerry@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0TmiGTtC_1578032116; Received: from 127.0.0.1(mailfrom:gerry@linux.alibaba.com fp:SMTPD_---0TmiGTtC_1578032116) by smtp.aliyun-inc.com(127.0.0.1); Fri, 03 Jan 2020 14:15:20 +0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [virtio-dev] Re: [PATCH v1 2/2] virtio-mmio: add features for virtio-mmio specification version 3 From: "Liu, Jiang" In-Reply-To: <0c3d33de-3940-7895-2fe2-81de8714139c@redhat.com> Date: Fri, 3 Jan 2020 14:14:20 +0800 Cc: "Liu, Jing2" , 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 Content-Transfer-Encoding: 8BIT Message-Id: <46806720-1D1C-40C3-BEE2-EDB0D4DA39BF@linux.alibaba.com> References: <85eeab19-1f53-6c45-95a2-44c1cfd39184@redhat.com> <28da67db-73ab-f772-fb00-5a471b746fc5@linux.intel.com> <683cac51-853d-c8c8-24c6-b01886978ca4@redhat.com> <42346d41-b758-967a-30b7-95aa0d383beb@linux.intel.com> <0c3d33de-3940-7895-2fe2-81de8714139c@redhat.com> To: Jason Wang X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 3, 2020, at 11:24 AM, Jason Wang wrote: > > > On 2020/1/2 下午5:13, Liu, Jing2 wrote: >> [...] >> >>>>> >>>>>> + >>>>>> +/* RO: MSI feature enabled mask */ >>>>>> +#define VIRTIO_MMIO_MSI_ENABLE_MASK 0x8000 >>>>>> +/* RO: Maximum queue size available */ >>>>>> +#define VIRTIO_MMIO_MSI_STATUS_QMASK 0x07ff >>>>>> +/* Reserved */ >>>>>> +#define VIRTIO_MMIO_MSI_STATUS_RESERVED 0x7800 >>>>>> + >>>>>> +#define VIRTIO_MMIO_MSI_CMD_UPDATE 0x1 >>>>> >>>>> >>>>> I believe we need a command to read the number of vectors supported by the device, or 2048 is assumed to be a fixed size here? >>>> >>>> For not bringing much complexity, we proposed vector per queue and fixed relationship between events and vectors. >>> >>> >>> It's a about the number of MSIs not the mapping between queues to MSIs.And it looks to me it won't bring obvious complexity, just need a register to read the #MSIs. Device implementation may stick to a fixed size. >> >> Based on that assumption, the device supports #MSIs = #queues + #config. Then driver need not read the register. >> >> We're trying to make such kind of agreement on spec level. > > > Ok, I get you now. > > But still, having fixed number of MSIs is less flexible. E.g: > > - for x86, processor can only deal with about 250 interrupt vectors. > - driver may choose to share MSI vectors [1] (which is not merged but we will for sure need it) Thanks for the info:) X86 systems roughly have NCPU * 200 vectors available for device interrupts. The proposed patch tries to map multiple event sources to an interrupt vector, to avoid running out of x86 CPU vectors. Many virtio mmio devices may have several or tens of event sources, and it’s rare to have hundreds of event sources. So could we treat the dynamic mapping between event sources and interrupt vectors as an advanced optional feature? > > [1] https://lkml.org/lkml/2014/12/25/169 > > >> >>> >>> Having few pages for a device that only have one queue is kind of a waste. >> >> Could I ask what's the meaning of few pages here? BTW, we didn't define MSIx-like tables for virtio-mmio. > > > I thought you're using a fixed size (2048) for each device. But looks not :) > > Thanks > > >> >> Thanks, >> >> Jing >> >>> >>> Thanks >>> >>> >>>> >>>> >>>> So the number of vectors supported by device is equal to the total number of vqs and config. >>>> >>>> We will try to explicitly highlight this point in spec for later version. >>>> >>>> >>>> Thanks! >>>> >>>> Jing >>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org >>>>> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org >>>>> >>>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org >> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org