Commit 523f2a85 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

lib/nvmf: Set up ANA Change Notice



If the ANA reporting feature is enabled for the subsystem,
- set ANA Change Notice of Asynchronous Event Configuration to 1
- set ANA Change Notice of Optional Asynchronus Event Supported to 1
- set ANA Non-Optimized state and ANA Inaccessible state of ANA
  Capability to 1.

ANA Change state is not used and ANA Persistent Loss state is not
supported for now.

The next patch will actually support ANA Change Notice using an new
RPC.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4db2e33dd2879cdf995adcab41ef53728b27a201
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4087


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent c66275c0
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -349,6 +349,9 @@ nvmf_ctrlr_create(struct spdk_nvmf_subsystem *subsystem,
	}

	ctrlr->feat.async_event_configuration.bits.ns_attr_notice = 1;
	if (ctrlr->subsys->ana_reporting) {
		ctrlr->feat.async_event_configuration.bits.ana_change_notice = 1;
	}
	ctrlr->feat.volatile_write_cache.bits.wce = 1;

	if (ctrlr->subsys->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) {
@@ -2076,6 +2079,9 @@ spdk_nvmf_ctrlr_identify_ctrlr(struct spdk_nvmf_ctrlr *ctrlr, struct spdk_nvme_c
			cdata->cmic.ana_reporting = 1;
		}
		cdata->oaes.ns_attribute_notices = 1;
		if (subsystem->ana_reporting) {
			cdata->oaes.ana_change_notices = 1;
		}
		cdata->ctratt.host_id_exhid_supported = 1;
		/* TODO: Concurrent execution of multiple abort commands. */
		cdata->acl = 0;
@@ -2100,7 +2106,12 @@ spdk_nvmf_ctrlr_identify_ctrlr(struct spdk_nvmf_ctrlr *ctrlr, struct spdk_nvme_c
		cdata->oncs.reservations = 1;
		if (subsystem->ana_reporting) {
			cdata->anatt = ANA_TRANSITION_TIME_IN_SEC;
			/* ANA Change state is not used, and ANA Persistent Loss state
			 * is not supported for now.
			 */
			cdata->anacap.ana_optimized_state = 1;
			cdata->anacap.ana_non_optimized_state = 1;
			cdata->anacap.ana_inaccessible_state = 1;
			/* ANAGRPID does not change while namespace is attached to controller */
			cdata->anacap.no_change_anagrpid = 1;
			cdata->anagrpmax = subsystem->max_nsid;