From 132fffd4fdbd2f7aa94d7398f3e8489dd83ef047 Mon Sep 17 00:00:00 2001 From: Jin Yu Date: Tue, 12 May 2020 01:19:32 +0800 Subject: [PATCH] env: add the device ID of virtio device From the QEMU doc: 1af4:1000 network device (legacy) 1af4:1001 block device (legacy) 1af4:1002 balloon device (legacy) 1af4:1003 console device (legacy) 1af4:1004 SCSI host bus adapter device (legacy) 1af4:1005 entropy generator device (legacy) 1af4:1009 9p filesystem device (legacy) 1af4:1041 network device (modern) 1af4:1042 block device (modern) 1af4:1043 console device (modern) 1af4:1044 entropy generator device (modern) 1af4:1045 balloon device (modern) 1af4:1048 SCSI host bus adapter device (modern) 1af4:1049 9p filesystem device (modern) 1af4:1050 virtio gpu device (modern) 1af4:1052 virtio input device (modern) Change-Id: I75b04c331aebae9f20fecbca85d64415114ae5ff Signed-off-by: Jin Yu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2369 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- include/spdk/pci_ids.h | 7 +++++-- lib/env_dpdk/pci_virtio.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/spdk/pci_ids.h b/include/spdk/pci_ids.h index 659f44ff2..8896e0905 100644 --- a/include/spdk/pci_ids.h +++ b/include/spdk/pci_ids.h @@ -122,8 +122,11 @@ extern "C" { #define PCI_DEVICE_ID_INTEL_IOAT_ICX 0x0b00 -#define PCI_DEVICE_ID_VIRTIO_BLK_MODERN 0x1001 -#define PCI_DEVICE_ID_VIRTIO_SCSI_MODERN 0x1004 +#define PCI_DEVICE_ID_VIRTIO_BLK_LEGACY 0x1001 +#define PCI_DEVICE_ID_VIRTIO_SCSI_LEGACY 0x1004 +#define PCI_DEVICE_ID_VIRTIO_BLK_MODERN 0x1042 +#define PCI_DEVICE_ID_VIRTIO_SCSI_MODERN 0x1048 + #define PCI_DEVICE_ID_VIRTIO_VHOST_USER 0x1017 #define PCI_DEVICE_ID_INTEL_VMD 0x201d diff --git a/lib/env_dpdk/pci_virtio.c b/lib/env_dpdk/pci_virtio.c index 6672fabec..857edb7d7 100644 --- a/lib/env_dpdk/pci_virtio.c +++ b/lib/env_dpdk/pci_virtio.c @@ -38,6 +38,8 @@ static struct rte_pci_id virtio_pci_driver_id[] = { { RTE_PCI_DEVICE(SPDK_PCI_VID_VIRTIO, PCI_DEVICE_ID_VIRTIO_SCSI_MODERN) }, { RTE_PCI_DEVICE(SPDK_PCI_VID_VIRTIO, PCI_DEVICE_ID_VIRTIO_BLK_MODERN) }, + { RTE_PCI_DEVICE(SPDK_PCI_VID_VIRTIO, PCI_DEVICE_ID_VIRTIO_SCSI_LEGACY) }, + { RTE_PCI_DEVICE(SPDK_PCI_VID_VIRTIO, PCI_DEVICE_ID_VIRTIO_BLK_LEGACY) }, { .vendor_id = 0, /* sentinel */ }, };