env: deprecate spdk_pci_get_device()

This isn't possible to implement using the current public API of DPDK,
and all of the in-tree users have been removed.  Replace the
implementation with a stub that always returns NULL and mark it
deprecated so that any users have a release to update their code.

Change-Id: I4bc71f0a9fd518923484e862333b0c5e86883980
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405710
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2018-03-28 15:50:52 -07:00 committed by Jim Harris
parent 0920923ce2
commit 258845450d
3 changed files with 4 additions and 27 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;
}