Discussion of the implementations of VIRTIO specification
 help / color / mirror / Atom feed
From: "Liu, Jing2" <jing2.liu@linux.intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	Zha Bin <zhabin@linux.alibaba.com>
Cc: linux-kernel@vger.kernel.org, jasowang@redhat.com,
	slp@redhat.com, virtio-dev@lists.oasis-open.org,
	gerry@linux.alibaba.com, jing2.liu@intel.com,
	chao.p.peng@intel.com
Subject: [virtio-dev] Re: [PATCH v1 2/2] virtio-mmio: add features for virtio-mmio specification version 3
Date: Wed, 15 Jan 2020 15:06:39 +0800	[thread overview]
Message-ID: <b0975121-99d4-3b53-50c5-03002d90b28f@linux.intel.com> (raw)
In-Reply-To: <20200105054412-mutt-send-email-mst@kernel.org>


On 1/5/2020 7:04 PM, Michael S. Tsirkin wrote:
> [...]
>> +static int vm_find_vqs_msi(struct virtio_device *vdev, unsigned int nvqs,
>> +			struct virtqueue *vqs[], vq_callback_t *callbacks[],
>> +			const char * const names[], const bool *ctx,
>> +			struct irq_affinity *desc)
>> +{
>> +	int i, err, irq;
>> +	struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
>> +
>> +	/* Allocate nvqs irqs for queues and one irq for configuration */
>> +	err = vm_request_msi_vectors(vdev, nvqs + 1);
>> +	if (err != 0)
>> +		return err;
> Not all devices need high speed.  Some might want to share
> irqs between VQs, or even with config change callback.
> Balloon is a case in point.
> A hint about max # of MSI necessary would be a good
> idea for this case.

This seems being a hint about telling MSI number device supported and 
whether it wants MSI sharing.

For devices with tens of queues at most or need high speed, they choose 
vector per queue, and can simply use fixed mapping.

For others, it can ask for advanced mode, which means MSI sharing and 
dynamic mapping.

What about let device decide the mode it would use, as follows.

MaxVecNum 32bit - The max msi vector number that device supports.

MsiState 32bit

- bit[x]=0 implies vec per queue/config and fixed mapping. In this case, 
MsiVecNum>=num_queue+1

- bit [x]=1 implies the hint of msi sharing and dynamic mapping. In this 
case, MsiVecNum<num_queue+1


Thanks,

Jing

>
> Sharing MSI doesn't necessarily require dedicated registers like PCI has,
> you can just program same vector in multiple VQs.


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  parent reply	other threads:[~2020-01-15  7:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1577240905.git.zhabin@linux.alibaba.com>
     [not found] ` <c0919551d21bf519b05e00e6a924cbde95c5df32.1577240905.git.zhabin@linux.alibaba.com>
2019-12-26  8:21   ` [virtio-dev] Re: [PATCH v1 1/2] x86/msi: Enhance x86 to support platform_msi Jason Wang
2020-01-02  6:55 ` [virtio-dev] Re: [PATCH v1 0/2] support virtio mmio specification Version 3 Jason Wang
     [not found] ` <a11d4c616158c9fb1ca4575ca0530b2e17b952fa.1577240905.git.zhabin@linux.alibaba.com>
2019-12-25 10:20   ` [virtio-dev] Re: [PATCH v1 2/2] virtio-mmio: add features for virtio-mmio specification version 3 Jason Wang
     [not found]     ` <0460F92A-3DF6-4F7A-903B-6434555577CC@linux.alibaba.com>
2019-12-26  8:09       ` Jason Wang
     [not found]         ` <56703BDA-B7AE-4656-8061-85FD1A130597@linux.alibaba.com>
2020-01-02  6:28           ` Jason Wang
2020-01-05 10:42           ` Michael S. Tsirkin
2020-01-06  7:24             ` Liu, Jing2
     [not found]             ` <02D38CC0-8DD5-44E1-92B2-0F9E97A112CE@linux.alibaba.com>
2020-01-09 16:47               ` Michael S. Tsirkin
2019-12-26  8:40   ` Jason Wang
2019-12-27  9:37     ` Liu, Jing2
2020-01-02  6:33       ` Jason Wang
2020-01-02  9:13         ` Liu, Jing2
2020-01-03  3:24           ` Jason Wang
     [not found]             ` <46806720-1D1C-40C3-BEE2-EDB0D4DA39BF@linux.alibaba.com>
2020-01-03  9:12               ` Jason Wang
2020-01-05 11:25                 ` Michael S. Tsirkin
2020-01-06  2:51                   ` Jason Wang
2020-01-05 11:04   ` Michael S. Tsirkin
2020-01-09  6:15     ` Liu, Jing2
2020-01-09 13:26       ` Michael S. Tsirkin
2020-01-15  7:06     ` Liu, Jing2 [this message]
2020-01-21  5:03     ` Liu, Jing2

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0975121-99d4-3b53-50c5-03002d90b28f@linux.intel.com \
    --to=jing2.liu@linux.intel.com \
    --cc=chao.p.peng@intel.com \
    --cc=gerry@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=jing2.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=slp@redhat.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=zhabin@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox