Lines Matching refs:profile

77 	struct mthca_resource *profile;  in mthca_make_profile()  local
80 profile = kcalloc(MTHCA_RES_NUM, sizeof(*profile), GFP_KERNEL); in mthca_make_profile()
81 if (!profile) in mthca_make_profile()
84 profile[MTHCA_RES_QP].size = dev_lim->qpc_entry_sz; in mthca_make_profile()
85 profile[MTHCA_RES_EEC].size = dev_lim->eec_entry_sz; in mthca_make_profile()
86 profile[MTHCA_RES_SRQ].size = dev_lim->srq_entry_sz; in mthca_make_profile()
87 profile[MTHCA_RES_CQ].size = dev_lim->cqc_entry_sz; in mthca_make_profile()
88 profile[MTHCA_RES_EQP].size = dev_lim->eqpc_entry_sz; in mthca_make_profile()
89 profile[MTHCA_RES_EEEC].size = dev_lim->eeec_entry_sz; in mthca_make_profile()
90 profile[MTHCA_RES_EQ].size = dev_lim->eqc_entry_sz; in mthca_make_profile()
91 profile[MTHCA_RES_RDB].size = MTHCA_RDB_ENTRY_SIZE; in mthca_make_profile()
92 profile[MTHCA_RES_MCG].size = MTHCA_MGM_ENTRY_SIZE; in mthca_make_profile()
93 profile[MTHCA_RES_MPT].size = dev_lim->mpt_entry_sz; in mthca_make_profile()
94 profile[MTHCA_RES_MTT].size = dev->limits.mtt_seg_size; in mthca_make_profile()
95 profile[MTHCA_RES_UAR].size = dev_lim->uar_scratch_entry_sz; in mthca_make_profile()
96 profile[MTHCA_RES_UDAV].size = MTHCA_AV_SIZE; in mthca_make_profile()
97 profile[MTHCA_RES_UARC].size = request->uarc_size; in mthca_make_profile()
99 profile[MTHCA_RES_QP].num = request->num_qp; in mthca_make_profile()
100 profile[MTHCA_RES_SRQ].num = request->num_srq; in mthca_make_profile()
101 profile[MTHCA_RES_EQP].num = request->num_qp; in mthca_make_profile()
102 profile[MTHCA_RES_RDB].num = request->num_qp * request->rdb_per_qp; in mthca_make_profile()
103 profile[MTHCA_RES_CQ].num = request->num_cq; in mthca_make_profile()
104 profile[MTHCA_RES_EQ].num = MTHCA_NUM_EQS; in mthca_make_profile()
105 profile[MTHCA_RES_MCG].num = request->num_mcg; in mthca_make_profile()
106 profile[MTHCA_RES_MPT].num = request->num_mpt; in mthca_make_profile()
107 profile[MTHCA_RES_MTT].num = request->num_mtt; in mthca_make_profile()
108 profile[MTHCA_RES_UAR].num = request->num_uar; in mthca_make_profile()
109 profile[MTHCA_RES_UARC].num = request->num_uar; in mthca_make_profile()
110 profile[MTHCA_RES_UDAV].num = request->num_udav; in mthca_make_profile()
113 profile[i].type = i; in mthca_make_profile()
114 profile[i].log_num = max(ffs(profile[i].num) - 1, 0); in mthca_make_profile()
115 profile[i].size *= profile[i].num; in mthca_make_profile()
117 profile[i].size = max(profile[i].size, (u64) PAGE_SIZE); in mthca_make_profile()
136 if (profile[j].size > profile[j - 1].size) in mthca_make_profile()
137 swap(profile[j], profile[j - 1]); in mthca_make_profile()
141 if (profile[i].size) { in mthca_make_profile()
142 profile[i].start = mem_base + total_size; in mthca_make_profile()
143 total_size += profile[i].size; in mthca_make_profile()
150 kfree(profile); in mthca_make_profile()
154 if (profile[i].size) in mthca_make_profile()
157 i, profile[i].type, profile[i].log_num, in mthca_make_profile()
158 (unsigned long long) profile[i].start, in mthca_make_profile()
159 (unsigned long long) profile[i].size); in mthca_make_profile()
171 switch (profile[i].type) { in mthca_make_profile()
173 dev->limits.num_qps = profile[i].num; in mthca_make_profile()
174 init_hca->qpc_base = profile[i].start; in mthca_make_profile()
175 init_hca->log_num_qps = profile[i].log_num; in mthca_make_profile()
178 dev->limits.num_eecs = profile[i].num; in mthca_make_profile()
179 init_hca->eec_base = profile[i].start; in mthca_make_profile()
180 init_hca->log_num_eecs = profile[i].log_num; in mthca_make_profile()
183 dev->limits.num_srqs = profile[i].num; in mthca_make_profile()
184 init_hca->srqc_base = profile[i].start; in mthca_make_profile()
185 init_hca->log_num_srqs = profile[i].log_num; in mthca_make_profile()
188 dev->limits.num_cqs = profile[i].num; in mthca_make_profile()
189 init_hca->cqc_base = profile[i].start; in mthca_make_profile()
190 init_hca->log_num_cqs = profile[i].log_num; in mthca_make_profile()
193 init_hca->eqpc_base = profile[i].start; in mthca_make_profile()
196 init_hca->eeec_base = profile[i].start; in mthca_make_profile()
199 dev->limits.num_eqs = profile[i].num; in mthca_make_profile()
200 init_hca->eqc_base = profile[i].start; in mthca_make_profile()
201 init_hca->log_num_eqs = profile[i].log_num; in mthca_make_profile()
205 request->num_qp << dev->qp_table.rdb_shift < profile[i].num; in mthca_make_profile()
208 dev->qp_table.rdb_base = (u32) profile[i].start; in mthca_make_profile()
209 init_hca->rdb_base = profile[i].start; in mthca_make_profile()
212 dev->limits.num_mgms = profile[i].num >> 1; in mthca_make_profile()
213 dev->limits.num_amgms = profile[i].num >> 1; in mthca_make_profile()
214 init_hca->mc_base = profile[i].start; in mthca_make_profile()
216 init_hca->log_mc_table_sz = profile[i].log_num; in mthca_make_profile()
217 init_hca->mc_hash_sz = 1 << (profile[i].log_num - 1); in mthca_make_profile()
220 dev->limits.num_mpts = profile[i].num; in mthca_make_profile()
221 dev->mr_table.mpt_base = profile[i].start; in mthca_make_profile()
222 init_hca->mpt_base = profile[i].start; in mthca_make_profile()
223 init_hca->log_mpt_sz = profile[i].log_num; in mthca_make_profile()
226 dev->limits.num_mtt_segs = profile[i].num; in mthca_make_profile()
227 dev->mr_table.mtt_base = profile[i].start; in mthca_make_profile()
228 init_hca->mtt_base = profile[i].start; in mthca_make_profile()
232 dev->limits.num_uars = profile[i].num; in mthca_make_profile()
233 init_hca->uar_scratch_base = profile[i].start; in mthca_make_profile()
236 dev->av_table.ddr_av_base = profile[i].start; in mthca_make_profile()
237 dev->av_table.num_ddr_avs = profile[i].num; in mthca_make_profile()
241 dev->uar_table.uarc_base = profile[i].start; in mthca_make_profile()
242 init_hca->uarc_base = profile[i].start; in mthca_make_profile()
277 kfree(profile); in mthca_make_profile()