Commit 096538c8 authored by Abhineet Pandey's avatar Abhineet Pandey Committed by Tomasz Zawadzki
Browse files

lib/nvmf: Make set cntlid range API public



This change adds public API 'spdk_nvmf_subsystem_set_cntlid_range' replacing
the internal function 'nvmf_subsystem_set_cntlid_range'. No changes have
been done to the implementation of the mentioned function.

Change-Id: If8c4f9256978b4f54c00a6d2d2188255498a6ce1
Signed-off-by: default avatarAbhineet Pandey <abhineet.pandey@nutanix.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23058


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
parent a6f14a12
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@

## v24.09: (Upcoming Release)

### nvmf

Added public API 'spdk_nvmf_subsystem_set_cntlid_range' to set controller ID
range for a subsystem.

## v24.05

### accel
+15 −1
Original line number Diff line number Diff line
@@ -935,12 +935,26 @@ void spdk_nvmf_subsystem_set_ana_state(struct spdk_nvmf_subsystem *subsystem,
 * \return 0 on success, or negated errno value on failure.
 *
 */

int spdk_nvmf_subsystem_get_ana_state(struct spdk_nvmf_subsystem *subsystem,
				      const struct spdk_nvme_transport_id *trid,
				      uint32_t anagrpid,
				      enum spdk_nvme_ana_state *ana_state);

/**
 * Sets the controller ID range for a subsystem.
 *
 * Valid range is [1, 0xFFEF].
 * May only be performed on subsystems in the INACTIVE state.
 *
 * \param subsystem Subsystem to modify.
 * \param min_cntlid Minimum controller ID.
 * \param max_cntlid Maximum controller ID.
 *
 * \return 0 on success, or negated errno value on failure.
 */
int spdk_nvmf_subsystem_set_cntlid_range(struct spdk_nvmf_subsystem *subsystem,
		uint16_t min_cntlid, uint16_t max_cntlid);

/** NVMe-oF target namespace creation options */
struct spdk_nvmf_ns_opts {
	/**
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

SO_VER := 18
SO_MINOR := 0
SO_MINOR := 1

C_SRCS = ctrlr.c ctrlr_discovery.c ctrlr_bdev.c \
	 subsystem.c nvmf.c nvmf_rpc.c transport.c tcp.c \
+0 −15
Original line number Diff line number Diff line
@@ -435,21 +435,6 @@ void nvmf_transport_dump_opts(struct spdk_nvmf_transport *transport, struct spdk
void nvmf_transport_listen_dump_trid(const struct spdk_nvme_transport_id *trid,
				     struct spdk_json_write_ctx *w);

/**
 * Sets the controller ID range for a subsystem.
 * Valid range is [1, 0xFFEF].
 *
 * May only be performed on subsystems in the INACTIVE state.
 *
 * \param subsystem Subsystem to modify.
 * \param min_cntlid Minimum controller ID.
 * \param max_cntlid Maximum controller ID.
 *
 * \return 0 on success, or negated errno value on failure.
 */
int nvmf_subsystem_set_cntlid_range(struct spdk_nvmf_subsystem *subsystem,
				    uint16_t min_cntlid, uint16_t max_cntlid);

int nvmf_ctrlr_async_event_ns_notice(struct spdk_nvmf_ctrlr *ctrlr);
int nvmf_ctrlr_async_event_ana_change_notice(struct spdk_nvmf_ctrlr *ctrlr);
void nvmf_ctrlr_async_event_discovery_log_change_notice(void *ctx);
+1 −1
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ rpc_nvmf_create_subsystem(struct spdk_jsonrpc_request *request,

	spdk_nvmf_subsystem_set_ana_reporting(subsystem, req->ana_reporting);

	if (nvmf_subsystem_set_cntlid_range(subsystem, req->min_cntlid, req->max_cntlid)) {
	if (spdk_nvmf_subsystem_set_cntlid_range(subsystem, req->min_cntlid, req->max_cntlid)) {
		SPDK_ERRLOG("Subsystem %s: invalid cntlid range [%u-%u]\n", req->nqn, req->min_cntlid,
			    req->max_cntlid);
		spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
Loading