Lines Matching refs:bfregn
684 int bfregn = -ENOMEM; in alloc_bfreg() local
691 bfregn = alloc_high_class_bfreg(dev, bfregi); in alloc_bfreg()
692 if (bfregn < 0) in alloc_bfreg()
693 bfregn = alloc_med_class_bfreg(dev, bfregi); in alloc_bfreg()
696 if (bfregn < 0) { in alloc_bfreg()
698 bfregn = 0; in alloc_bfreg()
699 bfregi->count[bfregn]++; in alloc_bfreg()
703 return bfregn; in alloc_bfreg()
706 void mlx5_ib_free_bfreg(struct mlx5_ib_dev *dev, struct mlx5_bfreg_info *bfregi, int bfregn) in mlx5_ib_free_bfreg() argument
709 bfregi->count[bfregn]--; in mlx5_ib_free_bfreg()
750 struct mlx5_bfreg_info *bfregi, u32 bfregn, in bfregn_to_uar_index() argument
762 index_of_sys_page = bfregn / bfregs_per_sys_page; in bfregn_to_uar_index()
770 if (bfregn > bfregi->num_dyn_bfregs || in bfregn_to_uar_index()
777 offset = bfregn % bfregs_per_sys_page / MLX5_NON_FP_BFREGS_PER_UAR; in bfregn_to_uar_index()
884 struct mlx5_bfreg_info *bfregi, int bfregn) in adjust_bfregn() argument
886 return bfregn / MLX5_NON_FP_BFREGS_PER_UAR * MLX5_BFREGS_PER_UAR + in adjust_bfregn()
887 bfregn % MLX5_NON_FP_BFREGS_PER_UAR; in adjust_bfregn()
903 int bfregn; in _create_user_qp() local
918 bfregn = MLX5_IB_INVALID_BFREG; in _create_user_qp()
925 bfregn = MLX5_IB_INVALID_BFREG; in _create_user_qp()
930 bfregn = alloc_bfreg(dev, &context->bfregi); in _create_user_qp()
931 if (bfregn < 0) in _create_user_qp()
932 return bfregn; in _create_user_qp()
938 mlx5_ib_dbg(dev, "bfregn 0x%x, uar_index 0x%x\n", bfregn, uar_index); in _create_user_qp()
939 if (bfregn != MLX5_IB_INVALID_BFREG) in _create_user_qp()
940 uar_index = bfregn_to_uar_index(dev, &context->bfregi, bfregn, in _create_user_qp()
982 if (bfregn != MLX5_IB_INVALID_BFREG) in _create_user_qp()
983 resp->bfreg_index = adjust_bfregn(dev, &context->bfregi, bfregn); in _create_user_qp()
986 qp->bfregn = bfregn; in _create_user_qp()
1003 if (bfregn != MLX5_IB_INVALID_BFREG) in _create_user_qp()
1004 mlx5_ib_free_bfreg(dev, &context->bfregi, bfregn); in _create_user_qp()
1023 if (qp->bfregn != MLX5_IB_INVALID_BFREG) in destroy_qp()
1024 mlx5_ib_free_bfreg(dev, &context->bfregi, qp->bfregn); in destroy_qp()