nvme: remove transport ctrlr_attach callback
Now that the hotplug code is isolated in nvme_pcie.c, it can call the PCIe transport attach function directly. Change-Id: I2df3b9168473b537cc9b13367e06d3d3b6fa22be Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
d2ae4f0723
commit
f80c0f4fdd
@ -567,7 +567,6 @@ void nvme_qpair_print_completion(struct spdk_nvme_qpair *qpair, struct spdk_nvme
|
||||
void *devhandle); \
|
||||
int nvme_ ## name ## _ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr); \
|
||||
int nvme_ ## name ## _ctrlr_scan(const struct spdk_nvme_transport_id *trid, void *cb_ctx, spdk_nvme_probe_cb probe_cb, spdk_nvme_remove_cb remove_cb); \
|
||||
int nvme_ ## name ## _ctrlr_attach(enum spdk_nvme_transport_type trtype, spdk_nvme_probe_cb probe_cb, void *cb_ctx, struct spdk_pci_addr *addr); \
|
||||
int nvme_ ## name ## _ctrlr_enable(struct spdk_nvme_ctrlr *ctrlr); \
|
||||
int nvme_ ## name ## _ctrlr_get_pci_id(struct spdk_nvme_ctrlr *ctrlr, struct spdk_pci_id *pci_id); \
|
||||
int nvme_ ## name ## _ctrlr_set_reg_4(struct spdk_nvme_ctrlr *ctrlr, uint32_t offset, uint32_t value); \
|
||||
|
@ -183,6 +183,8 @@ struct nvme_pcie_qpair {
|
||||
uint64_t cpl_bus_addr;
|
||||
};
|
||||
|
||||
static int nvme_pcie_ctrlr_attach(spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
struct spdk_pci_addr *pci_addr);
|
||||
static int nvme_pcie_qpair_construct(struct spdk_nvme_qpair *qpair);
|
||||
static int nvme_pcie_qpair_destroy(struct spdk_nvme_qpair *qpair);
|
||||
|
||||
@ -245,7 +247,7 @@ _nvme_pcie_hotplug_monitor(void *cb_ctx, spdk_nvme_probe_cb probe_cb,
|
||||
event.traddr);
|
||||
if (spdk_process_is_primary()) {
|
||||
if (!spdk_pci_addr_parse(&pci_addr, event.traddr)) {
|
||||
nvme_transport_ctrlr_attach(SPDK_NVME_TRANSPORT_PCIE, probe_cb, cb_ctx, &pci_addr);
|
||||
nvme_pcie_ctrlr_attach(probe_cb, cb_ctx, &pci_addr);
|
||||
}
|
||||
}
|
||||
} else if (event.action == SPDK_NVME_UEVENT_REMOVE) {
|
||||
@ -641,10 +643,8 @@ nvme_pcie_ctrlr_scan(const struct spdk_nvme_transport_id *trid,
|
||||
return spdk_pci_nvme_enumerate(pcie_nvme_enum_cb, &enum_ctx);
|
||||
}
|
||||
|
||||
int
|
||||
nvme_pcie_ctrlr_attach(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
struct spdk_pci_addr *pci_addr)
|
||||
static int
|
||||
nvme_pcie_ctrlr_attach(spdk_nvme_probe_cb probe_cb, void *cb_ctx, struct spdk_pci_addr *pci_addr)
|
||||
{
|
||||
struct nvme_pcie_enum_ctx enum_ctx;
|
||||
|
||||
|
@ -1123,15 +1123,6 @@ nvme_rdma_ctrlr_scan(const struct spdk_nvme_transport_id *discovery_trid,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
nvme_rdma_ctrlr_attach(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
struct spdk_pci_addr *addr)
|
||||
{
|
||||
/* Not implemented yet */
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct spdk_nvme_ctrlr *nvme_rdma_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
void *devhandle)
|
||||
|
@ -97,14 +97,6 @@ nvme_transport_ctrlr_scan(const struct spdk_nvme_transport_id *trid,
|
||||
NVME_TRANSPORT_CALL(trid->trtype, ctrlr_scan, (trid, cb_ctx, probe_cb, remove_cb));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_attach(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
struct spdk_pci_addr *addr)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(trtype, ctrlr_attach, (trtype, probe_cb, cb_ctx, addr));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
|
@ -77,14 +77,6 @@ nvme_transport_ctrlr_scan(const struct spdk_nvme_transport_id *trid,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_attach(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
struct spdk_pci_addr *addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
nvme_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
|
@ -180,14 +180,6 @@ nvme_transport_ctrlr_scan(const struct spdk_nvme_transport_id *trid,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_attach(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
struct spdk_pci_addr *addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
prepare_for_test(struct spdk_nvme_ns *ns, struct spdk_nvme_ctrlr *ctrlr,
|
||||
struct spdk_nvme_qpair *qpair,
|
||||
|
Loading…
x
Reference in New Issue
Block a user