Commit 0de1c215 authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Ben Walker
Browse files

lib/nvmf: Deprecate cb_fn in spdk_nvmf_qpair_disconnect



Handling this callback is quite complex and may lead to
various problems. In most of places, the actual event
when qpair is dosconnected is not importnat for the
app logic. Only in shutdown path we need to be sure
that all qpairs are disconnected, it can be achieved
by checking poll_group::qpairs list

Signed-off-by: default avatarAlexey Marchuk <alexeymar@nvidia.com>
Change-Id: I453961299f67342c1193dc622685aefb46bfceb6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17165


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarMichael Haeuptle <michaelhaeuptle@gmail.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent d478b20d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ Two functions related to Asynchronous Event and error handling have been made pu
-	`spdk_nvmf_ctrlr_async_event_error_event`,
-	`spdk_nvmf_ctrlr_abort_aer`.

Parameters `cb_fn` and `ctx` of `spdk_nvmf_qpair_disconnect` API are deprecated. These parameters
will be removed in 23.09 release.

### nvme

New API `spdk_nvme_ns_get_format_index` was added to calculate the exact format index, that
+7 −0
Original line number Diff line number Diff line
@@ -53,6 +53,13 @@ then.
Deprecated `spdk_nvme_ctrlr_prepare_for_reset` API, which will be removed in SPDK 22.01.
For PCIe transport, `spdk_nvme_ctrlr_disconnect` should be used before freeing I/O qpairs.

### nvmf

#### `spdk_nvmf_qpair_disconnect`

Parameters `cb_fn` and `ctx` of `spdk_nvmf_qpair_disconnect` API are deprecated. These parameters
will be removed in 23.09 release.

### gpt

#### `old_gpt_guid`
+2 −2
Original line number Diff line number Diff line
@@ -291,8 +291,8 @@ typedef void (*nvmf_qpair_disconnect_cb)(void *ctx);
 * Disconnect an NVMe-oF qpair
 *
 * \param qpair The NVMe-oF qpair to disconnect.
 * \param cb_fn The function to call upon completion of the disconnect.
 * \param ctx The context to pass to the callback function.
 * \param cb_fn Deprecated, will be removed in v23.09. The function to call upon completion of the disconnect.
 * \param ctx Deprecated, will be removed in v23.09. The context to pass to the callback function.
 *
 * \return 0 upon success.
 * \return -ENOMEM if the function specific context could not be allocated.
+7 −0
Original line number Diff line number Diff line
@@ -1242,6 +1242,9 @@ _nvmf_qpair_disconnect_msg(void *ctx)
	free(ctx);
}

SPDK_LOG_DEPRECATION_REGISTER(spdk_nvmf_qpair_disconnect, "cb_fn and ctx are deprecated", "v23.09",
			      0);

int
spdk_nvmf_qpair_disconnect(struct spdk_nvmf_qpair *qpair, nvmf_qpair_disconnect_cb cb_fn, void *ctx)
{
@@ -1252,6 +1255,10 @@ spdk_nvmf_qpair_disconnect(struct spdk_nvmf_qpair *qpair, nvmf_qpair_disconnect_
		return -EINPROGRESS;
	}

	if (cb_fn || ctx) {
		SPDK_LOG_DEPRECATED(spdk_nvmf_qpair_disconnect);
	}

	/* If we get a qpair in the uninitialized state, we can just destroy it immediately */
	if (qpair->state == SPDK_NVMF_QPAIR_UNINITIALIZED) {
		nvmf_transport_qpair_fini(qpair, NULL, NULL);