iscsi: flush PDUs immediately instead of waiting for poller

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

Reviewed-on: https://review.gerrithub.io/395523
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
This commit is contained in:
Jim Harris 2018-01-17 23:33:19 -07:00 committed by Daniel Verkamp
parent 43016e0328
commit a1bbed818e

View File

@ -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