Lines Matching refs:qp_table
216 struct hns_roce_qp_table *qp_table = &hr_dev->qp_table; in alloc_qpn() local
231 mutex_lock(&qp_table->bank_mutex); in alloc_qpn()
232 bankid = get_least_load_bankid_for_qp(qp_table->bank); in alloc_qpn()
234 ret = alloc_qpn_with_bankid(&qp_table->bank[bankid], bankid, in alloc_qpn()
239 mutex_unlock(&qp_table->bank_mutex); in alloc_qpn()
243 qp_table->bank[bankid].inuse++; in alloc_qpn()
244 mutex_unlock(&qp_table->bank_mutex); in alloc_qpn()
320 struct hns_roce_qp_table *qp_table = &hr_dev->qp_table; in alloc_qpc() local
333 ret = hns_roce_table_get(hr_dev, &qp_table->qp_table, hr_qp->qpn); in alloc_qpc()
340 ret = hns_roce_table_get(hr_dev, &qp_table->irrl_table, hr_qp->qpn); in alloc_qpc()
348 ret = hns_roce_table_get(hr_dev, &qp_table->trrl_table, in alloc_qpc()
358 ret = hns_roce_table_get(hr_dev, &qp_table->sccc_table, in alloc_qpc()
370 hns_roce_table_put(hr_dev, &qp_table->trrl_table, hr_qp->qpn); in alloc_qpc()
373 hns_roce_table_put(hr_dev, &qp_table->irrl_table, hr_qp->qpn); in alloc_qpc()
376 hns_roce_table_put(hr_dev, &qp_table->qp_table, hr_qp->qpn); in alloc_qpc()
403 struct hns_roce_qp_table *qp_table = &hr_dev->qp_table; in free_qpc() local
411 hns_roce_table_put(hr_dev, &qp_table->trrl_table, hr_qp->qpn); in free_qpc()
412 hns_roce_table_put(hr_dev, &qp_table->irrl_table, hr_qp->qpn); in free_qpc()
433 ida_free(&hr_dev->qp_table.bank[bankid].ida, hr_qp->qpn >> 3); in free_qpn()
435 mutex_lock(&hr_dev->qp_table.bank_mutex); in free_qpn()
436 hr_dev->qp_table.bank[bankid].inuse--; in free_qpn()
437 mutex_unlock(&hr_dev->qp_table.bank_mutex); in free_qpn()
1434 struct hns_roce_qp_table *qp_table = &hr_dev->qp_table; in hns_roce_init_qp_table() local
1438 qp_table->idx_table.spare_idx = kcalloc(hr_dev->caps.num_qps, in hns_roce_init_qp_table()
1440 if (!qp_table->idx_table.spare_idx) in hns_roce_init_qp_table()
1443 mutex_init(&qp_table->scc_mutex); in hns_roce_init_qp_table()
1444 mutex_init(&qp_table->bank_mutex); in hns_roce_init_qp_table()
1450 hr_dev->qp_table.bank[get_qp_bankid(i)].inuse++; in hns_roce_init_qp_table()
1451 hr_dev->qp_table.bank[get_qp_bankid(i)].min++; in hns_roce_init_qp_table()
1455 ida_init(&hr_dev->qp_table.bank[i].ida); in hns_roce_init_qp_table()
1456 hr_dev->qp_table.bank[i].max = hr_dev->caps.num_qps / in hns_roce_init_qp_table()
1458 hr_dev->qp_table.bank[i].next = hr_dev->qp_table.bank[i].min; in hns_roce_init_qp_table()
1469 ida_destroy(&hr_dev->qp_table.bank[i].ida); in hns_roce_cleanup_qp_table()
1470 kfree(hr_dev->qp_table.idx_table.spare_idx); in hns_roce_cleanup_qp_table()