From 4183bbc05815f6a4ae49ea8b3d7136690c67ed01 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Wed, 24 Oct 2018 12:14:48 +0200 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/430557 (master) Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447850 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/env_dpdk/pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/env_dpdk/pci.c b/lib/env_dpdk/pci.c index 4d63d2bcd..2d5aeccb2 100644 --- a/lib/env_dpdk/pci.c +++ b/lib/env_dpdk/pci.c @@ -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) {