nvmf: support oacs in cdata_init callback
Later, we'll advertise shadow doorbell support; add this to the ->cdata_init() callback. Signed-off-by: John Levon <john.levon@nutanix.com> Change-Id: Id00ba82508b323902493fe108d7a2561e8c859cc Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11785 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
f25c4c822c
commit
7d8bbf0007
@ -1872,6 +1872,40 @@ struct spdk_nvme_cdata_oncs {
|
|||||||
uint16_t reserved9: 7;
|
uint16_t reserved9: 7;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct spdk_nvme_cdata_oacs {
|
||||||
|
/* supports security send/receive commands */
|
||||||
|
uint16_t security : 1;
|
||||||
|
|
||||||
|
/* supports format nvm command */
|
||||||
|
uint16_t format : 1;
|
||||||
|
|
||||||
|
/* supports firmware activate/download commands */
|
||||||
|
uint16_t firmware : 1;
|
||||||
|
|
||||||
|
/* supports ns manage/ns attach commands */
|
||||||
|
uint16_t ns_manage : 1;
|
||||||
|
|
||||||
|
/** Supports device self-test command (SPDK_NVME_OPC_DEVICE_SELF_TEST) */
|
||||||
|
uint16_t device_self_test : 1;
|
||||||
|
|
||||||
|
/** Supports SPDK_NVME_OPC_DIRECTIVE_SEND and SPDK_NVME_OPC_DIRECTIVE_RECEIVE */
|
||||||
|
uint16_t directives : 1;
|
||||||
|
|
||||||
|
/** Supports NVMe-MI (SPDK_NVME_OPC_NVME_MI_SEND, SPDK_NVME_OPC_NVME_MI_RECEIVE) */
|
||||||
|
uint16_t nvme_mi : 1;
|
||||||
|
|
||||||
|
/** Supports SPDK_NVME_OPC_VIRTUALIZATION_MANAGEMENT */
|
||||||
|
uint16_t virtualization_management : 1;
|
||||||
|
|
||||||
|
/** Supports SPDK_NVME_OPC_DOORBELL_BUFFER_CONFIG */
|
||||||
|
uint16_t doorbell_buffer_config : 1;
|
||||||
|
|
||||||
|
/** Supports SPDK_NVME_OPC_GET_LBA_STATUS */
|
||||||
|
uint16_t get_lba_status : 1;
|
||||||
|
|
||||||
|
uint16_t oacs_rsvd : 6;
|
||||||
|
};
|
||||||
|
|
||||||
struct __attribute__((packed)) spdk_nvme_ctrlr_data {
|
struct __attribute__((packed)) spdk_nvme_ctrlr_data {
|
||||||
/* bytes 0-255: controller capabilities and features */
|
/* bytes 0-255: controller capabilities and features */
|
||||||
|
|
||||||
@ -1966,39 +2000,7 @@ struct __attribute__((packed)) spdk_nvme_ctrlr_data {
|
|||||||
/* bytes 256-511: admin command set attributes */
|
/* bytes 256-511: admin command set attributes */
|
||||||
|
|
||||||
/** optional admin command support */
|
/** optional admin command support */
|
||||||
struct {
|
struct spdk_nvme_cdata_oacs oacs;
|
||||||
/* supports security send/receive commands */
|
|
||||||
uint16_t security : 1;
|
|
||||||
|
|
||||||
/* supports format nvm command */
|
|
||||||
uint16_t format : 1;
|
|
||||||
|
|
||||||
/* supports firmware activate/download commands */
|
|
||||||
uint16_t firmware : 1;
|
|
||||||
|
|
||||||
/* supports ns manage/ns attach commands */
|
|
||||||
uint16_t ns_manage : 1;
|
|
||||||
|
|
||||||
/** Supports device self-test command (SPDK_NVME_OPC_DEVICE_SELF_TEST) */
|
|
||||||
uint16_t device_self_test : 1;
|
|
||||||
|
|
||||||
/** Supports SPDK_NVME_OPC_DIRECTIVE_SEND and SPDK_NVME_OPC_DIRECTIVE_RECEIVE */
|
|
||||||
uint16_t directives : 1;
|
|
||||||
|
|
||||||
/** Supports NVMe-MI (SPDK_NVME_OPC_NVME_MI_SEND, SPDK_NVME_OPC_NVME_MI_RECEIVE) */
|
|
||||||
uint16_t nvme_mi : 1;
|
|
||||||
|
|
||||||
/** Supports SPDK_NVME_OPC_VIRTUALIZATION_MANAGEMENT */
|
|
||||||
uint16_t virtualization_management : 1;
|
|
||||||
|
|
||||||
/** Supports SPDK_NVME_OPC_DOORBELL_BUFFER_CONFIG */
|
|
||||||
uint16_t doorbell_buffer_config : 1;
|
|
||||||
|
|
||||||
/** Supports SPDK_NVME_OPC_GET_LBA_STATUS */
|
|
||||||
uint16_t get_lba_status : 1;
|
|
||||||
|
|
||||||
uint16_t oacs_rsvd : 6;
|
|
||||||
} oacs;
|
|
||||||
|
|
||||||
/** abort command limit */
|
/** abort command limit */
|
||||||
uint8_t acl;
|
uint8_t acl;
|
||||||
|
@ -203,6 +203,7 @@ struct spdk_nvmf_ctrlr_data {
|
|||||||
uint16_t ssvid;
|
uint16_t ssvid;
|
||||||
/** ieee oui identifier */
|
/** ieee oui identifier */
|
||||||
uint8_t ieee[3];
|
uint8_t ieee[3];
|
||||||
|
struct spdk_nvme_cdata_oacs oacs;
|
||||||
struct spdk_nvme_cdata_oncs oncs;
|
struct spdk_nvme_cdata_oncs oncs;
|
||||||
struct spdk_nvme_cdata_sgls sgls;
|
struct spdk_nvme_cdata_sgls sgls;
|
||||||
struct spdk_nvme_cdata_nvmf_specific nvmf_specific;
|
struct spdk_nvme_cdata_nvmf_specific nvmf_specific;
|
||||||
|
@ -2611,6 +2611,8 @@ static void
|
|||||||
nvmf_ctrlr_populate_oacs(struct spdk_nvmf_ctrlr *ctrlr,
|
nvmf_ctrlr_populate_oacs(struct spdk_nvmf_ctrlr *ctrlr,
|
||||||
struct spdk_nvme_ctrlr_data *cdata)
|
struct spdk_nvme_ctrlr_data *cdata)
|
||||||
{
|
{
|
||||||
|
cdata->oacs = ctrlr->cdata.oacs;
|
||||||
|
|
||||||
cdata->oacs.virtualization_management =
|
cdata->oacs.virtualization_management =
|
||||||
g_nvmf_custom_admin_cmd_hdlrs[SPDK_NVME_OPC_VIRTUALIZATION_MANAGEMENT].hdlr != NULL;
|
g_nvmf_custom_admin_cmd_hdlrs[SPDK_NVME_OPC_VIRTUALIZATION_MANAGEMENT].hdlr != NULL;
|
||||||
cdata->oacs.nvme_mi = g_nvmf_custom_admin_cmd_hdlrs[SPDK_NVME_OPC_NVME_MI_SEND].hdlr != NULL
|
cdata->oacs.nvme_mi = g_nvmf_custom_admin_cmd_hdlrs[SPDK_NVME_OPC_NVME_MI_SEND].hdlr != NULL
|
||||||
|
Loading…
Reference in New Issue
Block a user