Lines Matching refs:dmr
171 struct mlx5_vdpa_direct_mr *dmr; in fill_indir() local
180 list_for_each_entry(dmr, &mkey->head, list) { in fill_indir()
184 preve = dmr->start; in fill_indir()
188 if (preve == dmr->start) { in fill_indir()
189 klm->key = cpu_to_be32(dmr->mr); in fill_indir()
190 klm->bcount = cpu_to_be32(klm_bcount(dmr->end - dmr->start)); in fill_indir()
191 preve = dmr->end; in fill_indir()
194 klm->bcount = cpu_to_be32(klm_bcount(dmr->start - preve)); in fill_indir()
195 preve = dmr->start; in fill_indir()
211 struct mlx5_vdpa_direct_mr *dmr; in create_direct_keys() local
219 list_for_each_entry(dmr, &mr->head, list) { in create_direct_keys()
223 mttlen = roundup(MLX5_ST_SZ_BYTES(mtt) * dmr->nsg, MLX5_VDPA_MTT_ALIGN); in create_direct_keys()
236 fill_create_direct_mr(mvdev, dmr, cmd_mem); in create_direct_keys()
249 list_for_each_entry(dmr, &mr->head, list) { in create_direct_keys()
256 create_direct_mr_end(mvdev, dmr, cmd_mem); in create_direct_keys()
260 dmr->start, dmr->end, cmd->err); in create_direct_keys()
283 struct mlx5_vdpa_direct_mr *dmr; in DEFINE_FREE() local
292 list_for_each_entry(dmr, &mr->head, list) { in DEFINE_FREE()
297 fill_destroy_direct_mr(mvdev, dmr, &cmd_mem[i]); in DEFINE_FREE()
309 list_for_each_entry(dmr, &mr->head, list) { in DEFINE_FREE()
312 dmr->mr = 0; in DEFINE_FREE()
316 dmr->start, dmr->end, cmd->err); in DEFINE_FREE()
448 struct mlx5_vdpa_direct_mr *dmr; in add_direct_chain() local
458 dmr = kzalloc(sizeof(*dmr), GFP_KERNEL); in add_direct_chain()
459 if (!dmr) { in add_direct_chain()
464 dmr->start = st; in add_direct_chain()
465 dmr->end = st + sz; in add_direct_chain()
466 dmr->perm = perm; in add_direct_chain()
467 err = map_direct_mr(mvdev, dmr, iotlb); in add_direct_chain()
469 kfree(dmr); in add_direct_chain()
473 list_add_tail(&dmr->list, &tmp); in add_direct_chain()
483 list_for_each_entry_safe(dmr, n, &mr->head, list) { in add_direct_chain()
484 list_del_init(&dmr->list); in add_direct_chain()
485 unmap_direct_mr(mvdev, dmr); in add_direct_chain()
486 kfree(dmr); in add_direct_chain()
501 struct mlx5_vdpa_direct_mr *dmr; in create_user_mr() local
557 list_for_each_entry_safe_reverse(dmr, n, &mr->head, list) { in create_user_mr()
558 list_del_init(&dmr->list); in create_user_mr()
559 unmap_direct_mr(mvdev, dmr); in create_user_mr()
560 kfree(dmr); in create_user_mr()
629 struct mlx5_vdpa_direct_mr *dmr; in destroy_user_mr() local
634 list_for_each_entry_safe_reverse(dmr, n, &mr->head, list) { in destroy_user_mr()
635 list_del_init(&dmr->list); in destroy_user_mr()
636 unmap_direct_mr(mvdev, dmr); in destroy_user_mr()
637 kfree(dmr); in destroy_user_mr()