Commit a5836c6d authored by Changpeng Liu's avatar Changpeng Liu
Browse files

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: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1520


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 35aab73c
Loading
Loading
Loading
Loading
+345 −335

File changed.

Preview size limit exceeded, changes collapsed.

+11 −7
Original line number Diff line number Diff line
@@ -268,19 +268,23 @@ struct spdk_opal_header {
	struct spdk_opal_data_subpacket sub_packet;
};

struct spdk_opal_dev {
	bool supported;
	struct spdk_nvme_ctrlr *ctrlr;

	uint16_t comid;
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 {
	bool supported;
	struct spdk_nvme_ctrlr *ctrlr;

	uint16_t comid;

	/* Only one session can be supported */
	struct opal_session sess;

	struct spdk_opal_d0_features_info feat_info;