mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 19:51:27 +00:00
isert: Cleanup iscsi connection as soon as possible to allow lower session reinstate times
Signed-off-by: Yan Burman <yanb@mellanox.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5781 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -105,6 +105,7 @@ struct isert_cq {
|
||||
|
||||
#define ISERT_CONNECTION_ABORTED 0
|
||||
#define ISERT_DRAIN_POSTED 1
|
||||
#define ISERT_DRAIN_FAILED 2
|
||||
|
||||
struct isert_connection {
|
||||
struct iscsi_conn iscsi ____cacheline_aligned;
|
||||
|
||||
@@ -134,6 +134,7 @@ void isert_conn_disconnect(struct isert_connection *isert_conn)
|
||||
pr_err("Failed to post drain wr, err:%d\n", err);
|
||||
/* We need to decrement iser_conn->kref in order to be able to cleanup
|
||||
* the connection */
|
||||
set_bit(ISERT_DRAIN_FAILED, &isert_conn->flags);
|
||||
isert_conn_free(isert_conn);
|
||||
}
|
||||
}
|
||||
@@ -500,10 +501,14 @@ static void isert_handle_wc_error(struct ib_wc *wc)
|
||||
|
||||
switch (wr->wr_op) {
|
||||
case ISER_WR_SEND:
|
||||
if (unlikely(wr->send_wr.num_sge == 0)) /* Drain WR */
|
||||
if (unlikely(wr->send_wr.num_sge == 0)) { /* Drain WR */
|
||||
/* notify upper layer */
|
||||
if (!test_bit(ISERT_CONNECTION_ABORTED, &isert_conn->flags))
|
||||
isert_connection_closed(&isert_conn->iscsi);
|
||||
isert_conn_free(isert_conn);
|
||||
else
|
||||
} else {
|
||||
isert_pdu_err(&isert_pdu->iscsi);
|
||||
}
|
||||
break;
|
||||
case ISER_WR_RDMA_READ:
|
||||
isert_pdu_err(&isert_pdu->iscsi);
|
||||
@@ -1111,7 +1116,7 @@ static void isert_conn_closed_do_work(struct work_struct *work)
|
||||
#endif
|
||||
|
||||
/* notify upper layer */
|
||||
if (!test_bit(ISERT_CONNECTION_ABORTED, &isert_conn->flags))
|
||||
if (test_bit(ISERT_DRAIN_FAILED, &isert_conn->flags))
|
||||
isert_connection_closed(&isert_conn->iscsi);
|
||||
|
||||
isert_conn_free(isert_conn);
|
||||
|
||||
Reference in New Issue
Block a user