aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes/nes_verbs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_verbs.c')
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index c6b5873416eb..36666ac2f546 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -2923,7 +2923,7 @@ static int nes_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
2923 * nes_hw_modify_qp 2923 * nes_hw_modify_qp
2924 */ 2924 */
2925int nes_hw_modify_qp(struct nes_device *nesdev, struct nes_qp *nesqp, 2925int nes_hw_modify_qp(struct nes_device *nesdev, struct nes_qp *nesqp,
2926 u32 next_iwarp_state, u32 wait_completion) 2926 u32 next_iwarp_state, u32 termlen, u32 wait_completion)
2927{ 2927{
2928 struct nes_hw_cqp_wqe *cqp_wqe; 2928 struct nes_hw_cqp_wqe *cqp_wqe;
2929 /* struct iw_cm_id *cm_id = nesqp->cm_id; */ 2929 /* struct iw_cm_id *cm_id = nesqp->cm_id; */
@@ -2955,6 +2955,13 @@ int nes_hw_modify_qp(struct nes_device *nesdev, struct nes_qp *nesqp,
2955 set_wqe_32bit_value(cqp_wqe->wqe_words, NES_CQP_WQE_ID_IDX, nesqp->hwqp.qp_id); 2955 set_wqe_32bit_value(cqp_wqe->wqe_words, NES_CQP_WQE_ID_IDX, nesqp->hwqp.qp_id);
2956 set_wqe_64bit_value(cqp_wqe->wqe_words, NES_CQP_QP_WQE_CONTEXT_LOW_IDX, (u64)nesqp->nesqp_context_pbase); 2956 set_wqe_64bit_value(cqp_wqe->wqe_words, NES_CQP_QP_WQE_CONTEXT_LOW_IDX, (u64)nesqp->nesqp_context_pbase);
2957 2957
2958 /* If sending a terminate message, fill in the length (in words) */
2959 if (((next_iwarp_state & NES_CQP_QP_IWARP_STATE_MASK) == NES_CQP_QP_IWARP_STATE_TERMINATE) &&
2960 !(next_iwarp_state & NES_CQP_QP_TERM_DONT_SEND_TERM_MSG)) {
2961 termlen = ((termlen + 3) >> 2) << NES_CQP_OP_TERMLEN_SHIFT;
2962 set_wqe_32bit_value(cqp_wqe->wqe_words, NES_CQP_QP_WQE_NEW_MSS_IDX, termlen);
2963 }
2964
2958 atomic_set(&cqp_request->refcount, 2); 2965 atomic_set(&cqp_request->refcount, 2);
2959 nes_post_cqp_request(nesdev, cqp_request); 2966 nes_post_cqp_request(nesdev, cqp_request);
2960 2967
@@ -3125,6 +3132,9 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
3125 } 3132 }
3126 nes_debug(NES_DBG_MOD_QP, "QP%u: new state = error\n", 3133 nes_debug(NES_DBG_MOD_QP, "QP%u: new state = error\n",
3127 nesqp->hwqp.qp_id); 3134 nesqp->hwqp.qp_id);
3135 if (nesqp->term_flags)
3136 del_timer(&nesqp->terminate_timer);
3137
3128 next_iwarp_state = NES_CQP_QP_IWARP_STATE_ERROR; 3138 next_iwarp_state = NES_CQP_QP_IWARP_STATE_ERROR;
3129 /* next_iwarp_state = (NES_CQP_QP_IWARP_STATE_TERMINATE | 0x02000000); */ 3139 /* next_iwarp_state = (NES_CQP_QP_IWARP_STATE_TERMINATE | 0x02000000); */
3130 if (nesqp->hte_added) { 3140 if (nesqp->hte_added) {
@@ -3202,7 +3212,7 @@ int nes_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
3202 3212
3203 if (issue_modify_qp) { 3213 if (issue_modify_qp) {
3204 nes_debug(NES_DBG_MOD_QP, "call nes_hw_modify_qp\n"); 3214 nes_debug(NES_DBG_MOD_QP, "call nes_hw_modify_qp\n");
3205 ret = nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 1); 3215 ret = nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 1);
3206 if (ret) 3216 if (ret)
3207 nes_debug(NES_DBG_MOD_QP, "nes_hw_modify_qp (next_iwarp_state = 0x%08X)" 3217 nes_debug(NES_DBG_MOD_QP, "nes_hw_modify_qp (next_iwarp_state = 0x%08X)"
3208 " failed for QP%u.\n", 3218 " failed for QP%u.\n",
@@ -3367,6 +3377,12 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
3367 head = nesqp->hwqp.sq_head; 3377 head = nesqp->hwqp.sq_head;
3368 3378
3369 while (ib_wr) { 3379 while (ib_wr) {
3380 /* Check for QP error */
3381 if (nesqp->term_flags) {
3382 err = -EINVAL;
3383 break;
3384 }
3385
3370 /* Check for SQ overflow */ 3386 /* Check for SQ overflow */
3371 if (((head + (2 * qsize) - nesqp->hwqp.sq_tail) % qsize) == (qsize - 1)) { 3387 if (((head + (2 * qsize) - nesqp->hwqp.sq_tail) % qsize) == (qsize - 1)) {
3372 err = -EINVAL; 3388 err = -EINVAL;
@@ -3523,6 +3539,12 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
3523 head = nesqp->hwqp.rq_head; 3539 head = nesqp->hwqp.rq_head;
3524 3540
3525 while (ib_wr) { 3541 while (ib_wr) {
3542 /* Check for QP error */
3543 if (nesqp->term_flags) {
3544 err = -EINVAL;
3545 break;
3546 }
3547
3526 if (ib_wr->num_sge > nesdev->nesadapter->max_sge) { 3548 if (ib_wr->num_sge > nesdev->nesadapter->max_sge) {
3527 err = -EINVAL; 3549 err = -EINVAL;
3528 break; 3550 break;