diff options
author | Jubin John <jubin.john@intel.com> | 2016-02-14 12:46:10 -0800 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-03-10 20:38:15 -0500 |
commit | 35f6befc8441d20724a41bafc810b7c8f5a92986 (patch) | |
tree | f2f139f6a88330c547f4db639f03f5964b9e5966 /drivers/staging/rdma/hfi1/qp.c | |
parent | staging/rdma/hfi: fix CQ completion order issue (diff) | |
download | linux-dev-35f6befc8441d20724a41bafc810b7c8f5a92986.tar.xz linux-dev-35f6befc8441d20724a41bafc810b7c8f5a92986.zip |
staging/rdma/hfi1: Add qp to send context mapping for PIO
PIO send context mapping is changed from per-VL to QPN based.
qp to send context mapping is done using a mapping infrastructure
similar to the current vl to sdma engine mapping.
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1/qp.c')
-rw-r--r-- | drivers/staging/rdma/hfi1/qp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c index 77e91f280b21..76d6a364da2d 100644 --- a/drivers/staging/rdma/hfi1/qp.c +++ b/drivers/staging/rdma/hfi1/qp.c @@ -552,6 +552,30 @@ struct sdma_engine *qp_to_sdma_engine(struct rvt_qp *qp, u8 sc5) return sde; } +/* + * qp_to_send_context - map a qp to a send context + * @qp: the QP + * @sc5: the 5 bit sc + * + * Return: + * A send context for the qp + */ +struct send_context *qp_to_send_context(struct rvt_qp *qp, u8 sc5) +{ + struct hfi1_devdata *dd = dd_from_ibdev(qp->ibqp.device); + + switch (qp->ibqp.qp_type) { + case IB_QPT_SMI: + /* SMA packets to VL15 */ + return dd->vld[15].sc; + default: + break; + } + + return pio_select_send_context_sc(dd, qp->ibqp.qp_num >> dd->qos_shift, + sc5); +} + struct qp_iter { struct hfi1_ibdev *dev; struct rvt_qp *qp; |