aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNaresh Gottumukkala <bgottumukkala@emulex.com>2013-08-26 05:57:43 -0400
committerRoland Dreier <roland@purestorage.com>2013-09-03 00:17:56 -0400
commit2b51a9b9eb6bf240d2592e10d2f8823dd1f5ee3e (patch)
tree69d44d3214f7243f05951ff9dd26302f83b258de /drivers
parentf11220ee69f72cf08479f28fd494264ac6a9349b (diff)
RDMA/ocrdma: FRMA code cleanup
1) Fixed setting FR_MR bit for FRWR stag allocation 2) Access rights are passsed during FRWR stage and not during STAT allocation stage 3) FRWR WQE structure cleanup 4) Add QP level signaled bit. Signed-off-by: Naresh Gottumukkala <bgottumukkala@emulex.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma.h1
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_hw.c2
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_sli.h16
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_verbs.c8
4 files changed, 15 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index 9cc966ab3b5a..1c8ba4cefcba 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -289,6 +289,7 @@ struct ocrdma_qp {
289 u32 qkey; 289 u32 qkey;
290 bool dpp_enabled; 290 bool dpp_enabled;
291 u8 *ird_q_va; 291 u8 *ird_q_va;
292 bool signaled;
292 u16 db_cache; 293 u16 db_cache;
293}; 294};
294 295
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 2c2991b7dae0..16ce664dc466 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -1500,6 +1500,7 @@ static int ocrdma_mbx_reg_mr(struct ocrdma_dev *dev, struct ocrdma_hw_mr *hwmr,
1500 return -ENOMEM; 1500 return -ENOMEM;
1501 cmd->num_pbl_pdid = 1501 cmd->num_pbl_pdid =
1502 pdid | (hwmr->num_pbls << OCRDMA_REG_NSMR_NUM_PBL_SHIFT); 1502 pdid | (hwmr->num_pbls << OCRDMA_REG_NSMR_NUM_PBL_SHIFT);
1503 cmd->fr_mr = hwmr->fr_mr;
1503 1504
1504 cmd->flags_hpage_pbe_sz |= (hwmr->remote_wr << 1505 cmd->flags_hpage_pbe_sz |= (hwmr->remote_wr <<
1505 OCRDMA_REG_NSMR_REMOTE_WR_SHIFT); 1506 OCRDMA_REG_NSMR_REMOTE_WR_SHIFT);
@@ -2049,6 +2050,7 @@ static int ocrdma_set_av_params(struct ocrdma_qp *qp,
2049 (ah_attr->grh.traffic_class << OCRDMA_QP_PARAMS_TCLASS_SHIFT); 2050 (ah_attr->grh.traffic_class << OCRDMA_QP_PARAMS_TCLASS_SHIFT);
2050 cmd->params.rnt_rc_sl_fl |= 2051 cmd->params.rnt_rc_sl_fl |=
2051 (ah_attr->grh.flow_label & OCRDMA_QP_PARAMS_FLOW_LABEL_MASK); 2052 (ah_attr->grh.flow_label & OCRDMA_QP_PARAMS_FLOW_LABEL_MASK);
2053 cmd->params.rnt_rc_sl_fl |= (ah_attr->sl << OCRDMA_QP_PARAMS_SL_SHIFT);
2052 cmd->params.hop_lmt_rq_psn |= 2054 cmd->params.hop_lmt_rq_psn |=
2053 (ah_attr->grh.hop_limit << OCRDMA_QP_PARAMS_HOP_LMT_SHIFT); 2055 (ah_attr->grh.hop_limit << OCRDMA_QP_PARAMS_HOP_LMT_SHIFT);
2054 cmd->flags |= OCRDMA_QP_PARA_FLOW_LBL_VALID; 2056 cmd->flags |= OCRDMA_QP_PARA_FLOW_LBL_VALID;
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h
index bfd0acb5659d..d1a9fb72a4bd 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h
@@ -143,8 +143,11 @@ enum {
143# 2: 16K Bytes 143# 2: 16K Bytes
144# 3: 32K Bytes 144# 3: 32K Bytes
145# 4: 64K Bytes 145# 4: 64K Bytes
146# 5: 128K Bytes
147# 6: 256K Bytes
148# 7: 512K Bytes
146*/ 149*/
147#define OCRDMA_MAX_Q_PAGE_SIZE_CNT (5) 150#define OCRDMA_MAX_Q_PAGE_SIZE_CNT (8)
148#define OCRDMA_Q_PAGE_BASE_SIZE (OCRDMA_MIN_Q_PAGE_SIZE * OCRDMA_MAX_Q_PAGES) 151#define OCRDMA_Q_PAGE_BASE_SIZE (OCRDMA_MIN_Q_PAGE_SIZE * OCRDMA_MAX_Q_PAGES)
149 152
150#define MAX_OCRDMA_QP_PAGES (8) 153#define MAX_OCRDMA_QP_PAGES (8)
@@ -1274,7 +1277,7 @@ struct ocrdma_reg_nsmr {
1274 struct ocrdma_mqe_hdr hdr; 1277 struct ocrdma_mqe_hdr hdr;
1275 struct ocrdma_mbx_hdr cmd; 1278 struct ocrdma_mbx_hdr cmd;
1276 1279
1277 u32 lrkey_key_index; 1280 u32 fr_mr;
1278 u32 num_pbl_pdid; 1281 u32 num_pbl_pdid;
1279 u32 flags_hpage_pbe_sz; 1282 u32 flags_hpage_pbe_sz;
1280 u32 totlen_low; 1283 u32 totlen_low;
@@ -1611,12 +1614,6 @@ struct ocrdma_ewqe_ud_hdr {
1611 u32 rsvd; 1614 u32 rsvd;
1612}; 1615};
1613 1616
1614#define OCRDMA_MAX_FR_PBES 11
1615struct ocrdma_fr_pbe {
1616 u32 pa_hi;
1617 u32 pa_lo;
1618};
1619
1620/* extended wqe followed by hdr_wqe for Fast Memory register */ 1617/* extended wqe followed by hdr_wqe for Fast Memory register */
1621struct ocrdma_ewqe_fr { 1618struct ocrdma_ewqe_fr {
1622 u32 va_hi; 1619 u32 va_hi;
@@ -1625,7 +1622,8 @@ struct ocrdma_ewqe_fr {
1625 u32 fbo_lo; 1622 u32 fbo_lo;
1626 u32 size_sge; 1623 u32 size_sge;
1627 u32 num_sges; 1624 u32 num_sges;
1628 struct ocrdma_fr_pbe pbe[0]; 1625 u32 rsvd;
1626 u32 rsvd2;
1629}; 1627};
1630 1628
1631struct ocrdma_eth_basic { 1629struct ocrdma_eth_basic {
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 9e1d8c6bde52..3e80f65f42a3 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -82,7 +82,8 @@ int ocrdma_query_device(struct ib_device *ibdev, struct ib_device_attr *attr)
82 IB_DEVICE_RC_RNR_NAK_GEN | 82 IB_DEVICE_RC_RNR_NAK_GEN |
83 IB_DEVICE_SHUTDOWN_PORT | 83 IB_DEVICE_SHUTDOWN_PORT |
84 IB_DEVICE_SYS_IMAGE_GUID | 84 IB_DEVICE_SYS_IMAGE_GUID |
85 IB_DEVICE_LOCAL_DMA_LKEY; 85 IB_DEVICE_LOCAL_DMA_LKEY |
86 IB_DEVICE_MEM_MGT_EXTENSIONS;
86 attr->max_sge = min(dev->attr.max_send_sge, dev->attr.max_srq_sge); 87 attr->max_sge = min(dev->attr.max_send_sge, dev->attr.max_srq_sge);
87 attr->max_sge_rd = dev->attr.max_rdma_sge; 88 attr->max_sge_rd = dev->attr.max_rdma_sge;
88 attr->max_cq = dev->attr.max_cq; 89 attr->max_cq = dev->attr.max_cq;
@@ -1015,6 +1016,7 @@ static void ocrdma_set_qp_init_params(struct ocrdma_qp *qp,
1015 qp->sq.max_sges = attrs->cap.max_send_sge; 1016 qp->sq.max_sges = attrs->cap.max_send_sge;
1016 qp->rq.max_sges = attrs->cap.max_recv_sge; 1017 qp->rq.max_sges = attrs->cap.max_recv_sge;
1017 qp->state = OCRDMA_QPS_RST; 1018 qp->state = OCRDMA_QPS_RST;
1019 qp->signaled = (attrs->sq_sig_type == IB_SIGNAL_ALL_WR) ? true : false;
1018} 1020}
1019 1021
1020 1022
@@ -1864,7 +1866,7 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1864 } 1866 }
1865 hdr = ocrdma_hwq_head(&qp->sq); 1867 hdr = ocrdma_hwq_head(&qp->sq);
1866 hdr->cw = 0; 1868 hdr->cw = 0;
1867 if (wr->send_flags & IB_SEND_SIGNALED) 1869 if (wr->send_flags & IB_SEND_SIGNALED || qp->signaled)
1868 hdr->cw |= (OCRDMA_FLAG_SIG << OCRDMA_WQE_FLAGS_SHIFT); 1870 hdr->cw |= (OCRDMA_FLAG_SIG << OCRDMA_WQE_FLAGS_SHIFT);
1869 if (wr->send_flags & IB_SEND_FENCE) 1871 if (wr->send_flags & IB_SEND_FENCE)
1870 hdr->cw |= 1872 hdr->cw |=
@@ -1918,7 +1920,7 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
1918 *bad_wr = wr; 1920 *bad_wr = wr;
1919 break; 1921 break;
1920 } 1922 }
1921 if (wr->send_flags & IB_SEND_SIGNALED) 1923 if (wr->send_flags & IB_SEND_SIGNALED || qp->signaled)
1922 qp->wqe_wr_id_tbl[qp->sq.head].signaled = 1; 1924 qp->wqe_wr_id_tbl[qp->sq.head].signaled = 1;
1923 else 1925 else
1924 qp->wqe_wr_id_tbl[qp->sq.head].signaled = 0; 1926 qp->wqe_wr_id_tbl[qp->sq.head].signaled = 0;