pci: use the new hotplug API for DPDK 18.11+

The previous functions were deprecated and now removed.

Change-Id: I076125aaf80b97c627ca45b860700fdf6d87e925
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/430557 (master)
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447850
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Darek Stojaczyk 2018-10-24 12:14:48 +02:00
parent 0be07189a1
commit 4183bbc058

View File

@ -84,7 +84,9 @@ spdk_pci_device_detach(struct spdk_pci_device *device)
#endif
#endif
#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3)
#if RTE_VERSION >= RTE_VERSION_NUM(18, 11, 0, 0)
rte_eal_hotplug_remove("pci", device->device.name);
#elif RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3)
struct spdk_pci_addr addr;
char bdf[32];
@ -136,7 +138,9 @@ spdk_pci_device_attach(struct spdk_pci_enum_ctx *ctx,
ctx->cb_fn = enum_cb;
ctx->cb_arg = enum_ctx;
#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3)
#if RTE_VERSION >= RTE_VERSION_NUM(18, 11, 0, 0)
if (rte_eal_hotplug_add("pci", bdf, "") != 0) {
#elif RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 3)
if (rte_eal_dev_attach(bdf, "") != 0) {
#elif RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 4)
if (rte_pci_probe_one(&addr) != 0) {