diff options
author | Jubin John <jubin.john@intel.com> | 2016-02-14 12:45:00 -0800 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-03-10 20:38:12 -0500 |
commit | 721d04273a8265847612a420174bb6e9a13d8d4f (patch) | |
tree | 6c861beffdae3cc1ba3dca849c0410bdba11944f | |
parent | c239a5b5d6617b8bdae401f86529cab76313f3e7 (diff) | |
download | linux-stable-721d04273a8265847612a420174bb6e9a13d8d4f.tar.gz linux-stable-721d04273a8265847612a420174bb6e9a13d8d4f.tar.bz2 linux-stable-721d04273a8265847612a420174bb6e9a13d8d4f.zip |
staging/rdma/hfi1: Add s_sendcontext priv field
s_sendcontext will be used to map the QPs to the send contexts
for PIO.
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/staging/rdma/hfi1/qp.c | 13 | ||||
-rw-r--r-- | drivers/staging/rdma/hfi1/ud.c | 1 | ||||
-rw-r--r-- | drivers/staging/rdma/hfi1/verbs.h | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c index 7387ef5cd069..571e78fa2633 100644 --- a/drivers/staging/rdma/hfi1/qp.c +++ b/drivers/staging/rdma/hfi1/qp.c @@ -191,6 +191,9 @@ int hfi1_check_modify_qp(struct rvt_qp *qp, struct ib_qp_attr *attr, if (!qp_to_sdma_engine(qp, sc) && dd->flags & HFI1_HAS_SEND_DMA) return -EINVAL; + + if (!qp_to_send_context(qp, sc)) + return -EINVAL; } if (attr_mask & IB_QP_ALT_PATH) { @@ -201,6 +204,9 @@ int hfi1_check_modify_qp(struct rvt_qp *qp, struct ib_qp_attr *attr, if (!qp_to_sdma_engine(qp, sc) && dd->flags & HFI1_HAS_SEND_DMA) return -EINVAL; + + if (!qp_to_send_context(qp, sc)) + return -EINVAL; } return 0; @@ -608,11 +614,13 @@ void qp_iter_print(struct seq_file *s, struct qp_iter *iter) struct rvt_qp *qp = iter->qp; struct hfi1_qp_priv *priv = qp->priv; struct sdma_engine *sde; + struct send_context *send_context; sde = qp_to_sdma_engine(qp, priv->s_sc); wqe = rvt_get_swqe_ptr(qp, qp->s_last); + send_context = qp_to_send_context(qp, priv->s_sc); seq_printf(s, - "N %d %s QP%u R %u %s %u %u %u f=%x %u %u %u %u %u PSN %x %x %x %x %x (%u %u %u %u %u %u %u) QP%u LID %x SL %u MTU %u %u %u %u SDE %p,%u\n", + "N %d %s QP%u R %u %s %u %u %u f=%x %u %u %u %u %u PSN %x %x %x %x %x (%u %u %u %u %u %u %u) QP%u LID %x SL %u MTU %u %u %u %u SDE %p,%u SC %p\n", iter->n, qp_idle(qp) ? "I" : "B", qp->ibqp.qp_num, @@ -641,7 +649,8 @@ void qp_iter_print(struct seq_file *s, struct qp_iter *iter) qp->s_retry_cnt, qp->s_rnr_retry_cnt, sde, - sde ? sde->this_idx : 0); + sde ? sde->this_idx : 0, + send_context); } void qp_comm_est(struct rvt_qp *qp) diff --git a/drivers/staging/rdma/hfi1/ud.c b/drivers/staging/rdma/hfi1/ud.c index a7118bca0d2a..1b4b191ced99 100644 --- a/drivers/staging/rdma/hfi1/ud.c +++ b/drivers/staging/rdma/hfi1/ud.c @@ -394,6 +394,7 @@ int hfi1_make_ud_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) priv->s_sc = sc5; } priv->s_sde = qp_to_sdma_engine(qp, priv->s_sc); + priv->s_sendcontext = qp_to_send_context(qp, priv->s_sc); ps->s_txreq->phdr.hdr.lrh[0] = cpu_to_be16(lrh0); ps->s_txreq->phdr.hdr.lrh[1] = cpu_to_be16(ah_attr->dlid); ps->s_txreq->phdr.hdr.lrh[2] = diff --git a/drivers/staging/rdma/hfi1/verbs.h b/drivers/staging/rdma/hfi1/verbs.h index 73f471ae1f57..3d25ad406af7 100644 --- a/drivers/staging/rdma/hfi1/verbs.h +++ b/drivers/staging/rdma/hfi1/verbs.h @@ -199,10 +199,11 @@ struct hfi1_pio_header { * pair is made common */ struct hfi1_qp_priv { - struct ahg_ib_header *s_hdr; /* next packet header to send */ - struct sdma_engine *s_sde; /* current sde */ - u8 s_sc; /* SC[0..4] for next packet */ - u8 r_adefered; /* number of acks defered */ + struct ahg_ib_header *s_hdr; /* next header to send */ + struct sdma_engine *s_sde; /* current sde */ + struct send_context *s_sendcontext; /* current sendcontext */ + u8 s_sc; /* SC[0..4] for next packet */ + u8 r_adefered; /* number of acks defered */ struct iowait s_iowait; struct timer_list s_rnr_timer; struct rvt_qp *owner; |