Lines Matching refs:qpn
127 u32 i, offset, max_scan, qpn; in alloc_qpn() local
145 qpn = qpt->last + 2; in alloc_qpn()
146 if (qpn >= QPN_MAX) in alloc_qpn()
147 qpn = 2; in alloc_qpn()
148 if (qpt->mask && ((qpn & qpt->mask) >> 1) >= dd->n_krcv_queues) in alloc_qpn()
149 qpn = (qpn | qpt->mask) + 2; in alloc_qpn()
150 offset = qpn & RVT_BITS_PER_PAGE_MASK; in alloc_qpn()
151 map = &qpt->map[qpn / RVT_BITS_PER_PAGE]; in alloc_qpn()
161 qpt->last = qpn; in alloc_qpn()
162 ret = qpn; in alloc_qpn()
167 qpn = mk_qpn(qpt, map, offset); in alloc_qpn()
176 } while (offset < RVT_BITS_PER_PAGE && qpn < QPN_MAX); in alloc_qpn()
194 qpn = mk_qpn(qpt, map, offset); in alloc_qpn()
203 static void free_qpn(struct qib_qpn_table *qpt, u32 qpn) in free_qpn() argument
207 map = qpt->map + qpn / RVT_BITS_PER_PAGE; in free_qpn()
209 clear_bit(qpn & RVT_BITS_PER_PAGE_MASK, map->page); in free_qpn()
212 static inline unsigned qpn_hash(struct qib_ibdev *dev, u32 qpn) in qpn_hash() argument
214 return jhash_1word(qpn, dev->qp_rnd) & in qpn_hash()
339 struct qib_qp *qib_lookup_qpn(struct qib_ibport *ibp, u32 qpn) in qib_lookup_qpn() argument
344 if (unlikely(qpn <= 1)) { in qib_lookup_qpn()
345 if (qpn == 0) in qib_lookup_qpn()
353 unsigned n = qpn_hash(dev, qpn); in qib_lookup_qpn()
357 if (qp->ibqp.qp_num == qpn) { in qib_lookup_qpn()