aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4/qp.c
diff options
context:
space:
mode:
authorKumar Sanghvi <kumaras@chelsio.com>2011-09-25 10:47:44 -0400
committerRoland Dreier <roland@purestorage.com>2011-10-06 12:39:24 -0400
commitd2fe99e86bb2ccbb87df20b0136d5983b6a4cc09 (patch)
tree2978723397dc5f036f30a1dcf316854310001b62 /drivers/infiniband/hw/cxgb4/qp.c
parent56da00fc92e6f227874bba36f127ffc8847ee1f8 (diff)
RDMA/cxgb4: Add support for MPAv2 Enhanced RDMA Negotiation
This patch adds support for Enhanced RDMA Connection Establishment (draft-ietf-storm-mpa-peer-connect-06), aka MPAv2. Details of draft can be obtained from: <http://www.ietf.org/id/draft-ietf-storm-mpa-peer-connect-06.txt> The patch updates the following functions for initiator perspective: - send_mpa_request - process_mpa_reply - post_terminate for TERM error codes - destroy_qp for TERM related change - adds layer/etype/ecode to c4iw_qp_attrs for sending with TERM - peer_abort for retrying connection attempt with MPA_v1 message - added c4iw_reconnect function The patch updates the following functions for responder perspective: - process_mpa_request - send_mpa_reply - c4iw_accept_cr - passes ird/ord to upper layers Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/qp.c')
-rw-r--r--drivers/infiniband/hw/cxgb4/qp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index a41578e48c7b..ec3ce675fdff 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -917,7 +917,11 @@ static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe,
917 wqe->u.terminate.type = FW_RI_TYPE_TERMINATE; 917 wqe->u.terminate.type = FW_RI_TYPE_TERMINATE;
918 wqe->u.terminate.immdlen = cpu_to_be32(sizeof *term); 918 wqe->u.terminate.immdlen = cpu_to_be32(sizeof *term);
919 term = (struct terminate_message *)wqe->u.terminate.termmsg; 919 term = (struct terminate_message *)wqe->u.terminate.termmsg;
920 build_term_codes(err_cqe, &term->layer_etype, &term->ecode); 920 if (qhp->attr.layer_etype == (LAYER_MPA|DDP_LLP)) {
921 term->layer_etype = qhp->attr.layer_etype;
922 term->ecode = qhp->attr.ecode;
923 } else
924 build_term_codes(err_cqe, &term->layer_etype, &term->ecode);
921 c4iw_ofld_send(&qhp->rhp->rdev, skb); 925 c4iw_ofld_send(&qhp->rhp->rdev, skb);
922} 926}
923 927
@@ -1012,6 +1016,7 @@ out:
1012 1016
1013static void build_rtr_msg(u8 p2p_type, struct fw_ri_init *init) 1017static void build_rtr_msg(u8 p2p_type, struct fw_ri_init *init)
1014{ 1018{
1019 PDBG("%s p2p_type = %d\n", __func__, p2p_type);
1015 memset(&init->u, 0, sizeof init->u); 1020 memset(&init->u, 0, sizeof init->u);
1016 switch (p2p_type) { 1021 switch (p2p_type) {
1017 case FW_RI_INIT_P2PTYPE_RDMA_WRITE: 1022 case FW_RI_INIT_P2PTYPE_RDMA_WRITE:
@@ -1212,6 +1217,8 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
1212 break; 1217 break;
1213 case C4IW_QP_STATE_TERMINATE: 1218 case C4IW_QP_STATE_TERMINATE:
1214 set_state(qhp, C4IW_QP_STATE_TERMINATE); 1219 set_state(qhp, C4IW_QP_STATE_TERMINATE);
1220 qhp->attr.layer_etype = attrs->layer_etype;
1221 qhp->attr.ecode = attrs->ecode;
1215 if (qhp->ibqp.uobject) 1222 if (qhp->ibqp.uobject)
1216 t4_set_wq_in_error(&qhp->wq); 1223 t4_set_wq_in_error(&qhp->wq);
1217 ep = qhp->ep; 1224 ep = qhp->ep;
@@ -1334,7 +1341,10 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp)
1334 rhp = qhp->rhp; 1341 rhp = qhp->rhp;
1335 1342
1336 attrs.next_state = C4IW_QP_STATE_ERROR; 1343 attrs.next_state = C4IW_QP_STATE_ERROR;
1337 c4iw_modify_qp(rhp, qhp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); 1344 if (qhp->attr.state == C4IW_QP_STATE_TERMINATE)
1345 c4iw_modify_qp(rhp, qhp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
1346 else
1347 c4iw_modify_qp(rhp, qhp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0);
1338 wait_event(qhp->wait, !qhp->ep); 1348 wait_event(qhp->wait, !qhp->ep);
1339 1349
1340 remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid); 1350 remove_handle(rhp, &rhp->qpidr, qhp->wq.sq.qid);