diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index da1149e3e..59753a5b1 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -1197,36 +1197,6 @@ spdk_iscsi_task_cpl(struct spdk_scsi_task *scsi_task) } } -static int -iscsi_get_pdu_length(struct spdk_iscsi_pdu *pdu, int header_digest, - int data_digest) -{ - int data_len, enable_digest, total; - - enable_digest = 1; - if (pdu->bhs.opcode == ISCSI_OP_LOGIN_RSP) { - enable_digest = 0; - } - - total = ISCSI_BHS_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); - if (data_len > 0) { - total += ISCSI_ALIGN(data_len); - if (enable_digest && data_digest) { - total += ISCSI_DIGEST_LEN; - } - } - - return total; -} - static void iscsi_conn_send_nopin(struct spdk_iscsi_conn *conn) { @@ -1296,6 +1266,36 @@ spdk_iscsi_conn_handle_nop(struct spdk_iscsi_conn *conn) } } +static int +iscsi_get_pdu_length(struct spdk_iscsi_pdu *pdu, int header_digest, + int data_digest) +{ + int data_len, enable_digest, total; + + enable_digest = 1; + if (pdu->bhs.opcode == ISCSI_OP_LOGIN_RSP) { + enable_digest = 0; + } + + total = ISCSI_BHS_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); + if (data_len > 0) { + total += ISCSI_ALIGN(data_len); + if (enable_digest && data_digest) { + total += ISCSI_DIGEST_LEN; + } + } + + return total; +} + static bool iscsi_is_free_pdu_deferred(struct spdk_iscsi_pdu *pdu) {