Lines Matching refs:rq
211 return qp->queue.direct.buf + (n << qp->rq.wqe_shift); in get_recv_wqe()
213 return qp->queue.page_list[(n << qp->rq.wqe_shift) >> PAGE_SHIFT].buf + in get_recv_wqe()
214 ((n << qp->rq.wqe_shift) & (PAGE_SIZE - 1)); in get_recv_wqe()
500 qp_attr->cap.max_recv_wr = qp->rq.max; in mthca_query_qp()
502 qp_attr->cap.max_recv_sge = qp->rq.max_gs; in mthca_query_qp()
603 if (qp->rq.max) in __mthca_modify_qp()
604 qp_context->rq_size_stride = ilog2(qp->rq.max) << 3; in __mthca_modify_qp()
605 qp_context->rq_size_stride |= qp->rq.wqe_shift - 4; in __mthca_modify_qp()
765 qp_context->rcv_db_index = cpu_to_be32(qp->rq.db_index); in __mthca_modify_qp()
831 mthca_wq_reset(&qp->rq); in __mthca_modify_qp()
832 qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1); in __mthca_modify_qp()
836 *qp->rq.db = 0; in __mthca_modify_qp()
859 spin_lock(&qp->rq.lock); in mthca_modify_qp()
861 spin_unlock(&qp->rq.lock); in mthca_modify_qp()
961 qp->rq.max_gs = min_t(int, dev->limits.max_sg, in mthca_adjust_qp_caps()
962 (min(dev->limits.max_desc_sz, 1 << qp->rq.wqe_shift) - in mthca_adjust_qp_caps()
983 qp->rq.max_gs * sizeof (struct mthca_data_seg); in mthca_alloc_wqe_buf()
988 for (qp->rq.wqe_shift = 6; 1 << qp->rq.wqe_shift < size; in mthca_alloc_wqe_buf()
989 qp->rq.wqe_shift++) in mthca_alloc_wqe_buf()
1036 qp->send_wqe_offset = ALIGN(qp->rq.max << qp->rq.wqe_shift, in mthca_alloc_wqe_buf()
1050 qp->wrid = kmalloc((qp->rq.max + qp->sq.max) * sizeof (u64), in mthca_alloc_wqe_buf()
1120 qp->rq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_RQ, in mthca_alloc_memfree()
1121 qp->qpn, &qp->rq.db); in mthca_alloc_memfree()
1122 if (qp->rq.db_index < 0) in mthca_alloc_memfree()
1128 mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index); in mthca_alloc_memfree()
1141 mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index); in mthca_free_memfree()
1165 mthca_wq_reset(&qp->rq); in mthca_alloc_qp_common()
1168 spin_lock_init(&qp->rq.lock); in mthca_alloc_qp_common()
1200 qp->rq.max_gs * sizeof (struct mthca_data_seg)) / 16; in mthca_alloc_qp_common()
1202 for (i = 0; i < qp->rq.max; ++i) { in mthca_alloc_qp_common()
1204 next->nda_op = cpu_to_be32(((i + 1) & (qp->rq.max - 1)) << in mthca_alloc_qp_common()
1205 qp->rq.wqe_shift); in mthca_alloc_qp_common()
1209 (void *) scatter < (void *) next + (1 << qp->rq.wqe_shift); in mthca_alloc_qp_common()
1221 for (i = 0; i < qp->rq.max; ++i) { in mthca_alloc_qp_common()
1223 next->nda_op = htonl((((i + 1) % qp->rq.max) << in mthca_alloc_qp_common()
1224 qp->rq.wqe_shift) | 1); in mthca_alloc_qp_common()
1229 qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1); in mthca_alloc_qp_common()
1255 qp->rq.max = cap->max_recv_wr ? in mthca_set_qp_size()
1260 qp->rq.max = cap->max_recv_wr; in mthca_set_qp_size()
1264 qp->rq.max_gs = cap->max_recv_sge; in mthca_set_qp_size()
1757 qp->wrid[ind + qp->rq.max] = wr->wr_id; in mthca_tavor_post_send()
1833 spin_lock_irqsave(&qp->rq.lock, flags); in mthca_tavor_post_receive()
1837 ind = qp->rq.next_ind; in mthca_tavor_post_receive()
1840 if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) { in mthca_tavor_post_receive()
1843 qp->rq.head, qp->rq.tail, in mthca_tavor_post_receive()
1844 qp->rq.max, nreq); in mthca_tavor_post_receive()
1851 prev_wqe = qp->rq.last; in mthca_tavor_post_receive()
1852 qp->rq.last = wqe; in mthca_tavor_post_receive()
1861 if (unlikely(wr->num_sge > qp->rq.max_gs)) { in mthca_tavor_post_receive()
1882 if (unlikely(ind >= qp->rq.max)) in mthca_tavor_post_receive()
1883 ind -= qp->rq.max; in mthca_tavor_post_receive()
1891 mthca_write64((qp->rq.next_ind << qp->rq.wqe_shift) | size0, in mthca_tavor_post_receive()
1895 qp->rq.next_ind = ind; in mthca_tavor_post_receive()
1896 qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB; in mthca_tavor_post_receive()
1904 mthca_write64((qp->rq.next_ind << qp->rq.wqe_shift) | size0, in mthca_tavor_post_receive()
1909 qp->rq.next_ind = ind; in mthca_tavor_post_receive()
1910 qp->rq.head += nreq; in mthca_tavor_post_receive()
1918 spin_unlock_irqrestore(&qp->rq.lock, flags); in mthca_tavor_post_receive()
2098 qp->wrid[ind + qp->rq.max] = wr->wr_id; in mthca_arbel_post_send()
2174 spin_lock_irqsave(&qp->rq.lock, flags); in mthca_arbel_post_receive()
2178 ind = qp->rq.head & (qp->rq.max - 1); in mthca_arbel_post_receive()
2181 if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) { in mthca_arbel_post_receive()
2184 qp->rq.head, qp->rq.tail, in mthca_arbel_post_receive()
2185 qp->rq.max, nreq); in mthca_arbel_post_receive()
2197 if (unlikely(wr->num_sge > qp->rq.max_gs)) { in mthca_arbel_post_receive()
2208 if (i < qp->rq.max_gs) in mthca_arbel_post_receive()
2214 if (unlikely(ind >= qp->rq.max)) in mthca_arbel_post_receive()
2215 ind -= qp->rq.max; in mthca_arbel_post_receive()
2219 qp->rq.head += nreq; in mthca_arbel_post_receive()
2226 *qp->rq.db = cpu_to_be32(qp->rq.head & 0xffff); in mthca_arbel_post_receive()
2229 spin_unlock_irqrestore(&qp->rq.lock, flags); in mthca_arbel_post_receive()