Commit 78a794b9 authored by Krishna Kanth Reddy's avatar Krishna Kanth Reddy Committed by Tomasz Zawadzki
Browse files

examples/identify: Identification of Simple Copy Command support



Signed-off-by: default avatarKrishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I251f3b1a6c7e36b946ddc8bd8a07b0f588e23c9e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7693


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent b549f411
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1027,6 +1027,12 @@ print_namespace(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ns *ns)
		printf("  Atomic Boundary Offset:              %d\n", nsdata->nabo);
	}

	if (cdata->oncs.copy) {
		printf("Maximum Single Source Range Length:    %d\n", nsdata->mssrl);
		printf("Maximum Copy Length:                   %d\n", nsdata->mcl);
		printf("Maximum Source Range Count:            %d\n", nsdata->msrc + 1);
	}

	printf("NGUID/EUI64 Never Reused:              %s\n",
	       nsdata->nsfeat.guid_never_reused ? "Yes" : "No");

@@ -1463,6 +1469,8 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport
	       cdata->oncs.reservations ? "Supported" : "Not Supported");
	printf("Timestamp:                   %s\n",
	       cdata->oncs.timestamp ? "Supported" : "Not Supported");
	printf("Copy:                        %s\n",
	       cdata->oncs.copy ? "Supported" : "Not Supported");
	printf("Volatile Write Cache:        %s\n",
	       cdata->vwc.present ? "Present" : "Not Present");
	printf("Atomic Write Unit (Normal):  %d\n", cdata->awun + 1);
+37 −3
Original line number Diff line number Diff line
@@ -1338,6 +1338,21 @@ struct spdk_nvme_dsm_range {
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_dsm_range) == 16, "Incorrect size");

/**
 * Simple Copy Command source range
 */
struct spdk_nvme_scc_source_range {
	uint64_t reserved0;
	uint64_t slba;
	uint16_t nlb;
	uint16_t reserved18;
	uint32_t reserved20;
	uint32_t eilbrt;
	uint16_t elbat;
	uint16_t elbatm;
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_scc_source_range) == 32, "Incorrect size");

/**
 * Status code types
 */
@@ -1443,6 +1458,7 @@ enum spdk_nvme_command_specific_status_code {
	SPDK_NVME_SC_CONFLICTING_ATTRIBUTES		= 0x80,
	SPDK_NVME_SC_INVALID_PROTECTION_INFO		= 0x81,
	SPDK_NVME_SC_ATTEMPTED_WRITE_TO_RO_RANGE	= 0x82,
	SPDK_NVME_SC_CMD_SIZE_LIMIT_SIZE_EXCEEDED	= 0x83,
};

/**
@@ -1539,6 +1555,8 @@ enum spdk_nvme_nvm_opcode {

	SPDK_NVME_OPC_RESERVATION_ACQUIRE		= 0x11,
	SPDK_NVME_OPC_RESERVATION_RELEASE		= 0x15,

	SPDK_NVME_OPC_COPY				= 0x19,
};

/**
@@ -2149,7 +2167,9 @@ struct __attribute__((packed)) __attribute__((aligned)) spdk_nvme_ctrlr_data {
		uint16_t	set_features_save: 1;
		uint16_t	reservations: 1;
		uint16_t	timestamp: 1;
		uint16_t	reserved: 9;
		uint16_t	verify: 1;
		uint16_t	copy: 1;
		uint16_t	reserved9: 7;
	} oncs;

	/** fused operation support */
@@ -2187,7 +2207,12 @@ struct __attribute__((packed)) __attribute__((aligned)) spdk_nvme_ctrlr_data {
	/** atomic compare & write unit */
	uint16_t		acwu;

	uint16_t		reserved534;
	/** optional copy formats supported */
	struct {
		uint16_t	copy_format0 : 1;
		uint16_t	reserved1: 15;
	} ocfs;


	struct spdk_nvme_cdata_sgls sgls;

@@ -2479,7 +2504,16 @@ struct spdk_nvme_ns_data {
	/** Namespace Optimal Write Size */
	uint16_t                nows;

	uint8_t			reserved64[18];
	/** Maximum Single Source Range Length */
	uint16_t                mssrl;

	/** Maximum Copy Length */
	uint32_t                mcl;

	/** Maximum Source Range Count */
	uint8_t	                msrc;

	uint8_t			reserved64[11];

	/** ANA group identifier */
	uint32_t		anagrpid;
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@ function confirm_abi_deps() {
	fi

	cat << EOF > ${suppression_file}
[suppress_type]
	name = spdk_nvme_ns_data
[suppress_type]
	name = spdk_nvme_ctrlr_data
EOF

	for object in "$libdir"/libspdk_*.so; do