nvme: Add getting supported flag for controllers
New API added for upper level to get controllers' supported flags. Change-Id: I51e9d0e57c355fa37f092602a94f4c08deb8898c Signed-off-by: Chunyang Hui <chunyang.hui@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446091 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
d92a1fb4ac
commit
51ab378862
@ -11,6 +11,8 @@ spdk_app_start() now only accepts a single context argument.
|
|||||||
Added asynchronous probe support. New APIs spdk_nvme_probe_async() and
|
Added asynchronous probe support. New APIs spdk_nvme_probe_async() and
|
||||||
spdk_nvme_probe_poll_async() were added to enable this feature.
|
spdk_nvme_probe_poll_async() were added to enable this feature.
|
||||||
|
|
||||||
|
New API spdk_nvme_ctrlr_get_flags() was added.
|
||||||
|
|
||||||
### raid
|
### raid
|
||||||
|
|
||||||
Added new strip_size_kb rpc param on create to replace the more ambiguous
|
Added new strip_size_kb rpc param on create to replace the more ambiguous
|
||||||
|
@ -308,6 +308,16 @@ struct spdk_nvme_host_id {
|
|||||||
char hostsvcid[SPDK_NVMF_TRSVCID_MAX_LEN + 1];
|
char hostsvcid[SPDK_NVMF_TRSVCID_MAX_LEN + 1];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Controller support flags
|
||||||
|
*
|
||||||
|
* Used for identifying if the controller supports these flags.
|
||||||
|
*/
|
||||||
|
enum spdk_nvme_ctrlr_flags {
|
||||||
|
SPDK_NVME_CTRLR_SGL_SUPPORTED = 0x1, /**< The SGL is supported */
|
||||||
|
SPDK_NVME_CTRLR_SECURITY_SEND_RECV_SUPPORTED = 0x2, /**< security send/receive is supported */
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the string representation of a transport ID.
|
* Parse the string representation of a transport ID.
|
||||||
*
|
*
|
||||||
@ -1309,6 +1319,15 @@ int spdk_nvme_ctrlr_security_receive(struct spdk_nvme_ctrlr *ctrlr, uint8_t secp
|
|||||||
int spdk_nvme_ctrlr_security_send(struct spdk_nvme_ctrlr *ctrlr, uint8_t secp,
|
int spdk_nvme_ctrlr_security_send(struct spdk_nvme_ctrlr *ctrlr, uint8_t secp,
|
||||||
uint16_t spsp, uint8_t nssf, void *payload, size_t size);
|
uint16_t spsp, uint8_t nssf, void *payload, size_t size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get supported flags of the controller.
|
||||||
|
*
|
||||||
|
* \param ctrlr NVMe controller to get flags.
|
||||||
|
*
|
||||||
|
* \return supported flags of this controller.
|
||||||
|
*/
|
||||||
|
uint64_t spdk_nvme_ctrlr_get_flags(struct spdk_nvme_ctrlr *ctrlr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attach the specified namespace to controllers.
|
* Attach the specified namespace to controllers.
|
||||||
*
|
*
|
||||||
|
@ -908,6 +908,10 @@ nvme_ctrlr_identify_done(void *arg, const struct spdk_nvme_cpl *cpl)
|
|||||||
ctrlr->max_sges = nvme_transport_ctrlr_get_max_sges(ctrlr);
|
ctrlr->max_sges = nvme_transport_ctrlr_get_max_sges(ctrlr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctrlr->cdata.oacs.security) {
|
||||||
|
ctrlr->flags |= SPDK_NVME_CTRLR_SECURITY_SEND_RECV_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
nvme_ctrlr_set_state(ctrlr, NVME_CTRLR_STATE_SET_NUM_QUEUES,
|
nvme_ctrlr_set_state(ctrlr, NVME_CTRLR_STATE_SET_NUM_QUEUES,
|
||||||
ctrlr->opts.admin_timeout_ms);
|
ctrlr->opts.admin_timeout_ms);
|
||||||
}
|
}
|
||||||
@ -2812,3 +2816,9 @@ spdk_nvme_ctrlr_security_send(struct spdk_nvme_ctrlr *ctrlr, uint8_t secp,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t
|
||||||
|
spdk_nvme_ctrlr_get_flags(struct spdk_nvme_ctrlr *ctrlr)
|
||||||
|
{
|
||||||
|
return ctrlr->flags;
|
||||||
|
}
|
||||||
|
@ -160,13 +160,6 @@ enum nvme_payload_type {
|
|||||||
NVME_PAYLOAD_TYPE_SGL,
|
NVME_PAYLOAD_TYPE_SGL,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* Controller support flags.
|
|
||||||
*/
|
|
||||||
enum spdk_nvme_ctrlr_flags {
|
|
||||||
SPDK_NVME_CTRLR_SGL_SUPPORTED = 0x1, /**< The SGL is supported */
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Descriptor for a request data payload.
|
* Descriptor for a request data payload.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user