Commit 200f95bf authored by Slawomir Ptak's avatar Slawomir Ptak Committed by Tomasz Zawadzki
Browse files

nvme: TP 8014 - Current Discovery Subsystem



Added support for the Current Discovery Subsystem
value of the Subsystem Type in the Discovery
Log Page Entry.

Change introduced in TP 8014.

Change-Id: Icc2faca6bcd50f1f86f8b2471f538a77c947c311
Signed-off-by: default avatarSlawomir Ptak <slawomir.ptak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19467


Reviewed-by: default avatarJim Harris <jim.harris@gmail.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent d8b4b81a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -52,8 +52,9 @@ print_discovery_log(struct spdk_nvmf_discovery_log_page *log_page)
		       entry->adrfam, spdk_nvme_transport_id_adrfam_str(entry->adrfam));
		printf("Subsystem Type:                        %u (%s)\n",
		       entry->subtype,
		       entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY ? "Discovery Service" :
		       entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY ? "Referral to a Discovery Service" :
		       entry->subtype == SPDK_NVMF_SUBTYPE_NVME ? "NVM Subsystem" :
		       entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY_CURRENT ? "Current Discovery Subsystem" :
		       "Unknown");
		printf("Port ID:                               %" PRIu16 " (0x%04" PRIx16 ")\n",
		       from_le16(&entry->portid), from_le16(&entry->portid));
+7 −1
Original line number Diff line number Diff line
@@ -2530,9 +2530,15 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport
			       entry->adrfam, spdk_nvme_transport_id_adrfam_str(entry->adrfam));
			printf("Subsystem Type:                        %u (%s)\n",
			       entry->subtype,
			       entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY ? "Discovery Service" :
			       entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY ? "Referral to a Discovery Service" :
			       entry->subtype == SPDK_NVMF_SUBTYPE_NVME ? "NVM Subsystem" :
			       entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY_CURRENT ? "Current Discovery Subsystem" :
			       "Unknown");
			printf("Entry Flags:\n");
			printf("  Duplicate Returned Information:			%u\n",
			       !!(entry->eflags & SPDK_NVMF_DISCOVERY_LOG_EFLAGS_DUPRETINFO));
			printf("  Explicit Persistent Connection Support for Discovery: %u\n",
			       !!(entry->eflags & SPDK_NVMF_DISCOVERY_LOG_EFLAGS_EPCSD));
			printf("Transport Requirements:\n");
			printf("  Secure Channel:                      %s\n",
			       entry->treq.secure_channel == SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED ? "Not Specified" :
+16 −4
Original line number Diff line number Diff line
@@ -130,13 +130,22 @@ enum spdk_nvmf_adrfam {
 * NVM subsystem types
 */
enum spdk_nvmf_subtype {
	/** Discovery type for NVM subsystem */
	/** Referral to a Discovery Service */
	SPDK_NVMF_SUBTYPE_DISCOVERY		= 0x1,

	/** NVMe type for NVM subsystem */
	/** NVM Subsystem */
	SPDK_NVMF_SUBTYPE_NVME			= 0x2,

	/** Current Discovery Subsystem */
	SPDK_NVMF_SUBTYPE_DISCOVERY_CURRENT	= 0x3
};

/* Discovery Log Entry Flags - Duplicate Returned Information */
#define SPDK_NVMF_DISCOVERY_LOG_EFLAGS_DUPRETINFO (1u << 0u)

/* Discovery Log Entry Flags - Explicit Persistent Connection Support for Discovery */
#define SPDK_NVMF_DISCOVERY_LOG_EFLAGS_EPCSD (1u << 1u)

/**
 * Connections shall be made over a fabric secure channel
 */
@@ -395,7 +404,10 @@ struct spdk_nvmf_discovery_log_page_entry {
	/** Admin max SQ size */
	uint16_t	asqsz;

	uint8_t		reserved0[22];
	/** Entry Flags */
	uint16_t	eflags;

	uint8_t		reserved0[20];

	/** Transport service identifier */
	uint8_t		trsvcid[SPDK_NVMF_TRSVCID_MAX_LEN];
+4 −2
Original line number Diff line number Diff line
@@ -290,8 +290,10 @@ nvme_fabric_discover_probe(struct spdk_nvmf_discovery_log_page_entry *entry,

	memset(&trid, 0, sizeof(trid));

	if (entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) {
		SPDK_WARNLOG("Skipping unsupported discovery service referral\n");
	if (entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY_CURRENT ||
	    entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) {
		SPDK_WARNLOG("Skipping unsupported current discovery service or"
			     " discovery service referral\n");
		return;
	} else if (entry->subtype != SPDK_NVMF_SUBTYPE_NVME) {
		SPDK_WARNLOG("Skipping unknown subtype %u\n", entry->subtype);
+2 −1
Original line number Diff line number Diff line
@@ -6440,7 +6440,8 @@ discovery_log_page_cb(void *cb_arg, int rc, const struct spdk_nvme_cpl *cpl,
	for (i = 0; i < numrec; i++) {
		found = false;
		new_entry = &log_page->entries[i];
		if (new_entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) {
		if (new_entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY_CURRENT ||
		    new_entry->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) {
			struct discovery_entry_ctx *new_ctx;
			struct spdk_nvme_transport_id trid = {};

Loading