|
@@ -1106,14 +1106,20 @@ int hns_roce_init_qp_table(struct hns_roce_dev *hr_dev)
|
|
|
{
|
|
|
struct hns_roce_qp_table *qp_table = &hr_dev->qp_table;
|
|
|
int reserved_from_top = 0;
|
|
|
+ int reserved_from_bot;
|
|
|
int ret;
|
|
|
|
|
|
spin_lock_init(&qp_table->lock);
|
|
|
INIT_RADIX_TREE(&hr_dev->qp_table_tree, GFP_ATOMIC);
|
|
|
|
|
|
- /* A port include two SQP, six port total 12 */
|
|
|
+ /* In hw v1, a port include two SQP, six ports total 12 */
|
|
|
+ if (hr_dev->caps.max_sq_sg <= 2)
|
|
|
+ reserved_from_bot = SQP_NUM;
|
|
|
+ else
|
|
|
+ reserved_from_bot = hr_dev->caps.reserved_qps;
|
|
|
+
|
|
|
ret = hns_roce_bitmap_init(&qp_table->bitmap, hr_dev->caps.num_qps,
|
|
|
- hr_dev->caps.num_qps - 1, SQP_NUM,
|
|
|
+ hr_dev->caps.num_qps - 1, reserved_from_bot,
|
|
|
reserved_from_top);
|
|
|
if (ret) {
|
|
|
dev_err(hr_dev->dev, "qp bitmap init failed!error=%d\n",
|