Lines Matching refs:buf_attr
95 struct hns_roce_buf_attr buf_attr = {}; in alloc_mr_pbl() local
99 buf_attr.page_shift = is_fast ? PAGE_SHIFT : in alloc_mr_pbl()
101 buf_attr.region[0].size = mr->size; in alloc_mr_pbl()
102 buf_attr.region[0].hopnum = mr->pbl_hop_num; in alloc_mr_pbl()
103 buf_attr.region_count = 1; in alloc_mr_pbl()
104 buf_attr.user_access = mr->access; in alloc_mr_pbl()
106 buf_attr.mtt_only = is_fast; in alloc_mr_pbl()
107 buf_attr.iova = mr->iova; in alloc_mr_pbl()
109 buf_attr.adaptive = !is_fast; in alloc_mr_pbl()
110 buf_attr.type = MTR_PBL; in alloc_mr_pbl()
112 err = hns_roce_mtr_create(hr_dev, &mr->pbl_mtr, &buf_attr, in alloc_mr_pbl()
121 mr->pbl_hop_num = buf_attr.region[0].hopnum; in alloc_mr_pbl()
689 struct hns_roce_buf_attr *buf_attr, in mtr_alloc_bufs() argument
695 total_size = mtr_bufs_size(buf_attr); in mtr_alloc_bufs()
700 buf_attr->user_access); in mtr_alloc_bufs()
709 buf_attr->page_shift, in mtr_alloc_bufs()
710 !mtr_has_mtt(buf_attr) ? in mtr_alloc_bufs()
936 struct hns_roce_buf_attr *buf_attr) in get_best_page_shift() argument
940 if (!buf_attr->adaptive || buf_attr->type != MTR_PBL || !mtr->umem) in get_best_page_shift()
945 buf_attr->iova); in get_best_page_shift()
949 buf_attr->page_shift = order_base_2(page_sz); in get_best_page_shift()
955 struct hns_roce_buf_attr *buf_attr, in get_best_hop_num() argument
960 size_t buf_pg_sz = 1 << buf_attr->page_shift; in get_best_hop_num()
968 if (!buf_attr->adaptive || buf_attr->type != MTR_PBL) in get_best_hop_num()
975 ba_cnt = DIV_ROUND_UP(buf_attr->region[0].size, buf_pg_sz); in get_best_hop_num()
992 buf_attr->region[0].hopnum = hop_num; in get_best_hop_num()
1146 struct hns_roce_buf_attr *buf_attr, in hns_roce_mtr_create() argument
1156 if (buf_attr->mtt_only) { in hns_roce_mtr_create()
1160 ret = mtr_alloc_bufs(hr_dev, mtr, buf_attr, udata, user_addr); in hns_roce_mtr_create()
1167 ret = get_best_page_shift(hr_dev, mtr, buf_attr); in hns_roce_mtr_create()
1171 ret = get_best_hop_num(hr_dev, mtr, buf_attr, ba_page_shift); in hns_roce_mtr_create()
1176 ret = mtr_init_buf_cfg(hr_dev, mtr, buf_attr); in hns_roce_mtr_create()
1186 if (buf_attr->mtt_only) in hns_roce_mtr_create()