Lines Matching refs:profile
84 struct mlx4_resource *profile;
89 profile = kcalloc(MLX4_RES_NUM, sizeof(*profile), GFP_KERNEL);
90 if (!profile)
111 profile[MLX4_RES_QP].size = dev_cap->qpc_entry_sz;
112 profile[MLX4_RES_RDMARC].size = dev_cap->rdmarc_entry_sz;
113 profile[MLX4_RES_ALTC].size = dev_cap->altc_entry_sz;
114 profile[MLX4_RES_AUXC].size = dev_cap->aux_entry_sz;
115 profile[MLX4_RES_SRQ].size = dev_cap->srq_entry_sz;
116 profile[MLX4_RES_CQ].size = dev_cap->cqc_entry_sz;
117 profile[MLX4_RES_EQ].size = dev_cap->eqc_entry_sz;
118 profile[MLX4_RES_DMPT].size = dev_cap->dmpt_entry_sz;
119 profile[MLX4_RES_CMPT].size = dev_cap->cmpt_entry_sz;
120 profile[MLX4_RES_MTT].size = dev_cap->mtt_entry_sz;
121 profile[MLX4_RES_MCG].size = mlx4_get_mgm_entry_size(dev);
123 profile[MLX4_RES_QP].num = request->num_qp;
124 profile[MLX4_RES_RDMARC].num = request->num_qp * request->rdmarc_per_qp;
125 profile[MLX4_RES_ALTC].num = request->num_qp;
126 profile[MLX4_RES_AUXC].num = request->num_qp;
127 profile[MLX4_RES_SRQ].num = request->num_srq;
128 profile[MLX4_RES_CQ].num = request->num_cq;
129 profile[MLX4_RES_EQ].num = mlx4_is_mfunc(dev) ?
132 profile[MLX4_RES_DMPT].num = request->num_mpt;
133 profile[MLX4_RES_CMPT].num = MLX4_NUM_CMPTS;
134 profile[MLX4_RES_MTT].num = request->num_mtt * (1 << log_mtts_per_seg);
135 profile[MLX4_RES_MCG].num = request->num_mcg;
138 profile[i].type = i;
139 profile[i].num = roundup_pow_of_two(profile[i].num);
140 profile[i].log_num = ilog2(profile[i].num);
141 profile[i].size *= profile[i].num;
142 profile[i].size = max(profile[i].size, (u64) PAGE_SIZE);
153 if (profile[j].size > profile[j - 1].size) {
154 tmp = profile[j];
155 profile[j] = profile[j - 1];
156 profile[j - 1] = tmp;
161 if (profile[i].size) {
162 profile[i].start = total_size;
163 total_size += profile[i].size;
170 kfree(profile);
174 if (profile[i].size)
175 mlx4_dbg(dev, " profile[%2d] (%6s): 2^%02d entries @ 0x%10llx, size 0x%10llx\n",
176 i, res_name[profile[i].type],
177 profile[i].log_num,
178 (unsigned long long) profile[i].start,
179 (unsigned long long) profile[i].size);
186 switch (profile[i].type) {
188 dev->caps.num_qps = profile[i].num;
189 init_hca->qpc_base = profile[i].start;
190 init_hca->log_num_qps = profile[i].log_num;
194 request->num_qp << priv->qp_table.rdmarc_shift < profile[i].num;
198 priv->qp_table.rdmarc_base = (u32) profile[i].start;
199 init_hca->rdmarc_base = profile[i].start;
203 init_hca->altc_base = profile[i].start;
206 init_hca->auxc_base = profile[i].start;
209 dev->caps.num_srqs = profile[i].num;
210 init_hca->srqc_base = profile[i].start;
211 init_hca->log_num_srqs = profile[i].log_num;
214 dev->caps.num_cqs = profile[i].num;
215 init_hca->cqc_base = profile[i].start;
216 init_hca->log_num_cqs = profile[i].log_num;
221 init_hca->eqc_base = profile[i].start;
225 dev->caps.num_mpts = profile[i].num;
226 priv->mr_table.mpt_base = profile[i].start;
227 init_hca->dmpt_base = profile[i].start;
228 init_hca->log_mpt_sz = profile[i].log_num;
231 init_hca->cmpt_base = profile[i].start;
234 dev->caps.num_mtts = profile[i].num;
235 priv->mr_table.mtt_base = profile[i].start;
236 init_hca->mtt_base = profile[i].start;
239 init_hca->mc_base = profile[i].start;
242 init_hca->log_mc_table_sz = profile[i].log_num;
245 dev->caps.num_mgms = profile[i].num;
248 profile[i].log_num - 1;
249 dev->caps.num_mgms = profile[i].num >> 1;
250 dev->caps.num_amgms = profile[i].num >> 1;
260 * of the HCA profile anyway.
264 kfree(profile);