+4
−0
+24
−1
Loading
Since namespace types were introduced in NVMe, the CC.CSS register has a new value (SPDK_NVME_CC_CSS_IOCS) which indicates that all supported command sets should be selected/enabled. This possibly includes command sets other than NVM and ADMIN only. Therefore, if a SPDK application wants enable all the command sets that the controller supports, it has to explicitly set opts->command_set to SPDK_NVME_CC_CSS_IOCS. To avoid possibly a lot of SPDK applications having to set this parameter, check if the user requested a command set explicitly, if not, make SPDK automatically use the most reasonable default, based on the supported bits set by the controller. The most common case is that you want to enable (all) the command sets that the controller supports. A user will still be able to restrict the controller to only use the NVM command set (or ADMIN only), by setting opts->command_set to a specific value. Since the current default command set value specified by spdk_nvme_ctrlr_get_default_ctrlr_opts() is SPDK_NVME_CC_CSS_NVM, which is defined as 0, we cannot know if the user specified a command set explicitly or not. To solve this, change the default command set value specified by spdk_nvme_ctrlr_get_default_ctrlr_opts() to CHAR_BIT (0x8), which is larger than the largest value that can be set in CS.CSS (which is only 3 bits wide, thus 0x7). Signed-off-by:Niklas Cassel <niklas.cassel@wdc.com> Change-Id: I45ec148d3667ab87c41fbfb6d6612a1e0e5c9d9c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4701 Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by:
Jim Harris <james.r.harris@intel.com> Reviewed-by:
Ben Walker <benjamin.walker@intel.com> Reviewed-by:
Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>