diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2012-09-05 20:47:45 +0200 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-09-28 07:35:15 +0200 |
commit | 6457f126c888b3481fdae6f702e616cd0c79646e (patch) | |
tree | eae794db0b3983d2a901ecf6471eda6e3f9ff26f /drivers/virtio/virtio_pci.c | |
parent | virtio: introduce an API to set affinity for a virtqueue (diff) | |
download | linux-6457f126c888b3481fdae6f702e616cd0c79646e.tar.xz linux-6457f126c888b3481fdae6f702e616cd0c79646e.zip |
virtio: support reserved vqs
virtio network device multiqueue support reserves
vq 3 for future use (useful both for future extensions and to make it
pretty - this way receive vqs have even and transmit - odd numbers).
Make it possible to skip initialization for
specific vq numbers by specifying NULL for name.
Document this usage as well as (existing) NULL callback.
Drivers using this not coded up yet, so I simply tested
with virtio-pci and verified that this patch does
not break existing drivers.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio/virtio_pci.c')
-rw-r--r-- | drivers/virtio/virtio_pci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index f5dfe6bdb959..42b20769d122 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -555,7 +555,10 @@ static int vp_try_to_find_vqs(struct virtio_device *vdev, unsigned nvqs, vp_dev->per_vq_vectors = per_vq_vectors; allocated_vectors = vp_dev->msix_used_vectors; for (i = 0; i < nvqs; ++i) { - if (!callbacks[i] || !vp_dev->msix_enabled) + if (!names[i]) { + vqs[i] = NULL; + continue; + } else if (!callbacks[i] || !vp_dev->msix_enabled) msix_vec = VIRTIO_MSI_NO_VECTOR; else if (vp_dev->per_vq_vectors) msix_vec = allocated_vectors++; |