Lines Matching refs:sq

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