iser-target: Separate flows for np listeners and connections cma events
authorJenny Derzhavetz <jennyf@mellanox.com>
Wed, 24 Feb 2016 17:24:00 +0000 (19:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:09:03 +0000 (09:09 -0700)
commit f81bf458208ef6d12b2fc08091204e3859dcdba4 upstream.

No need to restrict this check to specific events.

Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/ulp/isert/ib_isert.c

index 0919d6add4e589c374c49c5df674b0fa58f66b5c..48e2394cd8c7dd1e6fada2878466e0c065b5ffcc 100644 (file)
@@ -884,14 +884,9 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id,
                           enum rdma_cm_event_type event)
 {
        struct isert_np *isert_np = cma_id->context;
-       struct isert_conn *isert_conn;
+       struct isert_conn *isert_conn = cma_id->qp->qp_context;
        bool terminating = false;
 
-       if (isert_np->cm_id == cma_id)
-               return isert_np_cma_handler(cma_id->context, event);
-
-       isert_conn = cma_id->qp->qp_context;
-
        mutex_lock(&isert_conn->mutex);
        terminating = (isert_conn->state == ISER_CONN_TERMINATING);
        isert_conn_terminate(isert_conn);
@@ -930,12 +925,16 @@ isert_connect_error(struct rdma_cm_id *cma_id)
 static int
 isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 {
+       struct isert_np *isert_np = cma_id->context;
        int ret = 0;
 
        isert_info("%s (%d): status %d id %p np %p\n",
                   rdma_event_msg(event->event), event->event,
                   event->status, cma_id, cma_id->context);
 
+       if (isert_np->cm_id == cma_id)
+               return isert_np_cma_handler(cma_id->context, event->event);
+
        switch (event->event) {
        case RDMA_CM_EVENT_CONNECT_REQUEST:
                ret = isert_connect_request(cma_id, event);