summaryrefslogtreecommitdiffstats
path: root/include/linux/virtio_pci.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-05-14 13:55:41 +0300
committerRusty Russell <rusty@rustcorp.com.au>2009-06-12 22:16:37 +0930
commit82af8ce84ed65d2fb6d8c017d3f2bbbf161061fb (patch)
treeaed59c86724c7d3f565d1c60b38d25a7bf20985b /include/linux/virtio_pci.h
parent77cf524654a886e0fbbf03b16b44f048deef7b0c (diff)
downloadtalos-obmc-linux-82af8ce84ed65d2fb6d8c017d3f2bbbf161061fb.tar.gz
talos-obmc-linux-82af8ce84ed65d2fb6d8c017d3f2bbbf161061fb.zip
virtio_pci: optional MSI-X support
This implements optional MSI-X support in virtio_pci. MSI-X is used whenever the host supports at least 2 MSI-X vectors: 1 for configuration changes and 1 for virtqueues. Per-virtqueue vectors are allocated if enough vectors available. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (+ whitespace, style)
Diffstat (limited to 'include/linux/virtio_pci.h')
-rw-r--r--include/linux/virtio_pci.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h
index cd0fd5d181a6..9a3d7c48c622 100644
--- a/include/linux/virtio_pci.h
+++ b/include/linux/virtio_pci.h
@@ -47,9 +47,17 @@
/* The bit of the ISR which indicates a device configuration change. */
#define VIRTIO_PCI_ISR_CONFIG 0x2
+/* MSI-X registers: only enabled if MSI-X is enabled. */
+/* A 16-bit vector for configuration changes. */
+#define VIRTIO_MSI_CONFIG_VECTOR 20
+/* A 16-bit vector for selected queue notifications. */
+#define VIRTIO_MSI_QUEUE_VECTOR 22
+/* Vector value used to disable MSI for queue */
+#define VIRTIO_MSI_NO_VECTOR 0xffff
+
/* The remaining space is defined by each driver as the per-driver
* configuration space */
-#define VIRTIO_PCI_CONFIG 20
+#define VIRTIO_PCI_CONFIG(dev) ((dev)->msix_enabled ? 24 : 20)
/* Virtio ABI version, this must match exactly */
#define VIRTIO_PCI_ABI_VERSION 0
OpenPOWER on IntegriCloud