• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/infiniband/hw/ipath/

Lines Matching refs:qpt

44 #define mk_qpn(qpt, map, off)	(((map) - (qpt)->map) * BITS_PER_PAGE + \
87 static void get_map_page(struct ipath_qp_table *qpt, struct qpn_map *map)
96 spin_lock_irqsave(&qpt->lock, flags);
101 spin_unlock_irqrestore(&qpt->lock, flags);
105 static int alloc_qpn(struct ipath_qp_table *qpt, enum ib_qp_type type)
117 map = &qpt->map[0];
119 get_map_page(qpt, map);
132 qpn = qpt->last + 1;
136 map = &qpt->map[qpn / BITS_PER_PAGE];
137 max_scan = qpt->nmaps - !offset;
140 get_map_page(qpt, map);
148 qpt->last = qpn;
153 qpn = mk_qpn(qpt, map, offset);
170 if (qpt->nmaps == QPNMAP_ENTRIES)
172 map = &qpt->map[qpt->nmaps++];
174 } else if (map < &qpt->map[qpt->nmaps]) {
178 map = &qpt->map[0];
181 qpn = mk_qpn(qpt, map, offset);
190 static void free_qpn(struct ipath_qp_table *qpt, u32 qpn)
194 map = qpt->map + qpn / BITS_PER_PAGE;
202 * @qpt: the QP table
209 static int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp,
215 ret = alloc_qpn(qpt, type);
221 spin_lock_irqsave(&qpt->lock, flags);
223 ret %= qpt->max;
224 qp->next = qpt->table[ret];
225 qpt->table[ret] = qp;
228 spin_unlock_irqrestore(&qpt->lock, flags);
237 * @qpt: the QP table
243 static void ipath_free_qp(struct ipath_qp_table *qpt, struct ipath_qp *qp)
248 spin_lock_irqsave(&qpt->lock, flags);
251 qpp = &qpt->table[qp->ibqp.qp_num % qpt->max];
261 spin_unlock_irqrestore(&qpt->lock, flags);
266 * @qpt: the QP table to empty
271 unsigned ipath_free_all_qps(struct ipath_qp_table *qpt)
277 spin_lock_irqsave(&qpt->lock, flags);
278 for (n = 0; n < qpt->max; n++) {
279 qp = qpt->table[n];
280 qpt->table[n] = NULL;
285 spin_unlock_irqrestore(&qpt->lock, flags);
287 for (n = 0; n < ARRAY_SIZE(qpt->map); n++)
288 if (qpt->map[n].page)
289 free_page((unsigned long) qpt->map[n].page);
295 * @qpt: the QP table
301 struct ipath_qp *ipath_lookup_qpn(struct ipath_qp_table *qpt, u32 qpn)
306 spin_lock_irqsave(&qpt->lock, flags);
308 for (qp = qpt->table[qpn % qpt->max]; qp; qp = qp->next) {
315 spin_unlock_irqrestore(&qpt->lock, flags);