aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiraz Saleem <shiraz.saleem@intel.com>2017-09-19 10:19:11 -0400
committerDoug Ledford <dledford@redhat.com>2017-09-22 13:43:36 -0400
commit471b370d52a4a461bf855ff542b544f3e4a5cb3a (patch)
tree551988ed47616b655bc3b1a1f6cc894959bb5e6a
parent47fb3c1610b28dd435b892762280eebf04fe9adf (diff)
i40iw: Call i40iw_cm_disconn on modify QP to disconnect
If QP modify to closing/terminate/error fails, connection is not torn down as there is no corresponding asynchronous event that will initiate the teardown. Add explicit call to i40iw_cm_disconn if not waiting in modify QP, otherwise schedule it in CM timer. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_verbs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index 1aa411034a27..28b3d02d511b 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -1027,7 +1027,19 @@ int i40iw_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
1027 iwqp->hw_tcp_state = I40IW_TCP_STATE_CLOSED; 1027 iwqp->hw_tcp_state = I40IW_TCP_STATE_CLOSED;
1028 iwqp->last_aeq = I40IW_AE_RESET_SENT; 1028 iwqp->last_aeq = I40IW_AE_RESET_SENT;
1029 spin_unlock_irqrestore(&iwqp->lock, flags); 1029 spin_unlock_irqrestore(&iwqp->lock, flags);
1030 i40iw_cm_disconn(iwqp);
1030 } 1031 }
1032 } else {
1033 spin_lock_irqsave(&iwqp->lock, flags);
1034 if (iwqp->cm_id) {
1035 if (atomic_inc_return(&iwqp->close_timer_started) == 1) {
1036 iwqp->cm_id->add_ref(iwqp->cm_id);
1037 i40iw_schedule_cm_timer(iwqp->cm_node,
1038 (struct i40iw_puda_buf *)iwqp,
1039 I40IW_TIMER_TYPE_CLOSE, 1, 0);
1040 }
1041 }
1042 spin_unlock_irqrestore(&iwqp->lock, flags);
1031 } 1043 }
1032 } 1044 }
1033 return 0; 1045 return 0;