summaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_pci_common.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-02-05 18:15:18 +0100
committerMichael S. Tsirkin <mst@redhat.com>2017-02-27 20:54:03 +0200
commit5c34d002dcc7a6dd665a19d098b4f4cd5501ba1a (patch)
tree468b58c44812994e2f0a397af42c8dbb8fce451e /drivers/virtio/virtio_pci_common.h
parente3b56cdd4351f0e227d4d847eeadff4c82aef1b9 (diff)
downloadblackbird-op-linux-5c34d002dcc7a6dd665a19d098b4f4cd5501ba1a.tar.gz
blackbird-op-linux-5c34d002dcc7a6dd665a19d098b4f4cd5501ba1a.zip
virtio_pci: remove struct virtio_pci_vq_info
We don't really need struct virtio_pci_vq_info, as most field in there are redundant: - the vq backpointer is not strictly neede to start with - the entry in the vqs list is not needed - the generic virtqueue already has list, we only need to check if it has a callback to get the same semantics - we can use a simple array to look up the MSI-X vec if needed. - That simple array now also duoble serves to replace the per_vq_vectors flag Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio/virtio_pci_common.h')
-rw-r--r--drivers/virtio/virtio_pci_common.h25
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h
index b2f666250ae0..2038887bdf23 100644
--- a/drivers/virtio/virtio_pci_common.h
+++ b/drivers/virtio/virtio_pci_common.h
@@ -31,17 +31,6 @@
#include <linux/highmem.h>
#include <linux/spinlock.h>
-struct virtio_pci_vq_info {
- /* the actual virtqueue */
- struct virtqueue *vq;
-
- /* the list node for the virtqueues list */
- struct list_head node;
-
- /* MSI-X vector (or none) */
- unsigned msix_vector;
-};
-
/* Our device structure */
struct virtio_pci_device {
struct virtio_device vdev;
@@ -75,13 +64,6 @@ struct virtio_pci_device {
/* the IO mapping for the PCI config space */
void __iomem *ioaddr;
- /* a list of queues so we can dispatch IRQs */
- spinlock_t lock;
- struct list_head virtqueues;
-
- /* array of all queues for house-keeping */
- struct virtio_pci_vq_info **vqs;
-
/* MSI-X support */
int msix_enabled;
int intx_enabled;
@@ -94,16 +76,15 @@ struct virtio_pci_device {
/* Vectors allocated, excluding per-vq vectors if any */
unsigned msix_used_vectors;
- /* Whether we have vector per vq */
- bool per_vq_vectors;
+ /* Map of per-VQ MSI-X vectors, may be NULL */
+ unsigned *msix_vector_map;
struct virtqueue *(*setup_vq)(struct virtio_pci_device *vp_dev,
- struct virtio_pci_vq_info *info,
unsigned idx,
void (*callback)(struct virtqueue *vq),
const char *name,
u16 msix_vec);
- void (*del_vq)(struct virtio_pci_vq_info *info);
+ void (*del_vq)(struct virtqueue *vq);
u16 (*config_vector)(struct virtio_pci_device *vp_dev, u16 vector);
};
OpenPOWER on IntegriCloud