diff --git a/CHANGELOG.md b/CHANGELOG.md index 59e61b999..58a3b736b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/deprecation.md b/deprecation.md index a92effb0d..94cc4de35 100644 --- a/deprecation.md +++ b/deprecation.md @@ -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` diff --git a/include/spdk/nvmf.h b/include/spdk/nvmf.h index 491fc48d6..47bfb28a3 100644 --- a/include/spdk/nvmf.h +++ b/include/spdk/nvmf.h @@ -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. diff --git a/lib/nvmf/nvmf.c b/lib/nvmf/nvmf.c index 5895276b1..72597dd8c 100644 --- a/lib/nvmf/nvmf.c +++ b/lib/nvmf/nvmf.c @@ -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);