Lines Matching refs:profile
84 struct mlx4_resource *profile; in mlx4_make_profile() local
88 profile = kcalloc(MLX4_RES_NUM, sizeof(*profile), GFP_KERNEL); in mlx4_make_profile()
89 if (!profile) in mlx4_make_profile()
111 profile[MLX4_RES_QP].size = dev_cap->qpc_entry_sz; in mlx4_make_profile()
112 profile[MLX4_RES_RDMARC].size = dev_cap->rdmarc_entry_sz; in mlx4_make_profile()
113 profile[MLX4_RES_ALTC].size = dev_cap->altc_entry_sz; in mlx4_make_profile()
114 profile[MLX4_RES_AUXC].size = dev_cap->aux_entry_sz; in mlx4_make_profile()
115 profile[MLX4_RES_SRQ].size = dev_cap->srq_entry_sz; in mlx4_make_profile()
116 profile[MLX4_RES_CQ].size = dev_cap->cqc_entry_sz; in mlx4_make_profile()
117 profile[MLX4_RES_EQ].size = dev_cap->eqc_entry_sz; in mlx4_make_profile()
118 profile[MLX4_RES_DMPT].size = dev_cap->dmpt_entry_sz; in mlx4_make_profile()
119 profile[MLX4_RES_CMPT].size = dev_cap->cmpt_entry_sz; in mlx4_make_profile()
120 profile[MLX4_RES_MTT].size = dev_cap->mtt_entry_sz; in mlx4_make_profile()
121 profile[MLX4_RES_MCG].size = mlx4_get_mgm_entry_size(dev); in mlx4_make_profile()
123 profile[MLX4_RES_QP].num = request->num_qp; in mlx4_make_profile()
124 profile[MLX4_RES_RDMARC].num = request->num_qp * request->rdmarc_per_qp; in mlx4_make_profile()
125 profile[MLX4_RES_ALTC].num = request->num_qp; in mlx4_make_profile()
126 profile[MLX4_RES_AUXC].num = request->num_qp; in mlx4_make_profile()
127 profile[MLX4_RES_SRQ].num = request->num_srq; in mlx4_make_profile()
128 profile[MLX4_RES_CQ].num = request->num_cq; in mlx4_make_profile()
129 profile[MLX4_RES_EQ].num = mlx4_is_mfunc(dev) ? dev->phys_caps.num_phys_eqs : in mlx4_make_profile()
131 profile[MLX4_RES_DMPT].num = request->num_mpt; in mlx4_make_profile()
132 profile[MLX4_RES_CMPT].num = MLX4_NUM_CMPTS; in mlx4_make_profile()
133 profile[MLX4_RES_MTT].num = request->num_mtt * (1 << log_mtts_per_seg); in mlx4_make_profile()
134 profile[MLX4_RES_MCG].num = request->num_mcg; in mlx4_make_profile()
137 profile[i].type = i; in mlx4_make_profile()
138 profile[i].num = roundup_pow_of_two(profile[i].num); in mlx4_make_profile()
139 profile[i].log_num = ilog2(profile[i].num); in mlx4_make_profile()
140 profile[i].size *= profile[i].num; in mlx4_make_profile()
141 profile[i].size = max(profile[i].size, (u64) PAGE_SIZE); in mlx4_make_profile()
152 if (profile[j].size > profile[j - 1].size) in mlx4_make_profile()
153 swap(profile[j], profile[j - 1]); in mlx4_make_profile()
157 if (profile[i].size) { in mlx4_make_profile()
158 profile[i].start = total_size; in mlx4_make_profile()
159 total_size += profile[i].size; in mlx4_make_profile()
166 kfree(profile); in mlx4_make_profile()
170 if (profile[i].size) in mlx4_make_profile()
172 i, res_name[profile[i].type], in mlx4_make_profile()
173 profile[i].log_num, in mlx4_make_profile()
174 (unsigned long long) profile[i].start, in mlx4_make_profile()
175 (unsigned long long) profile[i].size); in mlx4_make_profile()
182 switch (profile[i].type) { in mlx4_make_profile()
184 dev->caps.num_qps = profile[i].num; in mlx4_make_profile()
185 init_hca->qpc_base = profile[i].start; in mlx4_make_profile()
186 init_hca->log_num_qps = profile[i].log_num; in mlx4_make_profile()
190 request->num_qp << priv->qp_table.rdmarc_shift < profile[i].num; in mlx4_make_profile()
194 priv->qp_table.rdmarc_base = (u32) profile[i].start; in mlx4_make_profile()
195 init_hca->rdmarc_base = profile[i].start; in mlx4_make_profile()
199 init_hca->altc_base = profile[i].start; in mlx4_make_profile()
202 init_hca->auxc_base = profile[i].start; in mlx4_make_profile()
205 dev->caps.num_srqs = profile[i].num; in mlx4_make_profile()
206 init_hca->srqc_base = profile[i].start; in mlx4_make_profile()
207 init_hca->log_num_srqs = profile[i].log_num; in mlx4_make_profile()
210 dev->caps.num_cqs = profile[i].num; in mlx4_make_profile()
211 init_hca->cqc_base = profile[i].start; in mlx4_make_profile()
212 init_hca->log_num_cqs = profile[i].log_num; in mlx4_make_profile()
217 init_hca->eqc_base = profile[i].start; in mlx4_make_profile()
224 init_hca->eqc_base = profile[i].start; in mlx4_make_profile()
229 dev->caps.num_mpts = profile[i].num; in mlx4_make_profile()
230 priv->mr_table.mpt_base = profile[i].start; in mlx4_make_profile()
231 init_hca->dmpt_base = profile[i].start; in mlx4_make_profile()
232 init_hca->log_mpt_sz = profile[i].log_num; in mlx4_make_profile()
235 init_hca->cmpt_base = profile[i].start; in mlx4_make_profile()
238 dev->caps.num_mtts = profile[i].num; in mlx4_make_profile()
239 priv->mr_table.mtt_base = profile[i].start; in mlx4_make_profile()
240 init_hca->mtt_base = profile[i].start; in mlx4_make_profile()
243 init_hca->mc_base = profile[i].start; in mlx4_make_profile()
246 init_hca->log_mc_table_sz = profile[i].log_num; in mlx4_make_profile()
249 dev->caps.num_mgms = profile[i].num; in mlx4_make_profile()
252 profile[i].log_num - 1; in mlx4_make_profile()
253 dev->caps.num_mgms = profile[i].num >> 1; in mlx4_make_profile()
254 dev->caps.num_amgms = profile[i].num >> 1; in mlx4_make_profile()
268 kfree(profile); in mlx4_make_profile()