diff --git a/CHANGELOG.md b/CHANGELOG.md index 68cc962a5..258d867fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,8 @@ option, but instead returns SPDK_APP_PARSE_ARGS_HELP and SPDK_APP_PARSE_ARGS_FAIL, respectively, and SPDK_APP_PARSE_ARGS_SUCCESS on success. +spdk_pci_get_device() has been deprecated and will be removed in SPDK v18.07. + ### I/O Channels The prototype for spdk_poller_fn() has been modified; it now returns a value indicating diff --git a/include/spdk/env.h b/include/spdk/env.h index 2b72b60b4..3f94e4d39 100644 --- a/include/spdk/env.h +++ b/include/spdk/env.h @@ -353,7 +353,8 @@ int spdk_pci_nvme_enumerate(spdk_pci_enum_cb enum_cb, void *enum_ctx); int spdk_pci_ioat_enumerate(spdk_pci_enum_cb enum_cb, void *enum_ctx); int spdk_pci_virtio_enumerate(spdk_pci_enum_cb enum_cb, void *enum_ctx); -struct spdk_pci_device *spdk_pci_get_device(struct spdk_pci_addr *pci_addr); +struct spdk_pci_device *spdk_pci_get_device(struct spdk_pci_addr *pci_addr) +__attribute__((deprecated)); int spdk_pci_device_map_bar(struct spdk_pci_device *dev, uint32_t bar, void **mapped_addr, uint64_t *phys_addr, uint64_t *size); diff --git a/lib/env_dpdk/pci.c b/lib/env_dpdk/pci.c index 73bfbf51e..26cb0cc16 100644 --- a/lib/env_dpdk/pci.c +++ b/lib/env_dpdk/pci.c @@ -210,32 +210,6 @@ spdk_pci_enumerate(struct spdk_pci_enum_ctx *ctx, struct spdk_pci_device * spdk_pci_get_device(struct spdk_pci_addr *pci_addr) { - struct rte_pci_device *dev; - struct rte_pci_addr addr; - int rc; - - addr.domain = pci_addr->domain; - addr.bus = pci_addr->bus; - addr.devid = pci_addr->dev; - addr.function = pci_addr->func; - -#if RTE_VERSION >= RTE_VERSION_NUM(17, 05, 0, 2) - FOREACH_DEVICE_ON_PCIBUS(dev) { -#else - TAILQ_FOREACH(dev, &pci_device_list, next) { -#endif - rc = rte_eal_compare_pci_addr(&dev->addr, &addr); - if (rc < 0) { - continue; - } - - if (rc == 0) { - return (struct spdk_pci_device *)dev; - } else { - break; - } - } - return NULL; }