Commit f550b44f authored by Marcin Spiewak's avatar Marcin Spiewak Committed by Jim Harris
Browse files

bdev/nvme: deprecation notice - inconsistent ctrl config



All controllers created with the same name shall be configured either
for multipath or for failover. Otherwise we have configuration mismatch.
Support for configuration, where some controllers with the same name
are configured for multipath while others for failover, will be
deprecated in 25.01.
There is also planned default mode change in SPDK release 25.01:
if no '-x' option will be specified in bdev_nvme_attach_controller
RPC call, the multipath mode will be assigned as a default.

Change-Id: I01035a1989f18a995d620c6463101196f293e638
Signed-off-by: default avatarMarcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24899


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
parent 4a62ec38
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -26,6 +26,18 @@ The tags can be matched with the level 4 headers below.
This callback is now deprecated and will be removed in the v25.01 release.  Please use the append
API (`append_crc32c`, `finish_sequence`, `reverse_sequence`, `abort_sequence`) instead.

#### `multipath_config` `failover_config`

All controllers created with the same name shall be configured either for multipath or for failover.
Otherwise we have configuration mismatch. Currently, using bdev_nvme_attach_controller RPC call, it
is possible to create multiple controllers with the same name but different '-x' options. Starting
from 25.01 we are going to perform controller configuration consistency check, and all controllers
created with the same name will be forced to have consistent setting, either '-x multipath' or
'-x failover'. No mixing of '-x' options will be allowed.
Please also note there is planned default mode change in SPDK release 25.01: if no '-x' option will
be specified in bdev_nvme_attach_controller RPC call, the multipath mode will be assigned
as a default.

### gpt

#### `old_gpt_guid`
+34 −0
Original line number Diff line number Diff line
@@ -5550,11 +5550,15 @@ bdev_nvme_check_multipath(struct nvme_bdev_ctrlr *nbdev_ctrlr, struct spdk_nvme_
	return true;
}

SPDK_LOG_DEPRECATION_REGISTER(multipath_config,
			      "bdev_nvme_attach_controller.multipath configuration mismatch", "v25.01", 0);

static int
nvme_bdev_ctrlr_create(const char *name, struct nvme_ctrlr *nvme_ctrlr)
{
	struct nvme_bdev_ctrlr *nbdev_ctrlr;
	struct spdk_nvme_ctrlr *ctrlr = nvme_ctrlr->ctrlr;
	struct nvme_ctrlr      *nctrlr;
	int rc = 0;

	pthread_mutex_lock(&g_bdev_nvme_mutex);
@@ -5565,6 +5569,21 @@ nvme_bdev_ctrlr_create(const char *name, struct nvme_ctrlr *nvme_ctrlr)
			rc = -EINVAL;
			goto exit;
		}
		TAILQ_FOREACH(nctrlr, &nbdev_ctrlr->ctrlrs, tailq) {
			if (nctrlr->opts.multipath != nvme_ctrlr->opts.multipath) {
				/* All controllers created with the same name must be configured either
				 * for multipath or for failover. Otherwise we have configuration mismatch.
				 * While this is currently still supported, support for configuration where some
				 * controllers with the same name are configured for multipath, while others
				 * are configured for failover will be removed in release 25.01.
				 * Default mode change: starting from SPDK 25.01, if the user will not provide
				 * '-x <mode>' parameter in the bdev_nvme_attach_controller RPC call, default
				 * mode assigned to the controller will be 'multipath'
				 */
				SPDK_LOG_DEPRECATED(multipath_config);
				break;
			}
		}
	} else {
		nbdev_ctrlr = calloc(1, sizeof(*nbdev_ctrlr));
		if (nbdev_ctrlr == NULL) {
@@ -6180,6 +6199,9 @@ connect_attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	}
}

SPDK_LOG_DEPRECATION_REGISTER(failover_config,
			      "bdev_nvme_attach_controller.failover configuration mismatch", "v25.01", 0);

static void
connect_set_failover_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
			struct spdk_nvme_ctrlr *ctrlr,
@@ -6195,6 +6217,18 @@ connect_set_failover_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,

	nvme_ctrlr = nvme_ctrlr_get_by_name(ctx->base_name);
	if (nvme_ctrlr) {
		if (nvme_ctrlr->opts.multipath) {
			/* All controllers created with the same name must be configured either
			 * for multipath or for failover. Otherwise we have configuration mismatch.
			 * While this is currently still supported, support for configuration where some
			 * controllers with the same name are configured for multipath, while others
			 * are configured for failover will be removed in release 25.01.
			 * Default mode change: starting from SPDK 25.01, if the user will not provide
			 * '-x <mode>' parameter in the bdev_nvme_attach_controller RPC call, default
			 * mode assigned to the controller will be 'multipath'
			 */
			SPDK_LOG_DEPRECATED(failover_config);
		}
		rc = bdev_nvme_add_secondary_trid(nvme_ctrlr, ctrlr, &ctx->trid);
	} else {
		rc = -ENODEV;