Lines Matching refs:p_ooo_info
23 *p_ooo_info, in qed_ooo_seek_archipelago()
26 u32 idx = (cid & 0xffff) - p_ooo_info->cid_base; in qed_ooo_seek_archipelago()
29 if (unlikely(idx >= p_ooo_info->max_num_archipelagos)) in qed_ooo_seek_archipelago()
32 p_archipelago = &p_ooo_info->p_archipelagos_mem[idx]; in qed_ooo_seek_archipelago()
41 struct qed_ooo_info *p_ooo_info, in qed_ooo_seek_isle() argument
48 p_archipelago = qed_ooo_seek_archipelago(p_hwfn, p_ooo_info, cid); in qed_ooo_seek_isle()
65 struct qed_ooo_info *p_ooo_info, in qed_ooo_save_history_entry() argument
68 struct qed_ooo_history *p_history = &p_ooo_info->ooo_history; in qed_ooo_save_history_entry()
79 struct qed_ooo_info *p_ooo_info; in qed_ooo_alloc() local
110 p_ooo_info = kzalloc(sizeof(*p_ooo_info), GFP_KERNEL); in qed_ooo_alloc()
111 if (!p_ooo_info) in qed_ooo_alloc()
114 p_ooo_info->cid_base = cid_base; in qed_ooo_alloc()
115 p_ooo_info->max_num_archipelagos = max_num_archipelagos; in qed_ooo_alloc()
117 INIT_LIST_HEAD(&p_ooo_info->free_buffers_list); in qed_ooo_alloc()
118 INIT_LIST_HEAD(&p_ooo_info->ready_buffers_list); in qed_ooo_alloc()
119 INIT_LIST_HEAD(&p_ooo_info->free_isles_list); in qed_ooo_alloc()
121 p_ooo_info->p_isles_mem = kcalloc(max_num_isles, in qed_ooo_alloc()
124 if (!p_ooo_info->p_isles_mem) in qed_ooo_alloc()
128 INIT_LIST_HEAD(&p_ooo_info->p_isles_mem[i].buffers_list); in qed_ooo_alloc()
129 list_add_tail(&p_ooo_info->p_isles_mem[i].list_entry, in qed_ooo_alloc()
130 &p_ooo_info->free_isles_list); in qed_ooo_alloc()
133 p_ooo_info->p_archipelagos_mem = in qed_ooo_alloc()
137 if (!p_ooo_info->p_archipelagos_mem) in qed_ooo_alloc()
141 INIT_LIST_HEAD(&p_ooo_info->p_archipelagos_mem[i].isles_list); in qed_ooo_alloc()
143 p_ooo_info->ooo_history.p_cqes = in qed_ooo_alloc()
147 if (!p_ooo_info->ooo_history.p_cqes) in qed_ooo_alloc()
150 p_ooo_info->ooo_history.num_of_cqes = QED_MAX_NUM_OOO_HISTORY_ENTRIES; in qed_ooo_alloc()
152 p_hwfn->p_ooo_info = p_ooo_info; in qed_ooo_alloc()
156 kfree(p_ooo_info->p_archipelagos_mem); in qed_ooo_alloc()
158 kfree(p_ooo_info->p_isles_mem); in qed_ooo_alloc()
160 kfree(p_ooo_info); in qed_ooo_alloc()
165 struct qed_ooo_info *p_ooo_info, u32 cid) in qed_ooo_release_connection_isles() argument
171 p_archipelago = qed_ooo_seek_archipelago(p_hwfn, p_ooo_info, cid); in qed_ooo_release_connection_isles()
190 &p_ooo_info->free_buffers_list); in qed_ooo_release_connection_isles()
193 &p_ooo_info->free_isles_list); in qed_ooo_release_connection_isles()
198 struct qed_ooo_info *p_ooo_info) in qed_ooo_release_all_isles() argument
205 for (i = 0; i < p_ooo_info->max_num_archipelagos; i++) { in qed_ooo_release_all_isles()
206 p_archipelago = &(p_ooo_info->p_archipelagos_mem[i]); in qed_ooo_release_all_isles()
225 &p_ooo_info->free_buffers_list); in qed_ooo_release_all_isles()
228 &p_ooo_info->free_isles_list); in qed_ooo_release_all_isles()
231 if (!list_empty(&p_ooo_info->ready_buffers_list)) in qed_ooo_release_all_isles()
232 list_splice_tail_init(&p_ooo_info->ready_buffers_list, in qed_ooo_release_all_isles()
233 &p_ooo_info->free_buffers_list); in qed_ooo_release_all_isles()
238 qed_ooo_release_all_isles(p_hwfn, p_hwfn->p_ooo_info); in qed_ooo_setup()
239 memset(p_hwfn->p_ooo_info->ooo_history.p_cqes, 0, in qed_ooo_setup()
240 p_hwfn->p_ooo_info->ooo_history.num_of_cqes * in qed_ooo_setup()
242 p_hwfn->p_ooo_info->ooo_history.head_idx = 0; in qed_ooo_setup()
247 struct qed_ooo_info *p_ooo_info = p_hwfn->p_ooo_info; in qed_ooo_free() local
250 if (!p_ooo_info) in qed_ooo_free()
253 qed_ooo_release_all_isles(p_hwfn, p_ooo_info); in qed_ooo_free()
254 while (!list_empty(&p_ooo_info->free_buffers_list)) { in qed_ooo_free()
255 p_buffer = list_first_entry(&p_ooo_info->free_buffers_list, in qed_ooo_free()
269 kfree(p_ooo_info->p_isles_mem); in qed_ooo_free()
270 kfree(p_ooo_info->p_archipelagos_mem); in qed_ooo_free()
271 kfree(p_ooo_info->ooo_history.p_cqes); in qed_ooo_free()
272 kfree(p_ooo_info); in qed_ooo_free()
273 p_hwfn->p_ooo_info = NULL; in qed_ooo_free()
277 struct qed_ooo_info *p_ooo_info, in qed_ooo_put_free_buffer() argument
280 list_add_tail(&p_buffer->list_entry, &p_ooo_info->free_buffers_list); in qed_ooo_put_free_buffer()
284 struct qed_ooo_info *p_ooo_info) in qed_ooo_get_free_buffer() argument
288 if (!list_empty(&p_ooo_info->free_buffers_list)) { in qed_ooo_get_free_buffer()
289 p_buffer = list_first_entry(&p_ooo_info->free_buffers_list, in qed_ooo_get_free_buffer()
299 struct qed_ooo_info *p_ooo_info, in qed_ooo_put_ready_buffer() argument
304 &p_ooo_info->ready_buffers_list); in qed_ooo_put_ready_buffer()
307 &p_ooo_info->ready_buffers_list); in qed_ooo_put_ready_buffer()
311 struct qed_ooo_info *p_ooo_info) in qed_ooo_get_ready_buffer() argument
315 if (!list_empty(&p_ooo_info->ready_buffers_list)) { in qed_ooo_get_ready_buffer()
316 p_buffer = list_first_entry(&p_ooo_info->ready_buffers_list, in qed_ooo_get_ready_buffer()
326 struct qed_ooo_info *p_ooo_info, in qed_ooo_delete_isles() argument
333 p_isle = qed_ooo_seek_isle(p_hwfn, p_ooo_info, cid, drop_isle); in qed_ooo_delete_isles()
345 &p_ooo_info->free_buffers_list); in qed_ooo_delete_isles()
348 p_ooo_info->cur_isles_number--; in qed_ooo_delete_isles()
349 list_add(&p_isle->list_entry, &p_ooo_info->free_isles_list); in qed_ooo_delete_isles()
354 struct qed_ooo_info *p_ooo_info, in qed_ooo_add_new_isle() argument
364 p_ooo_info, cid, ooo_isle - 1); in qed_ooo_add_new_isle()
372 p_archipelago = qed_ooo_seek_archipelago(p_hwfn, p_ooo_info, cid); in qed_ooo_add_new_isle()
379 if (!list_empty(&p_ooo_info->free_isles_list)) { in qed_ooo_add_new_isle()
380 p_isle = list_first_entry(&p_ooo_info->free_isles_list, in qed_ooo_add_new_isle()
394 u32 idx = (cid & 0xffff) - p_ooo_info->cid_base; in qed_ooo_add_new_isle()
396 p_archipelago = &p_ooo_info->p_archipelagos_mem[idx]; in qed_ooo_add_new_isle()
400 p_ooo_info->cur_isles_number++; in qed_ooo_add_new_isle()
401 p_ooo_info->gen_isles_number++; in qed_ooo_add_new_isle()
403 if (p_ooo_info->cur_isles_number > p_ooo_info->max_isles_number) in qed_ooo_add_new_isle()
404 p_ooo_info->max_isles_number = p_ooo_info->cur_isles_number; in qed_ooo_add_new_isle()
413 struct qed_ooo_info *p_ooo_info, in qed_ooo_add_new_buffer() argument
420 p_isle = qed_ooo_seek_isle(p_hwfn, p_ooo_info, cid, ooo_isle); in qed_ooo_add_new_buffer()
434 struct qed_ooo_info *p_ooo_info, u32 cid, u8 left_isle) in qed_ooo_join_isles() argument
439 p_right_isle = qed_ooo_seek_isle(p_hwfn, p_ooo_info, cid, in qed_ooo_join_isles()
449 p_ooo_info->cur_isles_number--; in qed_ooo_join_isles()
451 p_left_isle = qed_ooo_seek_isle(p_hwfn, p_ooo_info, cid, in qed_ooo_join_isles()
463 &p_ooo_info->ready_buffers_list); in qed_ooo_join_isles()
465 list_add_tail(&p_right_isle->list_entry, &p_ooo_info->free_isles_list); in qed_ooo_join_isles()