Commit 72d06a99 authored by Seth Howell's avatar Seth Howell Committed by Changpeng Liu
Browse files

Revert "iscsi: change the field bhs to pointer type."



This reverts commit 80cf038c.

Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Change-Id: I95e2ddfbc9cd07e874a385b345dc401fc8076e88
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468778


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent a19e674b
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -309,17 +309,17 @@ void
spdk_iscsi_conn_free_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
{
	if (pdu->task) {
		if (pdu->bhs->opcode == ISCSI_OP_SCSI_DATAIN) {
		if (pdu->bhs.opcode == ISCSI_OP_SCSI_DATAIN) {
			if (pdu->task->scsi.offset > 0) {
				conn->data_in_cnt--;
				if (pdu->bhs->flags & ISCSI_DATAIN_STATUS) {
				if (pdu->bhs.flags & ISCSI_DATAIN_STATUS) {
					/* Free the primary task after the last subtask done */
					conn->data_in_cnt--;
					spdk_iscsi_task_put(spdk_iscsi_task_get_primary(pdu->task));
				}
				spdk_iscsi_conn_handle_queued_datain_tasks(conn);
			}
		} else if (pdu->bhs->opcode == ISCSI_OP_SCSI_RSP &&
		} else if (pdu->bhs.opcode == ISCSI_OP_SCSI_RSP &&
			   pdu->task->scsi.status != SPDK_SCSI_STATUS_GOOD) {
			if (pdu->task->scsi.offset > 0) {
				spdk_iscsi_task_put(spdk_iscsi_task_get_primary(pdu->task));
@@ -1087,19 +1087,19 @@ iscsi_get_pdu_length(struct spdk_iscsi_pdu *pdu, int header_digest,
	int data_len, enable_digest, total;

	enable_digest = 1;
	if (pdu->bhs->opcode == ISCSI_OP_LOGIN_RSP) {
	if (pdu->bhs.opcode == ISCSI_OP_LOGIN_RSP) {
		enable_digest = 0;
	}

	total = ISCSI_BHS_LEN;

	total += (4 * pdu->bhs->total_ahs_len);
	total += (4 * pdu->bhs.total_ahs_len);

	if (enable_digest && header_digest) {
		total += ISCSI_DIGEST_LEN;
	}

	data_len = DGET24(pdu->bhs->data_segment_len);
	data_len = DGET24(pdu->bhs.data_segment_len);
	if (data_len > 0) {
		total += ISCSI_ALIGN(data_len);
		if (enable_digest && data_digest) {
@@ -1228,7 +1228,7 @@ iscsi_conn_flush_pdus_internal(struct spdk_iscsi_conn *conn)
			    (conn->sess->ErrorRecoveryLevel >= 1) &&
			    spdk_iscsi_is_deferred_free_pdu(pdu)) {
				SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "stat_sn=%d\n",
					      from_be32(&pdu->bhs->stat_sn));
					      from_be32(&pdu->bhs.stat_sn));
				TAILQ_INSERT_TAIL(&conn->snack_pdu_list, pdu,
						  tailq);
			} else {
@@ -1334,7 +1334,7 @@ spdk_iscsi_conn_write_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *p
		pdu->dif_insert_or_strip = true;
	}

	if (pdu->bhs->opcode != ISCSI_OP_LOGIN_RSP) {
	if (pdu->bhs.opcode != ISCSI_OP_LOGIN_RSP) {
		/* Header Digest */
		if (conn->header_digest) {
			crc32c = spdk_iscsi_pdu_calc_header_digest(pdu);
@@ -1342,7 +1342,7 @@ spdk_iscsi_conn_write_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *p
		}

		/* Data Digest */
		if (conn->data_digest && DGET24(pdu->bhs->data_segment_len) != 0) {
		if (conn->data_digest && DGET24(pdu->bhs.data_segment_len) != 0) {
			crc32c = spdk_iscsi_pdu_calc_data_digest(pdu);
			MAKE_DIGEST_WORD(pdu->data_digest, crc32c);
		}
+73 −73

File changed.

Preview size limit exceeded, changes collapsed.

+1 −2
Original line number Diff line number Diff line
@@ -157,8 +157,7 @@ struct spdk_mobj {
};

struct spdk_iscsi_pdu {
	struct iscsi_bhs *bhs;
	struct iscsi_bhs bhs_mem;
	struct iscsi_bhs bhs;
	struct spdk_mobj *mobj;
	uint8_t *data_buf;
	uint8_t *data;
+0 −1
Original line number Diff line number Diff line
@@ -326,7 +326,6 @@ struct spdk_iscsi_pdu *spdk_get_pdu(void)

	/* we do not want to zero out the last part of the structure reserved for AHS and sense data */
	memset(pdu, 0, offsetof(struct spdk_iscsi_pdu, ahs));
	pdu->bhs = &pdu->bhs_mem;
	pdu->ref = 1;

	return pdu;
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ spdk_iscsi_task_set_pdu(struct spdk_iscsi_task *task, struct spdk_iscsi_pdu *pdu
static inline struct iscsi_bhs *
spdk_iscsi_task_get_bhs(struct spdk_iscsi_task *task)
{
	return spdk_iscsi_task_get_pdu(task)->bhs;
	return &spdk_iscsi_task_get_pdu(task)->bhs;
}

static inline void
Loading