Commit a1bbed81 authored by Jim Harris's avatar Jim Harris Committed by Daniel Verkamp
Browse files

iscsi: flush PDUs immediately instead of waiting for poller



Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I39152be9653316a24135cde497662cfbc8f68e3a

Reviewed-on: https://review.gerrithub.io/395523


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatar <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarZiye Yang <optimistyzy@gmail.com>
parent 43016e03
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1243,7 +1243,18 @@ spdk_iscsi_conn_flush_pdus(struct spdk_iscsi_conn *conn)
void
spdk_iscsi_conn_write_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
{
	int rc;

	TAILQ_INSERT_TAIL(&conn->write_pdu_list, pdu, tailq);
	rc = spdk_iscsi_conn_flush_pdus(conn);
	if (rc < 0 && conn->state < ISCSI_CONN_STATE_EXITING) {
		/*
		 * If the poller has already started destruction of the connection,
		 *  i.e. the socket read failed, then the connection state may already
		 *  be EXITED.  We don't want to set it back to EXITING in that case.
		 */
		conn->state = ISCSI_CONN_STATE_EXITING;
	}
}

#define GET_PDU_LOOP_COUNT	16