From d63a30e39d3800b9b5959597366eb670d8a64c28 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 19 Jan 2017 14:42:30 -0700 Subject: [PATCH] nvme/pcie: return 1 when PCI address doesn't match If the user asked for a specific PCI address in spdk_nvme_probe(), we need to return 1, not 0, for the other PCI addresses that don't match when enumerating. 0 means to attach the PCI driver, whereas 1 means to continue enumerating. With the previous behavior of returning 0, all NVMe devices would be attached to the DPDK PCI driver, even if the user did not request for them to be probed, and further calls to spdk_nvme_probe() would not find any devices. Change-Id: Ifbbcd7d1abe8ab535b6957855172e66a3e69fbe4 Signed-off-by: Daniel Verkamp --- lib/nvme/nvme_pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nvme/nvme_pcie.c b/lib/nvme/nvme_pcie.c index c240a2ab8..6c26f3cf1 100644 --- a/lib/nvme/nvme_pcie.c +++ b/lib/nvme/nvme_pcie.c @@ -621,7 +621,7 @@ pcie_nvme_enum_cb(void *ctx, struct spdk_pci_device *pci_dev) /* check whether user passes the pci_addr */ if (enum_ctx->has_pci_addr && (spdk_pci_addr_compare(&pci_addr, &enum_ctx->pci_addr) != 0)) { - return 0; + return 1; } return nvme_ctrlr_probe(&trid, pci_dev,