Commit 6ee9cd25 authored by kyuho.son's avatar kyuho.son Committed by Tomasz Zawadzki
Browse files

nvmf: Add CNTRLTYPE to the response for identify controller command



Introduced the Controller Type (CNTRLTYPE) field to specify the controller type.
This update aligns with the requirement that implementations compliant with
Revision 1.4 or later must report a controller type. Previous specification versions
allowed the reporting value of 0h when the controller type is not reported.

Change-Id: I900f64f0f334c2bcf93e0bf6edd9071b0077b8f7
Signed-off-by: default avatarkyuho.son <kyuho.son@samsung.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23310


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 8ee34f93
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
/*   SPDX-License-Identifier: BSD-3-Clause
 *   Copyright (C) 2015 Intel Corporation.
 *   All rights reserved.
 *   Copyright (C) 2015 Intel Corporation. All rights reserved.
 *   Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.
 */

/**
@@ -4369,6 +4369,21 @@ struct spdk_nvme_ns_streams_status {
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_ns_streams_status) == 131072, "Incorrect size");

enum spdk_nvme_ctrlr_type {
	/* 0x00 - reserved */

	/* I/O Controller */
	SPDK_NVME_CTRLR_IO		= 0x1,

	/* Discovery Controller */
	SPDK_NVME_CTRLR_DISCOVERY	= 0x2,

	/* Administrative Controller */
	SPDK_NVME_CTRLR_ADMINISTRATIVE	= 0x3,

	/* 0x4-0xFF - Reserved */
};

#define spdk_nvme_cpl_is_error(cpl)			\
	((cpl)->status.sc != SPDK_NVME_SC_SUCCESS ||	\
	 (cpl)->status.sct != SPDK_NVME_SCT_GENERIC)
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
 *   Copyright (C) 2017 Intel Corporation. All rights reserved.
 *   Copyright (c) 2019, 2020 Mellanox Technologies LTD. All rights reserved.
 *   Copyright (c) 2021, 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 *   Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.
 */

#include "spdk/stdinc.h"
@@ -2837,6 +2838,7 @@ spdk_nvmf_ctrlr_identify_ctrlr(struct spdk_nvmf_ctrlr *ctrlr, struct spdk_nvme_c
		 * NVM Discovery subsystem fields
		 */
		cdata->oaes.discovery_log_change_notices = 1;
		cdata->cntrltype = SPDK_NVME_CTRLR_DISCOVERY;
	} else {
		cdata->vid = ctrlr->cdata.vid;
		cdata->ssvid = ctrlr->cdata.ssvid;
@@ -2857,6 +2859,7 @@ spdk_nvmf_ctrlr_identify_ctrlr(struct spdk_nvmf_ctrlr *ctrlr, struct spdk_nvme_c
		cdata->oaes.ns_attribute_notices = 1;
		cdata->ctratt.bits.host_id_exhid_supported = 1;
		cdata->ctratt.bits.fdps = ctrlr->subsys->fdp_supported;
		cdata->cntrltype = SPDK_NVME_CTRLR_IO;
		/* We do not have any actual limitation to the number of abort commands.
		 * We follow the recommendation by the NVMe specification.
		 */