Commit c97eb5ec authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

lib/nvmf: removed deprecated stats API



Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6e89e7a6b723745517cee077facad134692044d3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8899


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent 0ac1bd07
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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
+0 −12
Original line number Diff line number Diff line
@@ -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,
+0 −85
Original line number Diff line number Diff line
@@ -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.
 *
+0 −13
Original line number Diff line number Diff line
@@ -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.
	 */
+0 −20
Original line number Diff line number Diff line
@@ -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)
{
Loading