Commit 25884545 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405710


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 0920923c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -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);
+0 −26
Original line number Diff line number Diff line
@@ -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;
}