Imported Upstream version 16.11.2
[deb_dpdk.git] / drivers / net / virtio / virtio_pci.c
index 8d5355c..f6d697f 100644 (file)
@@ -48,6 +48,7 @@
  */
 #define PCI_CAPABILITY_LIST    0x34
 #define PCI_CAP_ID_VNDR                0x09
+#define PCI_CAP_ID_MSIX                0x11
 
 /*
  * The remaining space is defined by each driver as the per-driver
@@ -517,7 +518,7 @@ modern_del_queue(struct virtio_hw *hw, struct virtqueue *vq)
 static void
 modern_notify_queue(struct virtio_hw *hw __rte_unused, struct virtqueue *vq)
 {
-       io_write16(1, vq->notify_addr);
+       io_write16(vq->vq_queue_index, vq->notify_addr);
 }
 
 const struct virtio_pci_ops modern_ops = {
@@ -670,6 +671,9 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw)
                        break;
                }
 
+               if (cap.cap_vndr == PCI_CAP_ID_MSIX)
+                       hw->use_msix = 1;
+
                if (cap.cap_vndr != PCI_CAP_ID_VNDR) {
                        PMD_INIT_LOG(DEBUG,
                                "[%2x] skipping non VNDR cap id: %02x",