nvme: Rename spdk_nvme_transport to spdk_nvme_transport_type
It's not the whole transport - it's just an enum for the type of transport. Change-Id: Ia435a21792f221ddf50ddf4f0923c6152622eccb Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
47f13f5eca
commit
5b8c0c5ace
@ -44,14 +44,14 @@ int32_t spdk_nvme_retry_count;
|
||||
static int hotplug_fd = -1;
|
||||
|
||||
struct spdk_nvme_ctrlr *
|
||||
nvme_attach(enum spdk_nvme_transport transport,
|
||||
nvme_attach(enum spdk_nvme_transport_type trtype,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
{
|
||||
struct spdk_nvme_ctrlr *ctrlr;
|
||||
|
||||
ctrlr = nvme_transport_ctrlr_construct(transport, opts, probe_info, devhandle);
|
||||
ctrlr = nvme_transport_ctrlr_construct(trtype, opts, probe_info, devhandle);
|
||||
|
||||
return ctrlr;
|
||||
}
|
||||
@ -314,7 +314,7 @@ nvme_driver_init(void)
|
||||
}
|
||||
|
||||
int
|
||||
nvme_probe_one(enum spdk_nvme_transport transport, spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
nvme_probe_one(enum spdk_nvme_transport_type trtype, spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
struct spdk_nvme_probe_info *probe_info, void *devhandle)
|
||||
{
|
||||
struct spdk_nvme_ctrlr *ctrlr;
|
||||
@ -323,7 +323,7 @@ nvme_probe_one(enum spdk_nvme_transport transport, spdk_nvme_probe_cb probe_cb,
|
||||
spdk_nvme_ctrlr_opts_set_defaults(&opts);
|
||||
|
||||
if (probe_cb(cb_ctx, probe_info, &opts)) {
|
||||
ctrlr = nvme_attach(transport, &opts, probe_info, devhandle);
|
||||
ctrlr = nvme_attach(trtype, &opts, probe_info, devhandle);
|
||||
if (ctrlr == NULL) {
|
||||
SPDK_ERRLOG("nvme_attach() failed\n");
|
||||
return -1;
|
||||
@ -414,7 +414,7 @@ _spdk_nvme_probe(const struct spdk_nvme_discover_info *info, void *cb_ctx,
|
||||
spdk_nvme_remove_cb remove_cb)
|
||||
{
|
||||
int rc;
|
||||
enum spdk_nvme_transport transport;
|
||||
enum spdk_nvme_transport_type trtype;
|
||||
struct spdk_nvme_ctrlr *ctrlr;
|
||||
|
||||
rc = nvme_driver_init();
|
||||
@ -432,7 +432,7 @@ _spdk_nvme_probe(const struct spdk_nvme_discover_info *info, void *cb_ctx,
|
||||
}
|
||||
|
||||
if (!info) {
|
||||
transport = SPDK_NVME_TRANSPORT_PCIE;
|
||||
trtype = SPDK_NVME_TRANSPORT_PCIE;
|
||||
} else {
|
||||
if (!spdk_nvme_transport_available(info->trtype)) {
|
||||
SPDK_ERRLOG("NVMe over Fabrics trtype %u not available\n", info->trtype);
|
||||
@ -440,10 +440,10 @@ _spdk_nvme_probe(const struct spdk_nvme_discover_info *info, void *cb_ctx,
|
||||
return -1;
|
||||
}
|
||||
|
||||
transport = (uint8_t)info->trtype;
|
||||
trtype = (uint8_t)info->trtype;
|
||||
}
|
||||
|
||||
nvme_transport_ctrlr_scan(transport, probe_cb, cb_ctx, (void *)info, NULL);
|
||||
nvme_transport_ctrlr_scan(trtype, probe_cb, cb_ctx, (void *)info, NULL);
|
||||
|
||||
if (!spdk_process_is_primary()) {
|
||||
TAILQ_FOREACH(ctrlr, &g_spdk_nvme_driver->attached_ctrlrs, tailq) {
|
||||
|
@ -231,7 +231,7 @@ struct nvme_request {
|
||||
* Currently, this uses 0 for PCIe since it is reserved by NVMe-oF. If 0 is ever assigned as a
|
||||
* valid TRTYPE, this would need to be changed.
|
||||
*/
|
||||
enum spdk_nvme_transport {
|
||||
enum spdk_nvme_transport_type {
|
||||
SPDK_NVME_TRANSPORT_PCIE = 0,
|
||||
SPDK_NVME_TRANSPORT_RDMA = SPDK_NVMF_TRTYPE_RDMA,
|
||||
};
|
||||
@ -250,7 +250,7 @@ struct nvme_async_event_request {
|
||||
struct spdk_nvme_qpair {
|
||||
STAILQ_HEAD(, nvme_request) queued_req;
|
||||
|
||||
enum spdk_nvme_transport transport;
|
||||
enum spdk_nvme_transport_type trtype;
|
||||
|
||||
uint16_t id;
|
||||
|
||||
@ -345,7 +345,7 @@ struct spdk_nvme_ctrlr {
|
||||
/** Array of namespaces indexed by nsid - 1 */
|
||||
struct spdk_nvme_ns *ns;
|
||||
|
||||
enum spdk_nvme_transport transport;
|
||||
enum spdk_nvme_transport_type trtype;
|
||||
|
||||
uint32_t num_ns;
|
||||
|
||||
@ -501,7 +501,7 @@ void nvme_completion_poll_cb(void *arg, const struct spdk_nvme_cpl *cpl);
|
||||
int nvme_ctrlr_add_process(struct spdk_nvme_ctrlr *ctrlr, void *devhandle);
|
||||
void nvme_ctrlr_free_processes(struct spdk_nvme_ctrlr *ctrlr);
|
||||
|
||||
int nvme_probe_one(enum spdk_nvme_transport type, spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
int nvme_probe_one(enum spdk_nvme_transport_type trtype, spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
struct spdk_nvme_probe_info *probe_info, void *devhandle);
|
||||
|
||||
int nvme_ctrlr_construct(struct spdk_nvme_ctrlr *ctrlr);
|
||||
@ -546,17 +546,17 @@ int nvme_mutex_init_recursive_shared(pthread_mutex_t *mtx);
|
||||
bool nvme_completion_is_retry(const struct spdk_nvme_cpl *cpl);
|
||||
void nvme_qpair_print_command(struct spdk_nvme_qpair *qpair, struct spdk_nvme_cmd *cmd);
|
||||
void nvme_qpair_print_completion(struct spdk_nvme_qpair *qpair, struct spdk_nvme_cpl *cpl);
|
||||
struct spdk_nvme_ctrlr *nvme_attach(enum spdk_nvme_transport transport,
|
||||
struct spdk_nvme_ctrlr *nvme_attach(enum spdk_nvme_transport_type trtype,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle);
|
||||
|
||||
/* Transport specific functions */
|
||||
#define DECLARE_TRANSPORT(name) \
|
||||
struct spdk_nvme_ctrlr *nvme_ ## name ## _ctrlr_construct(enum spdk_nvme_transport transport, const struct spdk_nvme_ctrlr_opts *opts, \
|
||||
struct spdk_nvme_ctrlr *nvme_ ## name ## _ctrlr_construct(enum spdk_nvme_transport_type trtype, const struct spdk_nvme_ctrlr_opts *opts, \
|
||||
const struct spdk_nvme_probe_info *probe_info, void *devhandle); \
|
||||
int nvme_ ## name ## _ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr); \
|
||||
int nvme_ ## name ## _ctrlr_scan(enum spdk_nvme_transport transport, spdk_nvme_probe_cb probe_cb, void *cb_ctx, void *devhandle, void *pci_address); \
|
||||
int nvme_ ## name ## _ctrlr_scan(enum spdk_nvme_transport_type trtype, spdk_nvme_probe_cb probe_cb, void *cb_ctx, void *devhandle, void *pci_address); \
|
||||
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); \
|
||||
|
@ -229,14 +229,14 @@ nvme_pcie_ctrlr_setup_signal(void)
|
||||
static inline struct nvme_pcie_ctrlr *
|
||||
nvme_pcie_ctrlr(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
assert(ctrlr->transport == SPDK_NVME_TRANSPORT_PCIE);
|
||||
assert(ctrlr->trtype == SPDK_NVME_TRANSPORT_PCIE);
|
||||
return (struct nvme_pcie_ctrlr *)((uintptr_t)ctrlr - offsetof(struct nvme_pcie_ctrlr, ctrlr));
|
||||
}
|
||||
|
||||
static inline struct nvme_pcie_qpair *
|
||||
nvme_pcie_qpair(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
assert(qpair->transport == SPDK_NVME_TRANSPORT_PCIE);
|
||||
assert(qpair->trtype == SPDK_NVME_TRANSPORT_PCIE);
|
||||
return (struct nvme_pcie_qpair *)((uintptr_t)qpair - offsetof(struct nvme_pcie_qpair, qpair));
|
||||
}
|
||||
|
||||
@ -552,8 +552,9 @@ pcie_nvme_enum_cb(void *ctx, struct spdk_pci_device *pci_dev)
|
||||
}
|
||||
|
||||
int
|
||||
nvme_pcie_ctrlr_scan(enum spdk_nvme_transport transport,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx, void *devhandle, void *pci_address)
|
||||
nvme_pcie_ctrlr_scan(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
void *devhandle, void *pci_address)
|
||||
{
|
||||
struct nvme_pcie_enum_ctx enum_ctx;
|
||||
|
||||
@ -567,7 +568,7 @@ nvme_pcie_ctrlr_scan(enum spdk_nvme_transport transport,
|
||||
}
|
||||
}
|
||||
|
||||
struct spdk_nvme_ctrlr *nvme_pcie_ctrlr_construct(enum spdk_nvme_transport transport,
|
||||
struct spdk_nvme_ctrlr *nvme_pcie_ctrlr_construct(enum spdk_nvme_transport_type trtype,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
@ -586,7 +587,7 @@ struct spdk_nvme_ctrlr *nvme_pcie_ctrlr_construct(enum spdk_nvme_transport trans
|
||||
|
||||
pctrlr->is_remapped = false;
|
||||
pctrlr->ctrlr.is_removed = false;
|
||||
pctrlr->ctrlr.transport = SPDK_NVME_TRANSPORT_PCIE;
|
||||
pctrlr->ctrlr.trtype = SPDK_NVME_TRANSPORT_PCIE;
|
||||
pctrlr->devhandle = devhandle;
|
||||
pctrlr->ctrlr.opts = *opts;
|
||||
pctrlr->ctrlr.probe_info = *probe_info;
|
||||
|
@ -352,7 +352,7 @@ nvme_qpair_construct(struct spdk_nvme_qpair *qpair, uint16_t id,
|
||||
qpair->qprio = qprio;
|
||||
|
||||
qpair->ctrlr = ctrlr;
|
||||
qpair->transport = ctrlr->transport;
|
||||
qpair->trtype = ctrlr->trtype;
|
||||
|
||||
STAILQ_INIT(&qpair->queued_req);
|
||||
|
||||
|
@ -128,14 +128,14 @@ static int nvme_rdma_qpair_destroy(struct spdk_nvme_qpair *qpair);
|
||||
static inline struct nvme_rdma_qpair *
|
||||
nvme_rdma_qpair(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
assert(qpair->transport == SPDK_NVME_TRANSPORT_RDMA);
|
||||
assert(qpair->trtype == SPDK_NVME_TRANSPORT_RDMA);
|
||||
return (struct nvme_rdma_qpair *)((uintptr_t)qpair - offsetof(struct nvme_rdma_qpair, qpair));
|
||||
}
|
||||
|
||||
static inline struct nvme_rdma_ctrlr *
|
||||
nvme_rdma_ctrlr(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
assert(ctrlr->transport == SPDK_NVME_TRANSPORT_RDMA);
|
||||
assert(ctrlr->trtype == SPDK_NVME_TRANSPORT_RDMA);
|
||||
return (struct nvme_rdma_ctrlr *)((uintptr_t)ctrlr - offsetof(struct nvme_rdma_ctrlr, ctrlr));
|
||||
}
|
||||
|
||||
@ -1052,8 +1052,9 @@ nvme_fabrics_get_log_discovery_page(struct spdk_nvme_ctrlr *ctrlr,
|
||||
|
||||
/* This function must only be called while holding g_spdk_nvme_driver->lock */
|
||||
int
|
||||
nvme_rdma_ctrlr_scan(enum spdk_nvme_transport transport,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx, void *devhandle, void *pci_address)
|
||||
nvme_rdma_ctrlr_scan(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
void *devhandle, void *pci_address)
|
||||
{
|
||||
struct spdk_nvme_discover_info *discover_info = devhandle;
|
||||
struct spdk_nvme_probe_info probe_info;
|
||||
@ -1067,13 +1068,13 @@ nvme_rdma_ctrlr_scan(enum spdk_nvme_transport transport,
|
||||
|
||||
spdk_nvme_ctrlr_opts_set_defaults(&discovery_opts);
|
||||
|
||||
probe_info.trtype = (uint8_t)transport;
|
||||
probe_info.trtype = (uint8_t)trtype;
|
||||
snprintf(probe_info.subnqn, sizeof(probe_info.subnqn), "%s", discover_info->subnqn);
|
||||
snprintf(probe_info.traddr, sizeof(probe_info.traddr), "%s", discover_info->traddr);
|
||||
snprintf(probe_info.trsvcid, sizeof(probe_info.trsvcid), "%s", discover_info->trsvcid);
|
||||
|
||||
memset(buffer, 0x0, 4096);
|
||||
discovery_ctrlr = nvme_attach(transport, &discovery_opts, &probe_info, NULL);
|
||||
discovery_ctrlr = nvme_attach(trtype, &discovery_opts, &probe_info, NULL);
|
||||
if (discovery_ctrlr == NULL) {
|
||||
return -1;
|
||||
}
|
||||
@ -1145,10 +1146,11 @@ nvme_rdma_ctrlr_scan(enum spdk_nvme_transport transport,
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct spdk_nvme_ctrlr *nvme_rdma_ctrlr_construct(enum spdk_nvme_transport transport,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
struct spdk_nvme_ctrlr *
|
||||
nvme_rdma_ctrlr_construct(enum spdk_nvme_transport_type trtype,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
{
|
||||
struct nvme_rdma_ctrlr *rctrlr;
|
||||
union spdk_nvme_cap_register cap;
|
||||
@ -1160,7 +1162,7 @@ struct spdk_nvme_ctrlr *nvme_rdma_ctrlr_construct(enum spdk_nvme_transport trans
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rctrlr->ctrlr.transport = SPDK_NVME_TRANSPORT_RDMA;
|
||||
rctrlr->ctrlr.trtype = SPDK_NVME_TRANSPORT_RDMA;
|
||||
rctrlr->ctrlr.opts = *opts;
|
||||
rctrlr->ctrlr.probe_info = *probe_info;
|
||||
|
||||
|
@ -39,14 +39,14 @@
|
||||
|
||||
#ifdef DEBUG
|
||||
static __attribute__((noreturn)) void
|
||||
nvme_transport_unknown(enum spdk_nvme_transport transport)
|
||||
nvme_transport_unknown(enum spdk_nvme_transport_type trtype)
|
||||
{
|
||||
SPDK_ERRLOG("Unknown transport %d\n", (int)transport);
|
||||
SPDK_ERRLOG("Unknown transport %d\n", (int)trtype);
|
||||
abort();
|
||||
}
|
||||
#define TRANSPORT_DEFAULT(transport) default: nvme_transport_unknown(transport);
|
||||
#define TRANSPORT_DEFAULT(trtype) default: nvme_transport_unknown(trtype);
|
||||
#else
|
||||
#define TRANSPORT_DEFAULT(transport)
|
||||
#define TRANSPORT_DEFAULT(trtype)
|
||||
#endif
|
||||
|
||||
#define TRANSPORT_PCIE(func_name, args) case SPDK_NVME_TRANSPORT_PCIE: return nvme_pcie_ ## func_name args;
|
||||
@ -57,12 +57,12 @@ nvme_transport_unknown(enum spdk_nvme_transport transport)
|
||||
#define TRANSPORT_FABRICS_RDMA(func_name, args) case SPDK_NVME_TRANSPORT_RDMA: SPDK_UNREACHABLE();
|
||||
#define TRANSPORT_RDMA_AVAILABLE false
|
||||
#endif
|
||||
#define NVME_TRANSPORT_CALL(transport, func_name, args) \
|
||||
#define NVME_TRANSPORT_CALL(trtype, func_name, args) \
|
||||
do { \
|
||||
switch (transport) { \
|
||||
switch (trtype) { \
|
||||
TRANSPORT_PCIE(func_name, args) \
|
||||
TRANSPORT_FABRICS_RDMA(func_name, args) \
|
||||
TRANSPORT_DEFAULT(transport) \
|
||||
TRANSPORT_DEFAULT(trtype) \
|
||||
} \
|
||||
SPDK_UNREACHABLE(); \
|
||||
} while (0)
|
||||
@ -84,126 +84,128 @@ spdk_nvme_transport_available(enum spdk_nvmf_trtype trtype)
|
||||
return false;
|
||||
}
|
||||
|
||||
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(enum spdk_nvme_transport transport,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
struct spdk_nvme_ctrlr *
|
||||
nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(transport, ctrlr_construct, (transport, opts, probe_info, devhandle));
|
||||
NVME_TRANSPORT_CALL(trtype, ctrlr_construct, (trtype, opts, probe_info, devhandle));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_scan(enum spdk_nvme_transport transport,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx, void *devhandle, void *pci_address)
|
||||
nvme_transport_ctrlr_scan(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
void *devhandle, void *pci_address)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(transport, ctrlr_scan, (transport, probe_cb, cb_ctx, devhandle, pci_address));
|
||||
NVME_TRANSPORT_CALL(trtype, ctrlr_scan, (trtype, probe_cb, cb_ctx, devhandle, pci_address));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_destruct, (ctrlr));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_destruct, (ctrlr));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_enable(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_enable, (ctrlr));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_enable, (ctrlr));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_get_pci_id(struct spdk_nvme_ctrlr *ctrlr, struct spdk_pci_id *pci_id)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_get_pci_id, (ctrlr, pci_id));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_get_pci_id, (ctrlr, pci_id));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_set_reg_4(struct spdk_nvme_ctrlr *ctrlr, uint32_t offset, uint32_t value)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_set_reg_4, (ctrlr, offset, value));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_set_reg_4, (ctrlr, offset, value));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_set_reg_8(struct spdk_nvme_ctrlr *ctrlr, uint32_t offset, uint64_t value)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_set_reg_8, (ctrlr, offset, value));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_set_reg_8, (ctrlr, offset, value));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_get_reg_4(struct spdk_nvme_ctrlr *ctrlr, uint32_t offset, uint32_t *value)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_get_reg_4, (ctrlr, offset, value));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_get_reg_4, (ctrlr, offset, value));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_get_reg_8(struct spdk_nvme_ctrlr *ctrlr, uint32_t offset, uint64_t *value)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_get_reg_8, (ctrlr, offset, value));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_get_reg_8, (ctrlr, offset, value));
|
||||
}
|
||||
|
||||
uint32_t
|
||||
nvme_transport_ctrlr_get_max_xfer_size(struct spdk_nvme_ctrlr *ctrlr)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_get_max_xfer_size, (ctrlr));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_get_max_xfer_size, (ctrlr));
|
||||
}
|
||||
|
||||
struct spdk_nvme_qpair *
|
||||
nvme_transport_ctrlr_create_io_qpair(struct spdk_nvme_ctrlr *ctrlr, uint16_t qid,
|
||||
enum spdk_nvme_qprio qprio)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_create_io_qpair, (ctrlr, qid, qprio));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_create_io_qpair, (ctrlr, qid, qprio));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_delete_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_delete_io_qpair, (ctrlr, qpair));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_delete_io_qpair, (ctrlr, qpair));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_reinit_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(ctrlr->transport, ctrlr_reinit_io_qpair, (ctrlr, qpair));
|
||||
NVME_TRANSPORT_CALL(ctrlr->trtype, ctrlr_reinit_io_qpair, (ctrlr, qpair));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_qpair_construct(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(qpair->transport, qpair_construct, (qpair));
|
||||
NVME_TRANSPORT_CALL(qpair->trtype, qpair_construct, (qpair));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_qpair_enable(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(qpair->transport, qpair_enable, (qpair));
|
||||
NVME_TRANSPORT_CALL(qpair->trtype, qpair_enable, (qpair));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_qpair_disable(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(qpair->transport, qpair_disable, (qpair));
|
||||
NVME_TRANSPORT_CALL(qpair->trtype, qpair_disable, (qpair));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_qpair_reset(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(qpair->transport, qpair_reset, (qpair));
|
||||
NVME_TRANSPORT_CALL(qpair->trtype, qpair_reset, (qpair));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_qpair_fail(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(qpair->transport, qpair_fail, (qpair));
|
||||
NVME_TRANSPORT_CALL(qpair->trtype, qpair_fail, (qpair));
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *req)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(qpair->transport, qpair_submit_request, (qpair, req));
|
||||
NVME_TRANSPORT_CALL(qpair->trtype, qpair_submit_request, (qpair, req));
|
||||
}
|
||||
|
||||
int32_t
|
||||
nvme_transport_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_completions)
|
||||
{
|
||||
NVME_TRANSPORT_CALL(qpair->transport, qpair_process_completions, (qpair, max_completions));
|
||||
NVME_TRANSPORT_CALL(qpair->trtype, qpair_process_completions, (qpair, max_completions));
|
||||
}
|
||||
|
@ -61,17 +61,19 @@ spdk_nvme_transport_available(enum spdk_nvmf_trtype trtype)
|
||||
return true;
|
||||
}
|
||||
|
||||
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(enum spdk_nvme_transport transport,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
struct spdk_nvme_ctrlr *
|
||||
nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_scan(enum spdk_nvme_transport transport,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx, void *devhandle, void *pci_address)
|
||||
nvme_transport_ctrlr_scan(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
void *devhandle, void *pci_address)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -61,10 +61,11 @@ struct spdk_nvme_registers g_ut_nvme_regs = {};
|
||||
|
||||
__thread int nvme_thread_ioq_index = -1;
|
||||
|
||||
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(enum spdk_nvme_transport transport,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
struct spdk_nvme_ctrlr *
|
||||
nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -75,10 +75,11 @@ spdk_nvme_transport_available(enum spdk_nvmf_trtype trtype)
|
||||
return true;
|
||||
}
|
||||
|
||||
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(enum spdk_nvme_transport transport,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
struct spdk_nvme_ctrlr *
|
||||
nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype,
|
||||
const struct spdk_nvme_ctrlr_opts *opts,
|
||||
const struct spdk_nvme_probe_info *probe_info,
|
||||
void *devhandle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -193,8 +194,9 @@ nvme_ctrlr_get_ref_count(struct spdk_nvme_ctrlr *ctrlr)
|
||||
}
|
||||
|
||||
int
|
||||
nvme_transport_ctrlr_scan(enum spdk_nvme_transport transport,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx, void *devhandle, void *pci_address)
|
||||
nvme_transport_ctrlr_scan(enum spdk_nvme_transport_type trtype,
|
||||
spdk_nvme_probe_cb probe_cb, void *cb_ctx,
|
||||
void *devhandle, void *pci_address)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user