Commit 2eda8390 authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

nvmf/ctrlr: abort cmd for set features with save bit set



Features are not saveable by the controller as indicated
by ONCS field of the Identify Controller data.

Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I7e5bc2c701f5857e2c1481e8370b070089f88111
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479128


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 5d541746
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -1928,10 +1928,21 @@ spdk_nvmf_ctrlr_get_features(struct spdk_nvmf_request *req)
static int
spdk_nvmf_ctrlr_set_features(struct spdk_nvmf_request *req)
{
	uint8_t feature;
	uint8_t feature, save;
	struct spdk_nvme_cmd *cmd = &req->cmd->nvme_cmd;
	struct spdk_nvme_cpl *response = &req->rsp->nvme_cpl;

	/*
	 * Features are not saveable by the controller as indicated by
	 * ONCS field of the Identify Controller data.
	 * */
	save = cmd->cdw10_bits.set_features.sv;
	if (save) {
		response->status.sc = SPDK_NVME_SC_FEATURE_ID_NOT_SAVEABLE;
		response->status.sct = SPDK_NVME_SCT_COMMAND_SPECIFIC;
		return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
	}

	feature = cmd->cdw10_bits.set_features.fid;
	switch (feature) {
	case SPDK_NVME_FEAT_ARBITRATION: