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:
parent
43016e0328
commit
a1bbed818e
@ -1243,7 +1243,18 @@ spdk_iscsi_conn_flush_pdus(struct spdk_iscsi_conn *conn)
|
|||||||
void
|
void
|
||||||
spdk_iscsi_conn_write_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
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);
|
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
|
#define GET_PDU_LOOP_COUNT 16
|
||||||
|
Loading…
Reference in New Issue
Block a user