aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/iser/iscsi_iser.h
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-10-01 07:02:01 -0400
committerRoland Dreier <roland@purestorage.com>2014-10-09 03:06:06 -0400
commitc47a3c9ed5be167f49a6fd3f696dac03536282eb (patch)
treee8d8ecdf2ddb5d7f661fa87c8172e042d6ebcebc /drivers/infiniband/ulp/iser/iscsi_iser.h
parent96f15198c1457df29b51ed151b1e5b2a223d1346 (diff)
IB/iser: Fix DEVICE REMOVAL handling in the absence of iscsi daemon
iscsi daemon is in user-space, thus we can't rely on it to be invoked at connection teardown (if not running or does not receive CPU time). This patch addresses the issue by re-structuring iSER connection teardown logic and CM events handling. The CM events will dictate the RDMA resources destruction (ib_conn) and iser_conn is kept around as long as iscsi_conn is left around allowing iscsi/iser callbacks to continue after RDMA transport was destroyed. This patch introduces a separation in logic when handling CM events: - DISCONNECTED_HANDLER, ADDR_CHANGED This events indicate the start of teardown process. Actions: 1. Terminate the connection: rdma_disconnect (send DREQ/DREP) 2. Notify iSCSI of connection failure 3. Change state to TERMINATING 4. Poll for all flush errors to be consumed - TIMEWAIT_EXIT, DEVICE_REMOVAL These events indicate the final stage of termination process and we can free RDMA related resources. Actions: 1. Call disconnected handler (we are not guaranteed that DISCONNECTED event was invoked in the past) 2. Cleanup RDMA related resources 3. For DEVICE_REMOVAL return non-zero rc from cma_handler to implicitly destroy the cm_id (Can't rely on user-space, make sure we have forward progress) We replace flush_completion (indicate all flushes were consumed) with ib_completion (rdma resources were cleaned up). The iser_conn_release_work will wait for teardown completions: - conn_stop was completed (tasks were cleaned-up) - stop_completion - RDMA resources were destroyed - ib_completion And then will continue to free iser connection representation (iser_conn). Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Ariel Nahum <arieln@mellanox.com> Signed-off-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/iser/iscsi_iser.h')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index ec238b3bd278..95c484d0f881 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -370,9 +370,9 @@ struct iser_conn {
370 unsigned min_posted_rx; /* qp_max_recv_dtos >> 2 */ 370 unsigned min_posted_rx; /* qp_max_recv_dtos >> 2 */
371 char name[ISER_OBJECT_NAME_SIZE]; 371 char name[ISER_OBJECT_NAME_SIZE];
372 struct work_struct release_work; 372 struct work_struct release_work;
373 struct completion stop_completion;
374 struct mutex state_mutex; 373 struct mutex state_mutex;
375 struct completion flush_completion; 374 struct completion stop_completion;
375 struct completion ib_completion;
376 struct completion up_completion; 376 struct completion up_completion;
377 struct list_head conn_list; /* entry in ig conn list */ 377 struct list_head conn_list; /* entry in ig conn list */
378 378
@@ -442,7 +442,7 @@ void iser_conn_init(struct iser_conn *iser_conn);
442 442
443void iser_conn_release(struct iser_conn *iser_conn); 443void iser_conn_release(struct iser_conn *iser_conn);
444 444
445void iser_conn_terminate(struct iser_conn *iser_conn); 445int iser_conn_terminate(struct iser_conn *iser_conn);
446 446
447void iser_release_work(struct work_struct *work); 447void iser_release_work(struct work_struct *work);
448 448