lib/nvmf: removed deprecated stats API
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I6e89e7a6b723745517cee077facad134692044d3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8899 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
0ac1bd07b8
commit
c97eb5ecd1
@ -117,6 +117,15 @@ Added the `nvmf_set_crdt` RPC for setting command retry delay times.
|
||||
|
||||
Expanded `spdk_nvmf_poll_group_stat` with current qpair count statistics.
|
||||
|
||||
Removed following deprecated APIs:
|
||||
- `spdk_nvmf_poll_group_get_stat` (function in `nvmf.h`),
|
||||
- `spdk_nvmf_transport_poll_group_get_stat` (function in `nvmf.h`),
|
||||
- `spdk_nvmf_transport_poll_group_free_stat`(function in `nvmf.h`),
|
||||
- `spdk_nvmf_rdma_device_stat` (struct in `nvmf.h`),
|
||||
- `spdk_nvmf_transport_poll_group_stat` (struct in `nvmf.h`),
|
||||
- `poll_group_get_stat` (transport op in `nvmf_transport.h`),
|
||||
- `poll_group_free_stat` (transport op in `nvmf_transport.h`).
|
||||
|
||||
### rpc
|
||||
|
||||
New RPC `bdev_rbd_register_cluster` and `bdev_rbd_unregister_cluster` was added, it allows to create
|
||||
|
@ -12,18 +12,6 @@ ABI cannot be removed without providing deprecation notice for at least single S
|
||||
|
||||
# Deprecation Notices {#deprecation-notices}
|
||||
|
||||
## nvmf
|
||||
|
||||
The following APIs have been deprecated and will be removed in SPDK 21.07:
|
||||
- `spdk_nvmf_poll_group_get_stat` (function in `nvmf.h`),
|
||||
- `spdk_nvmf_transport_poll_group_get_stat` (function in `nvmf.h`),
|
||||
- `spdk_nvmf_transport_poll_group_free_stat`(function in `nvmf.h`),
|
||||
- `spdk_nvmf_rdma_device_stat` (struct in `nvmf.h`),
|
||||
- `spdk_nvmf_transport_poll_group_stat` (struct in `nvmf.h`),
|
||||
- `poll_group_get_stat` (transport op in `nvmf_transport.h`),
|
||||
- `poll_group_free_stat` (transport op in `nvmf_transport.h`).
|
||||
Please use `spdk_nvmf_poll_group_dump_stat` and `poll_group_dump_stat` instead.
|
||||
|
||||
## rpc
|
||||
|
||||
Parameter `enable-zerocopy-send` of RPC `sock_impl_set_options` is deprecated and will be removed in SPDK 21.07,
|
||||
|
@ -132,41 +132,6 @@ struct spdk_nvmf_poll_group_stat {
|
||||
uint64_t pending_bdev_io;
|
||||
};
|
||||
|
||||
/* Deprecated.
|
||||
* Please use the flow with spdk_nvmf_poll_group_dump_stat,
|
||||
* which hides statistics structures within the transport.
|
||||
*/
|
||||
struct spdk_nvmf_rdma_device_stat {
|
||||
const char *name;
|
||||
uint64_t polls;
|
||||
uint64_t idle_polls;
|
||||
uint64_t completions;
|
||||
uint64_t requests;
|
||||
uint64_t request_latency;
|
||||
uint64_t pending_free_request;
|
||||
uint64_t pending_rdma_read;
|
||||
uint64_t pending_rdma_write;
|
||||
uint64_t total_send_wrs;
|
||||
uint64_t send_doorbell_updates;
|
||||
uint64_t total_recv_wrs;
|
||||
uint64_t recv_doorbell_updates;
|
||||
};
|
||||
|
||||
/* Deprecated.
|
||||
* Please use the flow with spdk_nvmf_poll_group_dump_stat,
|
||||
* which hides statistics structures within the transport.
|
||||
*/
|
||||
struct spdk_nvmf_transport_poll_group_stat {
|
||||
spdk_nvme_transport_type_t trtype;
|
||||
union {
|
||||
struct {
|
||||
uint64_t pending_data_buffer;
|
||||
uint64_t num_devices;
|
||||
struct spdk_nvmf_rdma_device_stat *devices;
|
||||
} rdma;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Function to be called once asynchronous listen add and remove
|
||||
* operations are completed. See spdk_nvmf_subsystem_add_listener()
|
||||
@ -320,18 +285,6 @@ void spdk_nvmf_poll_group_destroy(struct spdk_nvmf_poll_group *group,
|
||||
int spdk_nvmf_poll_group_add(struct spdk_nvmf_poll_group *group,
|
||||
struct spdk_nvmf_qpair *qpair);
|
||||
|
||||
/**
|
||||
* Get current poll group statistics. (deprecated)
|
||||
*
|
||||
* \param tgt The NVMf target.
|
||||
* \param stat Pointer to allocated statistics structure to fill with values.
|
||||
*
|
||||
* \return 0 upon success.
|
||||
* \return -EINVAL if either group or stat is NULL.
|
||||
*/
|
||||
int spdk_nvmf_poll_group_get_stat(struct spdk_nvmf_tgt *tgt,
|
||||
struct spdk_nvmf_poll_group_stat *stat);
|
||||
|
||||
typedef void (*nvmf_qpair_disconnect_cb)(void *ctx);
|
||||
|
||||
/**
|
||||
@ -1130,44 +1083,6 @@ int spdk_nvmf_transport_stop_listen_async(struct spdk_nvmf_transport *transport,
|
||||
spdk_nvmf_tgt_subsystem_listen_done_fn cb_fn,
|
||||
void *cb_arg);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Get current transport poll group statistics. (deprecated)
|
||||
*
|
||||
* Please use the flow with spdk_nvmf_poll_group_dump_stat.
|
||||
*
|
||||
* This function allocates memory for statistics and returns it
|
||||
* in \p stat parameter. Caller must free this memory with
|
||||
* spdk_nvmf_transport_poll_group_free_stat() when it is not needed
|
||||
* anymore.
|
||||
*
|
||||
* \param tgt The NVMf target.
|
||||
* \param transport The NVMf transport.
|
||||
* \param stat Output parameter that will contain pointer to allocated statistics structure.
|
||||
*
|
||||
* \return 0 upon success.
|
||||
* \return -ENOTSUP if transport does not support statistics.
|
||||
* \return -EINVAL if any of parameters is NULL.
|
||||
* \return -ENOENT if transport poll group is not found.
|
||||
* \return -ENOMEM if memory allocation failed.
|
||||
*/
|
||||
int
|
||||
spdk_nvmf_transport_poll_group_get_stat(struct spdk_nvmf_tgt *tgt,
|
||||
struct spdk_nvmf_transport *transport,
|
||||
struct spdk_nvmf_transport_poll_group_stat **stat);
|
||||
|
||||
/**
|
||||
* Free statistics memory previously allocated with spdk_nvmf_transport_poll_group_get_stat(). (deprecated)
|
||||
*
|
||||
* Please use the flow with spdk_nvmf_poll_group_dump_stat.
|
||||
*
|
||||
* \param transport The NVMf transport.
|
||||
* \param stat Pointer to transport poll group statistics structure.
|
||||
*/
|
||||
void
|
||||
spdk_nvmf_transport_poll_group_free_stat(struct spdk_nvmf_transport *transport,
|
||||
struct spdk_nvmf_transport_poll_group_stat *stat);
|
||||
|
||||
/**
|
||||
* Dump poll group statistics into JSON.
|
||||
*
|
||||
|
@ -370,19 +370,6 @@ struct spdk_nvmf_transport_ops {
|
||||
void (*qpair_abort_request)(struct spdk_nvmf_qpair *qpair,
|
||||
struct spdk_nvmf_request *req);
|
||||
|
||||
/*
|
||||
* Get transport poll group statistics. (deprecated)
|
||||
* Please use the flow with spdk_nvmf_poll_group_dump_stat.
|
||||
*/
|
||||
int (*poll_group_get_stat)(struct spdk_nvmf_tgt *tgt,
|
||||
struct spdk_nvmf_transport_poll_group_stat **stat);
|
||||
|
||||
/*
|
||||
* Free transport poll group statistics previously allocated with poll_group_get_stat(). (deprecated)
|
||||
* Please use the flow with spdk_nvmf_poll_group_dump_stat.
|
||||
*/
|
||||
void (*poll_group_free_stat)(struct spdk_nvmf_transport_poll_group_stat *stat);
|
||||
|
||||
/*
|
||||
* Dump transport poll group statistics into JSON.
|
||||
*/
|
||||
|
@ -1620,26 +1620,6 @@ spdk_nvmf_get_optimal_poll_group(struct spdk_nvmf_qpair *qpair)
|
||||
return tgroup->group;
|
||||
}
|
||||
|
||||
int
|
||||
spdk_nvmf_poll_group_get_stat(struct spdk_nvmf_tgt *tgt,
|
||||
struct spdk_nvmf_poll_group_stat *stat)
|
||||
{
|
||||
struct spdk_io_channel *ch;
|
||||
struct spdk_nvmf_poll_group *group;
|
||||
|
||||
SPDK_ERRLOG("spdk_nvmf_poll_group_get_stat is deprecated and will be removed\n");
|
||||
|
||||
if (tgt == NULL || stat == NULL) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ch = spdk_get_io_channel(tgt);
|
||||
group = spdk_io_channel_get_ctx(ch);
|
||||
*stat = group->stat;
|
||||
spdk_put_io_channel(ch);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
spdk_nvmf_poll_group_dump_stat(struct spdk_nvmf_poll_group *group, struct spdk_json_write_ctx *w)
|
||||
{
|
||||
|
@ -4178,86 +4178,6 @@ nvmf_rdma_qpair_abort_request(struct spdk_nvmf_qpair *qpair,
|
||||
_nvmf_rdma_qpair_abort_request(req);
|
||||
}
|
||||
|
||||
/* Deprecated, please use the flow with nvmf_rdma_poll_group_dump_stat. */
|
||||
static int
|
||||
nvmf_rdma_poll_group_get_stat(struct spdk_nvmf_tgt *tgt,
|
||||
struct spdk_nvmf_transport_poll_group_stat **stat)
|
||||
{
|
||||
struct spdk_io_channel *ch;
|
||||
struct spdk_nvmf_poll_group *group;
|
||||
struct spdk_nvmf_transport_poll_group *tgroup;
|
||||
struct spdk_nvmf_rdma_poll_group *rgroup;
|
||||
struct spdk_nvmf_rdma_poller *rpoller;
|
||||
struct spdk_nvmf_rdma_device_stat *device_stat;
|
||||
uint64_t num_devices = 0;
|
||||
|
||||
SPDK_ERRLOG("nvmf_rdma_poll_group_get_stat is deprecated and will be removed\n");
|
||||
|
||||
if (tgt == NULL || stat == NULL) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ch = spdk_get_io_channel(tgt);
|
||||
group = spdk_io_channel_get_ctx(ch);;
|
||||
spdk_put_io_channel(ch);
|
||||
TAILQ_FOREACH(tgroup, &group->tgroups, link) {
|
||||
if (SPDK_NVME_TRANSPORT_RDMA == tgroup->transport->ops->type) {
|
||||
*stat = calloc(1, sizeof(struct spdk_nvmf_transport_poll_group_stat));
|
||||
if (!*stat) {
|
||||
SPDK_ERRLOG("Failed to allocate memory for NVMf RDMA statistics\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
(*stat)->trtype = SPDK_NVME_TRANSPORT_RDMA;
|
||||
|
||||
rgroup = SPDK_CONTAINEROF(tgroup, struct spdk_nvmf_rdma_poll_group, group);
|
||||
/* Count devices to allocate enough memory */
|
||||
TAILQ_FOREACH(rpoller, &rgroup->pollers, link) {
|
||||
++num_devices;
|
||||
}
|
||||
(*stat)->rdma.devices = calloc(num_devices, sizeof(struct spdk_nvmf_rdma_device_stat));
|
||||
if (!(*stat)->rdma.devices) {
|
||||
SPDK_ERRLOG("Failed to allocate NVMf RDMA devices statistics\n");
|
||||
free(*stat);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
(*stat)->rdma.pending_data_buffer = rgroup->stat.pending_data_buffer;
|
||||
(*stat)->rdma.num_devices = num_devices;
|
||||
num_devices = 0;
|
||||
TAILQ_FOREACH(rpoller, &rgroup->pollers, link) {
|
||||
device_stat = &(*stat)->rdma.devices[num_devices++];
|
||||
device_stat->name = ibv_get_device_name(rpoller->device->context->device);
|
||||
device_stat->polls = rpoller->stat.polls;
|
||||
device_stat->idle_polls = rpoller->stat.idle_polls;
|
||||
device_stat->completions = rpoller->stat.completions;
|
||||
device_stat->requests = rpoller->stat.requests;
|
||||
device_stat->request_latency = rpoller->stat.request_latency;
|
||||
device_stat->pending_free_request = rpoller->stat.pending_free_request;
|
||||
device_stat->pending_rdma_read = rpoller->stat.pending_rdma_read;
|
||||
device_stat->pending_rdma_write = rpoller->stat.pending_rdma_write;
|
||||
device_stat->total_send_wrs = rpoller->stat.qp_stats.send.num_submitted_wrs;
|
||||
device_stat->send_doorbell_updates = rpoller->stat.qp_stats.send.doorbell_updates;
|
||||
device_stat->total_recv_wrs = rpoller->stat.qp_stats.recv.num_submitted_wrs;
|
||||
device_stat->recv_doorbell_updates = rpoller->stat.qp_stats.recv.doorbell_updates;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* Deprecated, please use the flow with nvmf_rdma_poll_group_dump_stat. */
|
||||
static void
|
||||
nvmf_rdma_poll_group_free_stat(struct spdk_nvmf_transport_poll_group_stat *stat)
|
||||
{
|
||||
SPDK_ERRLOG("nvmf_rdma_poll_group_free_stat is deprecated and will be removed\n");
|
||||
|
||||
if (stat) {
|
||||
free(stat->rdma.devices);
|
||||
}
|
||||
free(stat);
|
||||
}
|
||||
|
||||
static void
|
||||
nvmf_rdma_poll_group_dump_stat(struct spdk_nvmf_transport_poll_group *group,
|
||||
struct spdk_json_write_ctx *w)
|
||||
@ -4338,8 +4258,6 @@ const struct spdk_nvmf_transport_ops spdk_nvmf_transport_rdma = {
|
||||
.qpair_get_listen_trid = nvmf_rdma_qpair_get_listen_trid,
|
||||
.qpair_abort_request = nvmf_rdma_qpair_abort_request,
|
||||
|
||||
.poll_group_get_stat = nvmf_rdma_poll_group_get_stat,
|
||||
.poll_group_free_stat = nvmf_rdma_poll_group_free_stat,
|
||||
.poll_group_dump_stat = nvmf_rdma_poll_group_dump_stat,
|
||||
};
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
spdk_nvmf_get_optimal_poll_group;
|
||||
spdk_nvmf_poll_group_destroy;
|
||||
spdk_nvmf_poll_group_add;
|
||||
spdk_nvmf_poll_group_get_stat;
|
||||
spdk_nvmf_qpair_disconnect;
|
||||
spdk_nvmf_qpair_get_peer_trid;
|
||||
spdk_nvmf_qpair_get_local_trid;
|
||||
@ -79,8 +78,6 @@
|
||||
spdk_nvmf_transport_listen;
|
||||
spdk_nvmf_transport_stop_listen;
|
||||
spdk_nvmf_transport_stop_listen_async;
|
||||
spdk_nvmf_transport_poll_group_get_stat;
|
||||
spdk_nvmf_transport_poll_group_free_stat;
|
||||
spdk_nvmf_poll_group_dump_stat;
|
||||
spdk_nvmf_rdma_init_hooks;
|
||||
spdk_nvmf_subsystem_set_ana_reporting;
|
||||
|
@ -600,31 +600,6 @@ spdk_nvmf_transport_opts_init(const char *transport_name,
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
spdk_nvmf_transport_poll_group_get_stat(struct spdk_nvmf_tgt *tgt,
|
||||
struct spdk_nvmf_transport *transport,
|
||||
struct spdk_nvmf_transport_poll_group_stat **stat)
|
||||
{
|
||||
SPDK_ERRLOG("spdk_nvmf_transport_poll_group_get_stat is deprecated and will be removed\n");
|
||||
|
||||
if (transport->ops->poll_group_get_stat) {
|
||||
return transport->ops->poll_group_get_stat(tgt, stat);
|
||||
} else {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
spdk_nvmf_transport_poll_group_free_stat(struct spdk_nvmf_transport *transport,
|
||||
struct spdk_nvmf_transport_poll_group_stat *stat)
|
||||
{
|
||||
SPDK_ERRLOG("spdk_nvmf_transport_poll_group_free_stat is deprecated and will be removed\n");
|
||||
|
||||
if (transport->ops->poll_group_free_stat) {
|
||||
transport->ops->poll_group_free_stat(stat);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
spdk_nvmf_request_free_buffers(struct spdk_nvmf_request *req,
|
||||
struct spdk_nvmf_transport_poll_group *group,
|
||||
|
Loading…
Reference in New Issue
Block a user