aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes/nes_verbs.c
diff options
context:
space:
mode:
authorFaisal Latif <flatif@neteffect.com>2008-07-24 23:50:45 -0400
committerRoland Dreier <rolandd@cisco.com>2008-07-24 23:50:45 -0400
commit6492cdf3a24fd620660c399745b5e169a0ed27d6 (patch)
tree474a0e937cda0b4cff70bc47a657d8338fb91d22 /drivers/infiniband/hw/nes/nes_verbs.c
parentfb2e405fc1fc8b20d9c78eaa1c7fd5a297efde43 (diff)
RDMA/nes: CM connection setup/teardown rework
Major rework of CM connection setup/teardown. We had a number of issues with MPI applications not starting/terminating properly over time. With these changes we were able to run longer on larger clusters. * Remove memory allocation from nes_connect() and nes_cm_connect(). * Fix mini_cm_dec_refcnt_listen() when destroying listener. * Remove unnecessary code from schedule_nes_timer() and nes_cm_timer_tick(). * Functionalize mini_cm_recv_pkt() and process_packet(). * Clean up cm_node->ref_count usage. * Reuse skbs if available. Signed-off-by: Faisal Latif <flatif@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_verbs.c')
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index e3939d13484e..d79942e84979 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -2867,7 +2867,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2867 nesqp->hwqp.qp_id, attr->qp_state, nesqp->ibqp_state, 2867 nesqp->hwqp.qp_id, attr->qp_state, nesqp->ibqp_state,
2868 nesqp->iwarp_state, atomic_read(&nesqp->refcount)); 2868 nesqp->iwarp_state, atomic_read(&nesqp->refcount));
2869 2869
2870 nes_add_ref(&nesqp->ibqp);
2871 spin_lock_irqsave(&nesqp->lock, qplockflags); 2870 spin_lock_irqsave(&nesqp->lock, qplockflags);
2872 2871
2873 nes_debug(NES_DBG_MOD_QP, "QP%u: hw_iwarp_state=0x%X, hw_tcp_state=0x%X," 2872 nes_debug(NES_DBG_MOD_QP, "QP%u: hw_iwarp_state=0x%X, hw_tcp_state=0x%X,"
@@ -2882,7 +2881,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2882 nesqp->hwqp.qp_id); 2881 nesqp->hwqp.qp_id);
2883 if (nesqp->iwarp_state > (u32)NES_CQP_QP_IWARP_STATE_IDLE) { 2882 if (nesqp->iwarp_state > (u32)NES_CQP_QP_IWARP_STATE_IDLE) {
2884 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 2883 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
2885 nes_rem_ref(&nesqp->ibqp);
2886 return -EINVAL; 2884 return -EINVAL;
2887 } 2885 }
2888 next_iwarp_state = NES_CQP_QP_IWARP_STATE_IDLE; 2886 next_iwarp_state = NES_CQP_QP_IWARP_STATE_IDLE;
@@ -2893,7 +2891,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2893 nesqp->hwqp.qp_id); 2891 nesqp->hwqp.qp_id);
2894 if (nesqp->iwarp_state>(u32)NES_CQP_QP_IWARP_STATE_IDLE) { 2892 if (nesqp->iwarp_state>(u32)NES_CQP_QP_IWARP_STATE_IDLE) {
2895 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 2893 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
2896 nes_rem_ref(&nesqp->ibqp);
2897 return -EINVAL; 2894 return -EINVAL;
2898 } 2895 }
2899 next_iwarp_state = NES_CQP_QP_IWARP_STATE_IDLE; 2896 next_iwarp_state = NES_CQP_QP_IWARP_STATE_IDLE;
@@ -2904,14 +2901,12 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2904 nesqp->hwqp.qp_id); 2901 nesqp->hwqp.qp_id);
2905 if (nesqp->iwarp_state>(u32)NES_CQP_QP_IWARP_STATE_RTS) { 2902 if (nesqp->iwarp_state>(u32)NES_CQP_QP_IWARP_STATE_RTS) {
2906 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 2903 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
2907 nes_rem_ref(&nesqp->ibqp);
2908 return -EINVAL; 2904 return -EINVAL;
2909 } 2905 }
2910 if (nesqp->cm_id == NULL) { 2906 if (nesqp->cm_id == NULL) {
2911 nes_debug(NES_DBG_MOD_QP, "QP%u: Failing attempt to move QP to RTS without a CM_ID. \n", 2907 nes_debug(NES_DBG_MOD_QP, "QP%u: Failing attempt to move QP to RTS without a CM_ID. \n",
2912 nesqp->hwqp.qp_id ); 2908 nesqp->hwqp.qp_id );
2913 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 2909 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
2914 nes_rem_ref(&nesqp->ibqp);
2915 return -EINVAL; 2910 return -EINVAL;
2916 } 2911 }
2917 next_iwarp_state = NES_CQP_QP_IWARP_STATE_RTS; 2912 next_iwarp_state = NES_CQP_QP_IWARP_STATE_RTS;
@@ -2929,7 +2924,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2929 nesqp->hwqp.qp_id, nesqp->hwqp.sq_head, nesqp->hwqp.sq_tail); 2924 nesqp->hwqp.qp_id, nesqp->hwqp.sq_head, nesqp->hwqp.sq_tail);
2930 if (nesqp->iwarp_state == (u32)NES_CQP_QP_IWARP_STATE_CLOSING) { 2925 if (nesqp->iwarp_state == (u32)NES_CQP_QP_IWARP_STATE_CLOSING) {
2931 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 2926 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
2932 nes_rem_ref(&nesqp->ibqp);
2933 return 0; 2927 return 0;
2934 } else { 2928 } else {
2935 if (nesqp->iwarp_state > (u32)NES_CQP_QP_IWARP_STATE_CLOSING) { 2929 if (nesqp->iwarp_state > (u32)NES_CQP_QP_IWARP_STATE_CLOSING) {
@@ -2937,7 +2931,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2937 " ignored due to current iWARP state\n", 2931 " ignored due to current iWARP state\n",
2938 nesqp->hwqp.qp_id); 2932 nesqp->hwqp.qp_id);
2939 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 2933 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
2940 nes_rem_ref(&nesqp->ibqp);
2941 return -EINVAL; 2934 return -EINVAL;
2942 } 2935 }
2943 if (nesqp->hw_iwarp_state != NES_AEQE_IWARP_STATE_RTS) { 2936 if (nesqp->hw_iwarp_state != NES_AEQE_IWARP_STATE_RTS) {
@@ -2969,7 +2962,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2969 nesqp->hwqp.qp_id); 2962 nesqp->hwqp.qp_id);
2970 if (nesqp->iwarp_state>=(u32)NES_CQP_QP_IWARP_STATE_TERMINATE) { 2963 if (nesqp->iwarp_state>=(u32)NES_CQP_QP_IWARP_STATE_TERMINATE) {
2971 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 2964 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
2972 nes_rem_ref(&nesqp->ibqp);
2973 return -EINVAL; 2965 return -EINVAL;
2974 } 2966 }
2975 /* next_iwarp_state = (NES_CQP_QP_IWARP_STATE_TERMINATE | 0x02000000); */ 2967 /* next_iwarp_state = (NES_CQP_QP_IWARP_STATE_TERMINATE | 0x02000000); */
@@ -2982,7 +2974,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2982 case IB_QPS_RESET: 2974 case IB_QPS_RESET:
2983 if (nesqp->iwarp_state == (u32)NES_CQP_QP_IWARP_STATE_ERROR) { 2975 if (nesqp->iwarp_state == (u32)NES_CQP_QP_IWARP_STATE_ERROR) {
2984 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 2976 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
2985 nes_rem_ref(&nesqp->ibqp);
2986 return -EINVAL; 2977 return -EINVAL;
2987 } 2978 }
2988 nes_debug(NES_DBG_MOD_QP, "QP%u: new state = error\n", 2979 nes_debug(NES_DBG_MOD_QP, "QP%u: new state = error\n",
@@ -3008,7 +2999,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
3008 break; 2999 break;
3009 default: 3000 default:
3010 spin_unlock_irqrestore(&nesqp->lock, qplockflags); 3001 spin_unlock_irqrestore(&nesqp->lock, qplockflags);
3011 nes_rem_ref(&nesqp->ibqp);
3012 return -EINVAL; 3002 return -EINVAL;
3013 break; 3003 break;
3014 } 3004 }
@@ -3088,7 +3078,6 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
3088 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), 3078 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount),
3089 original_last_aeq, nesqp->last_aeq); 3079 original_last_aeq, nesqp->last_aeq);
3090 /* this one is for the cm_disconnect thread */ 3080 /* this one is for the cm_disconnect thread */
3091 nes_add_ref(&nesqp->ibqp);
3092 spin_lock_irqsave(&nesqp->lock, qplockflags); 3081 spin_lock_irqsave(&nesqp->lock, qplockflags);
3093 nesqp->hw_tcp_state = NES_AEQE_TCP_STATE_CLOSED; 3082 nesqp->hw_tcp_state = NES_AEQE_TCP_STATE_CLOSED;
3094 nesqp->last_aeq = NES_AEQE_AEID_RESET_SENT; 3083 nesqp->last_aeq = NES_AEQE_AEID_RESET_SENT;
@@ -3097,14 +3086,12 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
3097 } else { 3086 } else {
3098 nes_debug(NES_DBG_MOD_QP, "QP%u No fake disconnect, QP refcount=%d\n", 3087 nes_debug(NES_DBG_MOD_QP, "QP%u No fake disconnect, QP refcount=%d\n",
3099 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount)); 3088 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount));
3100 nes_rem_ref(&nesqp->ibqp);
3101 } 3089 }
3102 } else { 3090 } else {
3103 spin_lock_irqsave(&nesqp->lock, qplockflags); 3091 spin_lock_irqsave(&nesqp->lock, qplockflags);
3104 if (nesqp->cm_id) { 3092 if (nesqp->cm_id) {
3105 /* These two are for the timer thread */ 3093 /* These two are for the timer thread */
3106 if (atomic_inc_return(&nesqp->close_timer_started) == 1) { 3094 if (atomic_inc_return(&nesqp->close_timer_started) == 1) {
3107 nes_add_ref(&nesqp->ibqp);
3108 nesqp->cm_id->add_ref(nesqp->cm_id); 3095 nesqp->cm_id->add_ref(nesqp->cm_id);
3109 nes_debug(NES_DBG_MOD_QP, "QP%u Not decrementing QP refcount (%d)," 3096 nes_debug(NES_DBG_MOD_QP, "QP%u Not decrementing QP refcount (%d),"
3110 " need ae to finish up, original_last_aeq = 0x%04X." 3097 " need ae to finish up, original_last_aeq = 0x%04X."
@@ -3128,14 +3115,12 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
3128 " original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n", 3115 " original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n",
3129 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), 3116 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount),
3130 original_last_aeq, nesqp->last_aeq); 3117 original_last_aeq, nesqp->last_aeq);
3131 nes_rem_ref(&nesqp->ibqp);
3132 } 3118 }
3133 } else { 3119 } else {
3134 nes_debug(NES_DBG_MOD_QP, "QP%u Decrementing QP refcount (%d), No ae to finish up," 3120 nes_debug(NES_DBG_MOD_QP, "QP%u Decrementing QP refcount (%d), No ae to finish up,"
3135 " original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n", 3121 " original_last_aeq = 0x%04X. last_aeq = 0x%04X.\n",
3136 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), 3122 nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount),
3137 original_last_aeq, nesqp->last_aeq); 3123 original_last_aeq, nesqp->last_aeq);
3138 nes_rem_ref(&nesqp->ibqp);
3139 } 3124 }
3140 3125
3141 err = 0; 3126 err = 0;