net/virtio: support modern device id 96/9596/2
authorGabriel Ganne <gabriel.ganne@enea.com>
Tue, 28 Nov 2017 08:55:07 +0000 (09:55 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Tue, 28 Nov 2017 12:27:10 +0000 (12:27 +0000)
Add legacy and modern macros to pci_config header.

This follows dpdk commit: 4c7903658f6b5a8f4901224ef405445541b91e4a
And PCI Device Conformance doc :
docs.oasis-open.org/virtio/virtio/v1.0/cs02/virtio-v1.0-cs02.html#x1-640001

Change-Id: Iacd40ea8c06f220736ca0bc7ce68bcf1e55b68f6
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
src/plugins/dpdk/device/init.c
src/vlib/pci/pci_config.h

index 7a6c5cf..416f62d 100755 (executable)
@@ -711,7 +711,9 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf)
       }
 
     /* virtio */
-    if (d->vendor_id == 0x1af4 && d->device_id == 0x1000)
+    if (d->vendor_id == 0x1af4 &&
+            (d->device_id == VIRTIO_PCI_LEGACY_DEVICEID_NET ||
+             d->device_id == VIRTIO_PCI_MODERN_DEVICEID_NET))
       ;
     /* vmxnet3 */
     else if (d->vendor_id == 0x15ad && d->device_id == 0x07b0)
index 92e56af..df82e1a 100644 (file)
@@ -161,6 +161,13 @@ pci_device_class_base (pci_device_class_t c)
   return c & ~0xff;
 }
 
+/*
+ * 0x1000 is the legacy device-id value
+ * 0x1041 is (0x1040 + 1), 1 being the Virtio Device ID
+ */
+#define VIRTIO_PCI_LEGACY_DEVICEID_NET 0x1000
+#define VIRTIO_PCI_MODERN_DEVICEID_NET 0x1041
+
 /*
  * Under PCI, each device has 256 bytes of configuration address space,
  * of which the first 64 bytes are standardized as follows: