env: Adjust for API changes to DPDK PCI in 16.11
Change-Id: Ie76d2d18f65f079f465afef4be5154fa53ab3783 Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
0bd08c4536
commit
b697d2809d
25
lib/env/pci.c
vendored
25
lib/env/pci.c
vendored
@ -165,23 +165,32 @@ spdk_pci_enumerate(enum spdk_pci_device_type type,
|
|||||||
{
|
{
|
||||||
struct spdk_pci_enum_ctx ctx = {};
|
struct spdk_pci_enum_ctx ctx = {};
|
||||||
int rc;
|
int rc;
|
||||||
|
const char *name;
|
||||||
ctx.enum_cb = enum_cb;
|
|
||||||
ctx.enum_ctx = enum_ctx;
|
|
||||||
ctx.driver.devinit = spdk_pci_device_init;
|
|
||||||
ctx.driver.devuninit = spdk_pci_device_fini;
|
|
||||||
ctx.driver.drv_flags = RTE_PCI_DRV_NEED_MAPPING;
|
|
||||||
|
|
||||||
if (type == SPDK_PCI_DEVICE_NVME) {
|
if (type == SPDK_PCI_DEVICE_NVME) {
|
||||||
ctx.driver.name = "SPDK NVMe";
|
name = "SPDK NVMe";
|
||||||
ctx.driver.id_table = nvme_pci_driver_id;
|
ctx.driver.id_table = nvme_pci_driver_id;
|
||||||
} else if (type == SPDK_PCI_DEVICE_IOAT) {
|
} else if (type == SPDK_PCI_DEVICE_IOAT) {
|
||||||
|
name = "SPDK IOAT";
|
||||||
ctx.driver.id_table = ioat_driver_id;
|
ctx.driver.id_table = ioat_driver_id;
|
||||||
ctx.driver.name = "SPDK IOAT";
|
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.enum_cb = enum_cb;
|
||||||
|
ctx.enum_ctx = enum_ctx;
|
||||||
|
ctx.driver.drv_flags = RTE_PCI_DRV_NEED_MAPPING;
|
||||||
|
|
||||||
|
#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0)
|
||||||
|
ctx.driver.probe = spdk_pci_device_init;
|
||||||
|
ctx.driver.remove = spdk_pci_device_fini;
|
||||||
|
ctx.driver.driver.name = name;
|
||||||
|
#else
|
||||||
|
ctx.driver.devinit = spdk_pci_device_init;
|
||||||
|
ctx.driver.devuninit = spdk_pci_device_fini;
|
||||||
|
ctx.driver.name = name;
|
||||||
|
#endif
|
||||||
|
|
||||||
rte_eal_pci_register(&ctx.driver);
|
rte_eal_pci_register(&ctx.driver);
|
||||||
rc = rte_eal_pci_probe();
|
rc = rte_eal_pci_probe();
|
||||||
rte_eal_pci_unregister(&ctx.driver);
|
rte_eal_pci_unregister(&ctx.driver);
|
||||||
|
Loading…
Reference in New Issue
Block a user