diff options
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_qp.c')
| -rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index bcef06bf15e7..5fa00669f9b8 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
| @@ -227,7 +227,6 @@ static void mthca_wq_init(struct mthca_wq *wq) | |||
| 227 | wq->last_comp = wq->max - 1; | 227 | wq->last_comp = wq->max - 1; |
| 228 | wq->head = 0; | 228 | wq->head = 0; |
| 229 | wq->tail = 0; | 229 | wq->tail = 0; |
| 230 | wq->last = NULL; | ||
| 231 | } | 230 | } |
| 232 | 231 | ||
| 233 | void mthca_qp_event(struct mthca_dev *dev, u32 qpn, | 232 | void mthca_qp_event(struct mthca_dev *dev, u32 qpn, |
| @@ -687,7 +686,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) | |||
| 687 | } | 686 | } |
| 688 | 687 | ||
| 689 | if (attr_mask & IB_QP_TIMEOUT) { | 688 | if (attr_mask & IB_QP_TIMEOUT) { |
| 690 | qp_context->pri_path.ackto = attr->timeout; | 689 | qp_context->pri_path.ackto = attr->timeout << 3; |
| 691 | qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_ACK_TIMEOUT); | 690 | qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_ACK_TIMEOUT); |
| 692 | } | 691 | } |
| 693 | 692 | ||
| @@ -1103,6 +1102,9 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev, | |||
| 1103 | } | 1102 | } |
| 1104 | } | 1103 | } |
| 1105 | 1104 | ||
| 1105 | qp->sq.last = get_send_wqe(qp, qp->sq.max - 1); | ||
| 1106 | qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1); | ||
| 1107 | |||
| 1106 | return 0; | 1108 | return 0; |
| 1107 | } | 1109 | } |
| 1108 | 1110 | ||
| @@ -1583,15 +1585,13 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 1583 | goto out; | 1585 | goto out; |
| 1584 | } | 1586 | } |
| 1585 | 1587 | ||
| 1586 | if (prev_wqe) { | 1588 | ((struct mthca_next_seg *) prev_wqe)->nda_op = |
| 1587 | ((struct mthca_next_seg *) prev_wqe)->nda_op = | 1589 | cpu_to_be32(((ind << qp->sq.wqe_shift) + |
| 1588 | cpu_to_be32(((ind << qp->sq.wqe_shift) + | 1590 | qp->send_wqe_offset) | |
| 1589 | qp->send_wqe_offset) | | 1591 | mthca_opcode[wr->opcode]); |
| 1590 | mthca_opcode[wr->opcode]); | 1592 | wmb(); |
| 1591 | wmb(); | 1593 | ((struct mthca_next_seg *) prev_wqe)->ee_nds = |
| 1592 | ((struct mthca_next_seg *) prev_wqe)->ee_nds = | 1594 | cpu_to_be32((size0 ? 0 : MTHCA_NEXT_DBD) | size); |
| 1593 | cpu_to_be32((size0 ? 0 : MTHCA_NEXT_DBD) | size); | ||
| 1594 | } | ||
| 1595 | 1595 | ||
| 1596 | if (!size0) { | 1596 | if (!size0) { |
| 1597 | size0 = size; | 1597 | size0 = size; |
| @@ -1688,13 +1688,11 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, | |||
| 1688 | 1688 | ||
| 1689 | qp->wrid[ind] = wr->wr_id; | 1689 | qp->wrid[ind] = wr->wr_id; |
| 1690 | 1690 | ||
| 1691 | if (likely(prev_wqe)) { | 1691 | ((struct mthca_next_seg *) prev_wqe)->nda_op = |
| 1692 | ((struct mthca_next_seg *) prev_wqe)->nda_op = | 1692 | cpu_to_be32((ind << qp->rq.wqe_shift) | 1); |
| 1693 | cpu_to_be32((ind << qp->rq.wqe_shift) | 1); | 1693 | wmb(); |
| 1694 | wmb(); | 1694 | ((struct mthca_next_seg *) prev_wqe)->ee_nds = |
| 1695 | ((struct mthca_next_seg *) prev_wqe)->ee_nds = | 1695 | cpu_to_be32(MTHCA_NEXT_DBD | size); |
| 1696 | cpu_to_be32(MTHCA_NEXT_DBD | size); | ||
| 1697 | } | ||
| 1698 | 1696 | ||
| 1699 | if (!size0) | 1697 | if (!size0) |
| 1700 | size0 = size; | 1698 | size0 = size; |
| @@ -1905,15 +1903,13 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 1905 | goto out; | 1903 | goto out; |
| 1906 | } | 1904 | } |
| 1907 | 1905 | ||
| 1908 | if (likely(prev_wqe)) { | 1906 | ((struct mthca_next_seg *) prev_wqe)->nda_op = |
| 1909 | ((struct mthca_next_seg *) prev_wqe)->nda_op = | 1907 | cpu_to_be32(((ind << qp->sq.wqe_shift) + |
| 1910 | cpu_to_be32(((ind << qp->sq.wqe_shift) + | 1908 | qp->send_wqe_offset) | |
| 1911 | qp->send_wqe_offset) | | 1909 | mthca_opcode[wr->opcode]); |
| 1912 | mthca_opcode[wr->opcode]); | 1910 | wmb(); |
| 1913 | wmb(); | 1911 | ((struct mthca_next_seg *) prev_wqe)->ee_nds = |
| 1914 | ((struct mthca_next_seg *) prev_wqe)->ee_nds = | 1912 | cpu_to_be32(MTHCA_NEXT_DBD | size); |
| 1915 | cpu_to_be32(MTHCA_NEXT_DBD | size); | ||
| 1916 | } | ||
| 1917 | 1913 | ||
| 1918 | if (!size0) { | 1914 | if (!size0) { |
| 1919 | size0 = size; | 1915 | size0 = size; |
| @@ -2127,5 +2123,6 @@ void __devexit mthca_cleanup_qp_table(struct mthca_dev *dev) | |||
| 2127 | for (i = 0; i < 2; ++i) | 2123 | for (i = 0; i < 2; ++i) |
| 2128 | mthca_CONF_SPECIAL_QP(dev, i, 0, &status); | 2124 | mthca_CONF_SPECIAL_QP(dev, i, 0, &status); |
| 2129 | 2125 | ||
| 2126 | mthca_array_cleanup(&dev->qp_table.qp, dev->limits.num_qps); | ||
| 2130 | mthca_alloc_cleanup(&dev->qp_table.alloc); | 2127 | mthca_alloc_cleanup(&dev->qp_table.alloc); |
| 2131 | } | 2128 | } |
