Lines Matching refs:sq

220 			(n << qp->sq.wqe_shift);
223 (n << qp->sq.wqe_shift)) >>
225 ((qp->send_wqe_offset + (n << qp->sq.wqe_shift)) &
498 qp_attr->cap.max_send_wr = qp->sq.max;
500 qp_attr->cap.max_send_sge = qp->sq.max_gs;
602 if (qp->sq.max)
603 qp_context->sq_size_stride = ilog2(qp->sq.max) << 3;
604 qp_context->sq_size_stride |= qp->sq.wqe_shift - 4;
723 qp_context->snd_db_index = cpu_to_be32(qp->sq.db_index);
824 mthca_wq_reset(&qp->sq);
825 qp->sq.last = get_send_wqe(qp, qp->sq.max - 1);
831 *qp->sq.db = 0;
854 spin_lock_irq(&qp->sq.lock);
858 spin_unlock_irq(&qp->sq.lock);
951 1 << qp->sq.wqe_shift));
955 qp->sq.max_gs = min_t(int, dev->limits.max_sg,
964 * Allocate and register buffer for WQEs. qp->rq.max, sq.max,
965 * rq.max_gs and sq.max_gs must all be assigned.
967 * sq.wqe_shift (as well as send_wqe_offset, is_direct, and
987 size = qp->sq.max_gs * sizeof (struct mthca_data_seg);
1027 for (qp->sq.wqe_shift = 6; 1 << qp->sq.wqe_shift < size;
1028 qp->sq.wqe_shift++)
1032 1 << qp->sq.wqe_shift);
1043 (qp->sq.max << qp->sq.wqe_shift));
1045 qp->wrid = kmalloc((qp->rq.max + qp->sq.max) * sizeof (u64),
1066 (qp->sq.max << qp->sq.wqe_shift)),
1121 qp->sq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_SQ,
1122 qp->qpn, &qp->sq.db);
1123 if (qp->sq.db_index < 0) {
1136 mthca_free_db(dev, MTHCA_DB_TYPE_SQ, qp->sq.db_index);
1159 mthca_wq_reset(&qp->sq);
1162 spin_lock_init(&qp->sq.lock);
1209 for (i = 0; i < qp->sq.max; ++i) {
1211 next->nda_op = cpu_to_be32((((i + 1) & (qp->sq.max - 1)) <<
1212 qp->sq.wqe_shift) +
1224 qp->sq.last = get_send_wqe(qp, qp->sq.max - 1);
1253 qp->sq.max = cap->max_send_wr ?
1257 qp->sq.max = cap->max_send_wr;
1261 qp->sq.max_gs = max_t(int, cap->max_send_sge,
1361 sqp->header_buf_size = sqp->qp.sq.max * MTHCA_UD_HEADER_SIZE;
1626 spin_lock_irqsave(&qp->sq.lock, flags);
1630 ind = qp->sq.next_ind;
1633 if (mthca_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)) {
1636 qp->sq.head, qp->sq.tail,
1637 qp->sq.max, nreq);
1644 prev_wqe = qp->sq.last;
1645 qp->sq.last = wqe;
1729 if (wr->num_sge > qp->sq.max_gs) {
1761 cpu_to_be32(((ind << qp->sq.wqe_shift) +
1778 if (unlikely(ind >= qp->sq.max))
1779 ind -= qp->sq.max;
1786 mthca_write64(((qp->sq.next_ind << qp->sq.wqe_shift) +
1798 qp->sq.next_ind = ind;
1799 qp->sq.head += nreq;
1801 spin_unlock_irqrestore(&qp->sq.lock, flags);
1941 spin_lock_irqsave(&qp->sq.lock, flags);
1945 ind = qp->sq.head & (qp->sq.max - 1);
1952 ((qp->sq.head & 0xffff) << 8) | f0 | op0;
1954 qp->sq.head += MTHCA_ARBEL_MAX_WQES_PER_SEND_DB;
1961 *qp->sq.db = cpu_to_be32(qp->sq.head & 0xffff);
1974 if (mthca_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)) {
1977 qp->sq.head, qp->sq.tail,
1978 qp->sq.max, nreq);
1985 prev_wqe = qp->sq.last;
1986 qp->sq.last = wqe;
2070 if (wr->num_sge > qp->sq.max_gs) {
2102 cpu_to_be32(((ind << qp->sq.wqe_shift) +
2119 if (unlikely(ind >= qp->sq.max))
2120 ind -= qp->sq.max;
2125 dbhi = (nreq << 24) | ((qp->sq.head & 0xffff) << 8) | f0 | op0;
2127 qp->sq.head += nreq;
2134 *qp->sq.db = cpu_to_be32(qp->sq.head & 0xffff);
2152 spin_unlock_irqrestore(&qp->sq.lock, flags);