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: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I7e5bc2c701f5857e2c1481e8370b070089f88111
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479128
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jacek Kalwas 2020-01-07 00:09:56 +01:00 committed by Tomasz Zawadzki
parent 5d541746f3
commit 2eda83904b

View File

@ -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: