• Home
  • Raw
  • Download

Lines Matching refs:qpt

265 static void get_map_page(struct rvt_qpn_table *qpt,  in get_map_page()  argument
274 spin_lock(&qpt->lock); in get_map_page()
279 spin_unlock(&qpt->lock); in get_map_page()
287 static int init_qpn_table(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt) in init_qpn_table() argument
296 spin_lock_init(&qpt->lock); in init_qpn_table()
298 qpt->last = rdi->dparms.qpn_start; in init_qpn_table()
299 qpt->incr = rdi->dparms.qpn_inc << rdi->dparms.qos_shift; in init_qpn_table()
309 qpt->nmaps = rdi->dparms.qpn_res_start / RVT_BITS_PER_PAGE; in init_qpn_table()
315 map = &qpt->map[qpt->nmaps]; in init_qpn_table()
321 get_map_page(qpt, map); in init_qpn_table()
331 qpt->nmaps++; in init_qpn_table()
343 static void free_qpn_table(struct rvt_qpn_table *qpt) in free_qpn_table() argument
347 for (i = 0; i < ARRAY_SIZE(qpt->map); i++) in free_qpn_table()
348 free_page((unsigned long)qpt->map[i].page); in free_qpn_table()
473 static inline unsigned mk_qpn(struct rvt_qpn_table *qpt, in mk_qpn() argument
476 return (map - qpt->map) * RVT_BITS_PER_PAGE + off; in mk_qpn()
490 static int alloc_qpn(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt, in alloc_qpn() argument
500 return rdi->driver_f.alloc_qpn(rdi, qpt, type, port_num); in alloc_qpn()
507 spin_lock(&qpt->lock); in alloc_qpn()
508 if (qpt->flags & n) in alloc_qpn()
511 qpt->flags |= n; in alloc_qpn()
512 spin_unlock(&qpt->lock); in alloc_qpn()
516 qpn = qpt->last + qpt->incr; in alloc_qpn()
518 qpn = qpt->incr | ((qpt->last & 1) ^ 1); in alloc_qpn()
521 map = &qpt->map[qpn / RVT_BITS_PER_PAGE]; in alloc_qpn()
522 max_scan = qpt->nmaps - !offset; in alloc_qpn()
525 get_map_page(qpt, map); in alloc_qpn()
531 qpt->last = qpn; in alloc_qpn()
535 offset += qpt->incr; in alloc_qpn()
540 qpn = mk_qpn(qpt, map, offset); in alloc_qpn()
548 if (qpt->nmaps == RVT_QPNMAP_ENTRIES) in alloc_qpn()
550 map = &qpt->map[qpt->nmaps++]; in alloc_qpn()
552 offset = qpt->incr | (offset & 1); in alloc_qpn()
553 } else if (map < &qpt->map[qpt->nmaps]) { in alloc_qpn()
556 offset = qpt->incr | (offset & 1); in alloc_qpn()
558 map = &qpt->map[0]; in alloc_qpn()
560 offset = qpt->incr | ((offset & 1) ^ 1); in alloc_qpn()
565 qpn = mk_qpn(qpt, map, offset); in alloc_qpn()
948 static void rvt_free_qpn(struct rvt_qpn_table *qpt, u32 qpn) in rvt_free_qpn() argument
955 map = qpt->map + (qpn & RVT_QPN_MASK) / RVT_BITS_PER_PAGE; in rvt_free_qpn()