nvme/opal: introduce a session concept disaggregate data buffers
Althrough the controller can only support 1 session, but we can refactor the OPAL internal APIs running based on session, then we can allocate a session from public APIs, currently we just use the session that embedded in the global device structure. No actual logic change from this patch. Change-Id: Ifbc801970f3df6f0753a5796715667f2eaf664aa Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1520 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
35aab73cc2
commit
a5836c6d99
File diff suppressed because it is too large
Load Diff
@ -268,19 +268,23 @@ struct spdk_opal_header {
|
|||||||
struct spdk_opal_data_subpacket sub_packet;
|
struct spdk_opal_data_subpacket sub_packet;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct opal_session {
|
||||||
|
uint32_t hsn;
|
||||||
|
uint32_t tsn;
|
||||||
|
size_t cmd_pos;
|
||||||
|
uint8_t cmd[IO_BUFFER_LENGTH];
|
||||||
|
uint8_t resp[IO_BUFFER_LENGTH];
|
||||||
|
struct spdk_opal_resp_parsed parsed_resp;
|
||||||
|
};
|
||||||
|
|
||||||
struct spdk_opal_dev {
|
struct spdk_opal_dev {
|
||||||
bool supported;
|
bool supported;
|
||||||
struct spdk_nvme_ctrlr *ctrlr;
|
struct spdk_nvme_ctrlr *ctrlr;
|
||||||
|
|
||||||
uint16_t comid;
|
uint16_t comid;
|
||||||
uint32_t hsn;
|
|
||||||
uint32_t tsn;
|
|
||||||
|
|
||||||
size_t cmd_pos;
|
/* Only one session can be supported */
|
||||||
uint8_t cmd[IO_BUFFER_LENGTH];
|
struct opal_session sess;
|
||||||
uint8_t resp[IO_BUFFER_LENGTH];
|
|
||||||
|
|
||||||
struct spdk_opal_resp_parsed parsed_resp;
|
|
||||||
|
|
||||||
struct spdk_opal_d0_features_info feat_info;
|
struct spdk_opal_d0_features_info feat_info;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user