lib/nvme: fallback to NVM when then given command_set is not supported
When the user requests a non-default command set configuration, via the probe_cb() supplied to spdk_nvme_probe(), which is not supported, then the controller initialization will not proceed. This patch changes that behavior into falling back to the NVM command set and continue with the controller initialization. It is done by assigning the NVM command set to opts.command_set such that the user knows in attach_cb() with which command_set the controller is configured/enabled. The fallback is needed since the user does not have access to the controller capabilities register. The strategy left for the user is thus to try. However, this is an issue, as the user only has one attempt, as subsequent calls to spdk_nvme_probe() will not trigger probe_cb() for the controllers whose initialization did not proceed. Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com> Change-Id: Ia414628fcd7d56956649647775462e62d98c0a90 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2931 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
7ff9609f3d
commit
ae6c40a4a5
@ -901,7 +901,8 @@ nvme_ctrlr_enable(struct spdk_nvme_ctrlr *ctrlr)
|
||||
if (!(ctrlr->cap.bits.css & (1u << ctrlr->opts.command_set))) {
|
||||
SPDK_DEBUGLOG(SPDK_LOG_NVME, "Requested I/O command set %u but supported mask is 0x%x\n",
|
||||
ctrlr->opts.command_set, ctrlr->cap.bits.css);
|
||||
return -EINVAL;
|
||||
SPDK_DEBUGLOG(SPDK_LOG_NVME, "Falling back to NVM. Assuming NVM is supported.\n");
|
||||
ctrlr->opts.command_set = SPDK_NVME_CC_CSS_NVM;
|
||||
}
|
||||
|
||||
cc.bits.css = ctrlr->opts.command_set;
|
||||
|
Loading…
Reference in New Issue
Block a user