Lines Matching refs:sq
221 (n << qp->sq.wqe_shift); in get_send_wqe()
224 (n << qp->sq.wqe_shift)) >> in get_send_wqe()
226 ((qp->send_wqe_offset + (n << qp->sq.wqe_shift)) & in get_send_wqe()
499 qp_attr->cap.max_send_wr = qp->sq.max; in mthca_query_qp()
501 qp_attr->cap.max_send_sge = qp->sq.max_gs; in mthca_query_qp()
607 if (qp->sq.max) in __mthca_modify_qp()
608 qp_context->sq_size_stride = ilog2(qp->sq.max) << 3; in __mthca_modify_qp()
609 qp_context->sq_size_stride |= qp->sq.wqe_shift - 4; in __mthca_modify_qp()
727 qp_context->snd_db_index = cpu_to_be32(qp->sq.db_index); in __mthca_modify_qp()
828 mthca_wq_reset(&qp->sq); in __mthca_modify_qp()
829 qp->sq.last = get_send_wqe(qp, qp->sq.max - 1); in __mthca_modify_qp()
835 *qp->sq.db = 0; in __mthca_modify_qp()
858 spin_lock_irq(&qp->sq.lock); in mthca_modify_qp()
862 spin_unlock_irq(&qp->sq.lock); in mthca_modify_qp()
955 1 << qp->sq.wqe_shift)); in mthca_adjust_qp_caps()
959 qp->sq.max_gs = min_t(int, dev->limits.max_sg, in mthca_adjust_qp_caps()
992 size = qp->sq.max_gs * sizeof (struct mthca_data_seg); in mthca_alloc_wqe_buf()
1032 for (qp->sq.wqe_shift = 6; 1 << qp->sq.wqe_shift < size; in mthca_alloc_wqe_buf()
1033 qp->sq.wqe_shift++) in mthca_alloc_wqe_buf()
1037 1 << qp->sq.wqe_shift); in mthca_alloc_wqe_buf()
1048 (qp->sq.max << qp->sq.wqe_shift)); in mthca_alloc_wqe_buf()
1050 qp->wrid = kmalloc((qp->rq.max + qp->sq.max) * sizeof (u64), in mthca_alloc_wqe_buf()
1071 (qp->sq.max << qp->sq.wqe_shift)), in mthca_free_wqe_buf()
1125 qp->sq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_SQ, in mthca_alloc_memfree()
1126 qp->qpn, &qp->sq.db); in mthca_alloc_memfree()
1127 if (qp->sq.db_index < 0) { in mthca_alloc_memfree()
1140 mthca_free_db(dev, MTHCA_DB_TYPE_SQ, qp->sq.db_index); in mthca_free_memfree()
1164 mthca_wq_reset(&qp->sq); in mthca_alloc_qp_common()
1167 spin_lock_init(&qp->sq.lock); in mthca_alloc_qp_common()
1214 for (i = 0; i < qp->sq.max; ++i) { in mthca_alloc_qp_common()
1216 next->nda_op = cpu_to_be32((((i + 1) & (qp->sq.max - 1)) << in mthca_alloc_qp_common()
1217 qp->sq.wqe_shift) + in mthca_alloc_qp_common()
1228 qp->sq.last = get_send_wqe(qp, qp->sq.max - 1); in mthca_alloc_qp_common()
1257 qp->sq.max = cap->max_send_wr ? in mthca_set_qp_size()
1261 qp->sq.max = cap->max_send_wr; in mthca_set_qp_size()
1265 qp->sq.max_gs = max_t(int, cap->max_send_sge, in mthca_set_qp_size()
1367 sqp->header_buf_size = sqp->qp.sq.max * MTHCA_UD_HEADER_SIZE; in mthca_alloc_sqp()
1632 spin_lock_irqsave(&qp->sq.lock, flags); in mthca_tavor_post_send()
1636 ind = qp->sq.next_ind; in mthca_tavor_post_send()
1639 if (mthca_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)) { in mthca_tavor_post_send()
1642 qp->sq.head, qp->sq.tail, in mthca_tavor_post_send()
1643 qp->sq.max, nreq); in mthca_tavor_post_send()
1650 prev_wqe = qp->sq.last; in mthca_tavor_post_send()
1651 qp->sq.last = wqe; in mthca_tavor_post_send()
1735 if (wr->num_sge > qp->sq.max_gs) { in mthca_tavor_post_send()
1767 cpu_to_be32(((ind << qp->sq.wqe_shift) + in mthca_tavor_post_send()
1784 if (unlikely(ind >= qp->sq.max)) in mthca_tavor_post_send()
1785 ind -= qp->sq.max; in mthca_tavor_post_send()
1792 mthca_write64(((qp->sq.next_ind << qp->sq.wqe_shift) + in mthca_tavor_post_send()
1804 qp->sq.next_ind = ind; in mthca_tavor_post_send()
1805 qp->sq.head += nreq; in mthca_tavor_post_send()
1807 spin_unlock_irqrestore(&qp->sq.lock, flags); in mthca_tavor_post_send()
1947 spin_lock_irqsave(&qp->sq.lock, flags); in mthca_arbel_post_send()
1951 ind = qp->sq.head & (qp->sq.max - 1); in mthca_arbel_post_send()
1958 ((qp->sq.head & 0xffff) << 8) | f0 | op0; in mthca_arbel_post_send()
1960 qp->sq.head += MTHCA_ARBEL_MAX_WQES_PER_SEND_DB; in mthca_arbel_post_send()
1967 *qp->sq.db = cpu_to_be32(qp->sq.head & 0xffff); in mthca_arbel_post_send()
1980 if (mthca_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)) { in mthca_arbel_post_send()
1983 qp->sq.head, qp->sq.tail, in mthca_arbel_post_send()
1984 qp->sq.max, nreq); in mthca_arbel_post_send()
1991 prev_wqe = qp->sq.last; in mthca_arbel_post_send()
1992 qp->sq.last = wqe; in mthca_arbel_post_send()
2076 if (wr->num_sge > qp->sq.max_gs) { in mthca_arbel_post_send()
2108 cpu_to_be32(((ind << qp->sq.wqe_shift) + in mthca_arbel_post_send()
2125 if (unlikely(ind >= qp->sq.max)) in mthca_arbel_post_send()
2126 ind -= qp->sq.max; in mthca_arbel_post_send()
2131 dbhi = (nreq << 24) | ((qp->sq.head & 0xffff) << 8) | f0 | op0; in mthca_arbel_post_send()
2133 qp->sq.head += nreq; in mthca_arbel_post_send()
2140 *qp->sq.db = cpu_to_be32(qp->sq.head & 0xffff); in mthca_arbel_post_send()
2158 spin_unlock_irqrestore(&qp->sq.lock, flags); in mthca_arbel_post_send()