Lines Matching refs:p_mngr
273 static void qed_cxt_cdu_iids(struct qed_cxt_mngr *p_mngr, in qed_cxt_cdu_iids() argument
279 iids->pf_cids += p_mngr->conn_cfg[type].cid_count; in qed_cxt_cdu_iids()
280 iids->per_vf_cids += p_mngr->conn_cfg[type].cids_per_vf; in qed_cxt_cdu_iids()
290 static void qed_cxt_src_iids(struct qed_cxt_mngr *p_mngr, in qed_cxt_src_iids() argument
299 iids->pf_cids += p_mngr->conn_cfg[i].cid_count; in qed_cxt_src_iids()
300 iids->per_vf_cids += p_mngr->conn_cfg[i].cids_per_vf; in qed_cxt_src_iids()
304 iids->pf_cids += p_mngr->arfs_count; in qed_cxt_src_iids()
317 struct qed_cxt_mngr *p_mngr, in qed_cxt_tm_iids() argument
331 struct qed_conn_type_cfg *p_cfg = &p_mngr->conn_cfg[i]; in qed_cxt_tm_iids()
377 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_qm_iids() local
383 iids->cids += p_mngr->conn_cfg[type].cid_count; in qed_cxt_qm_iids()
384 vf_cids += p_mngr->conn_cfg[type].cids_per_vf; in qed_cxt_qm_iids()
386 segs = p_mngr->conn_cfg[type].tid_seg; in qed_cxt_qm_iids()
400 iids->vf_cids += vf_cids * p_mngr->vf_count; in qed_cxt_qm_iids()
401 iids->tids += vf_tids * p_mngr->vf_count; in qed_cxt_qm_iids()
490 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_set_proto_tid_count() local
491 struct qed_tid_seg *p_seg = &p_mngr->conn_cfg[proto].tid_seg[seg]; in qed_cxt_set_proto_tid_count()
574 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_cfg_ilt_compute() local
589 p_mngr->pf_start_line = RESC_START(p_hwfn, QED_ILT); in qed_cxt_cfg_ilt_compute()
596 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_CDUC]); in qed_cxt_cfg_ilt_compute()
598 curr_line = p_mngr->pf_start_line; in qed_cxt_cfg_ilt_compute()
604 qed_cxt_cdu_iids(p_mngr, &cdu_iids); in qed_cxt_cfg_ilt_compute()
629 for (i = 1; i < p_mngr->vf_count; i++) in qed_cxt_cfg_ilt_compute()
634 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_CDUT]); in qed_cxt_cfg_ilt_compute()
644 total = p_seg->count * p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute()
646 p_mngr->task_type_size[p_seg->type]); in qed_cxt_cfg_ilt_compute()
683 total = p_seg->count * p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute()
687 p_mngr->task_type_size[p_seg->type]); in qed_cxt_cfg_ilt_compute()
702 total = p_seg->count * p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute()
707 p_mngr->task_type_size[p_seg->type]); in qed_cxt_cfg_ilt_compute()
720 task_size = p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute()
730 for (i = 1; i < p_mngr->vf_count; i++) { in qed_cxt_cfg_ilt_compute()
742 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_QM]); in qed_cxt_cfg_ilt_compute()
767 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_SRC]); in qed_cxt_cfg_ilt_compute()
768 qed_cxt_src_iids(p_mngr, &src_iids); in qed_cxt_cfg_ilt_compute()
774 total = src_iids.pf_cids + src_iids.per_vf_cids * p_mngr->vf_count; in qed_cxt_cfg_ilt_compute()
792 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_TM]); in qed_cxt_cfg_ilt_compute()
793 qed_cxt_tm_iids(p_hwfn, p_mngr, &tm_iids); in qed_cxt_cfg_ilt_compute()
816 for (i = 1; i < p_mngr->vf_count; i++) in qed_cxt_cfg_ilt_compute()
825 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_TSDM]); in qed_cxt_cfg_ilt_compute()
848 struct qed_cxt_mngr *p_mngr; in qed_cxt_cfg_ilt_compute_excess() local
862 p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_cfg_ilt_compute_excess()
863 p_cli = &p_mngr->clients[ILT_CLI_CDUT]; in qed_cxt_cfg_ilt_compute_excess()
871 elem_size = p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute_excess()
884 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_src_t2_free() local
887 if (!p_mngr->t2) in qed_cxt_src_t2_free()
890 for (i = 0; i < p_mngr->t2_num_pages; i++) in qed_cxt_src_t2_free()
891 if (p_mngr->t2[i].p_virt) in qed_cxt_src_t2_free()
893 p_mngr->t2[i].size, in qed_cxt_src_t2_free()
894 p_mngr->t2[i].p_virt, in qed_cxt_src_t2_free()
895 p_mngr->t2[i].p_phys); in qed_cxt_src_t2_free()
897 kfree(p_mngr->t2); in qed_cxt_src_t2_free()
898 p_mngr->t2 = NULL; in qed_cxt_src_t2_free()
903 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_src_t2_alloc() local
919 qed_cxt_src_iids(p_mngr, &src_iids); in qed_cxt_src_t2_alloc()
920 conn_num = src_iids.pf_cids + src_iids.per_vf_cids * p_mngr->vf_count; in qed_cxt_src_t2_alloc()
925 p_mngr->t2_num_pages = DIV_ROUND_UP(total_size, psz); in qed_cxt_src_t2_alloc()
928 p_mngr->t2 = kcalloc(p_mngr->t2_num_pages, sizeof(struct qed_dma_mem), in qed_cxt_src_t2_alloc()
930 if (!p_mngr->t2) { in qed_cxt_src_t2_alloc()
936 for (i = 0; i < p_mngr->t2_num_pages; i++) { in qed_cxt_src_t2_alloc()
938 void **p_virt = &p_mngr->t2[i].p_virt; in qed_cxt_src_t2_alloc()
941 size, &p_mngr->t2[i].p_phys, in qed_cxt_src_t2_alloc()
943 if (!p_mngr->t2[i].p_virt) { in qed_cxt_src_t2_alloc()
947 p_mngr->t2[i].size = size; in qed_cxt_src_t2_alloc()
956 p_mngr->first_free = (u64) p_mngr->t2[0].p_phys; in qed_cxt_src_t2_alloc()
958 p_t2 = &p_mngr->t2[(conn_num - 1) / ent_per_page]; in qed_cxt_src_t2_alloc()
959 p_mngr->last_free = (u64) p_t2->p_phys + in qed_cxt_src_t2_alloc()
962 for (i = 0; i < p_mngr->t2_num_pages; i++) { in qed_cxt_src_t2_alloc()
966 struct src_ent *entries = p_mngr->t2[i].p_virt; in qed_cxt_src_t2_alloc()
967 u64 p_ent_phys = (u64) p_mngr->t2[i].p_phys, val; in qed_cxt_src_t2_alloc()
975 if (i < p_mngr->t2_num_pages - 1) in qed_cxt_src_t2_alloc()
976 val = (u64) p_mngr->t2[i + 1].p_phys; in qed_cxt_src_t2_alloc()
1012 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_ilt_shadow_free() local
1017 for (i = 0; p_mngr->ilt_shadow && i < ilt_size; i++) { in qed_ilt_shadow_free()
1018 struct qed_dma_mem *p_dma = &p_mngr->ilt_shadow[i]; in qed_ilt_shadow_free()
1026 kfree(p_mngr->ilt_shadow); in qed_ilt_shadow_free()
1080 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_ilt_shadow_alloc() local
1081 struct qed_ilt_client_cfg *clients = p_mngr->clients; in qed_ilt_shadow_alloc()
1087 p_mngr->ilt_shadow = kcalloc(size, sizeof(struct qed_dma_mem), in qed_ilt_shadow_alloc()
1089 if (!p_mngr->ilt_shadow) { in qed_ilt_shadow_alloc()
1105 for (k = 0; k < p_mngr->vf_count; k++) { in qed_ilt_shadow_alloc()
1126 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cid_map_free() local
1130 kfree(p_mngr->acquired[type].cid_map); in qed_cid_map_free()
1131 p_mngr->acquired[type].max_count = 0; in qed_cid_map_free()
1132 p_mngr->acquired[type].start_cid = 0; in qed_cid_map_free()
1135 kfree(p_mngr->acquired_vf[type][vf].cid_map); in qed_cid_map_free()
1136 p_mngr->acquired_vf[type][vf].max_count = 0; in qed_cid_map_free()
1137 p_mngr->acquired_vf[type][vf].start_cid = 0; in qed_cid_map_free()
1172 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cid_map_alloc() local
1177 struct qed_conn_type_cfg *p_cfg = &p_mngr->conn_cfg[type]; in qed_cid_map_alloc()
1181 p_map = &p_mngr->acquired[type]; in qed_cid_map_alloc()
1188 p_map = &p_mngr->acquired_vf[type][vf]; in qed_cid_map_alloc()
1209 struct qed_cxt_mngr *p_mngr; in qed_cxt_mngr_alloc() local
1212 p_mngr = kzalloc(sizeof(*p_mngr), GFP_KERNEL); in qed_cxt_mngr_alloc()
1213 if (!p_mngr) in qed_cxt_mngr_alloc()
1217 clients = p_mngr->clients; in qed_cxt_mngr_alloc()
1243 p_mngr->clients[i].p_size.val = ILT_DEFAULT_HW_P_SIZE; in qed_cxt_mngr_alloc()
1246 p_mngr->task_type_size[0] = TYPE0_TASK_CXT_SIZE(p_hwfn); in qed_cxt_mngr_alloc()
1247 p_mngr->task_type_size[1] = TYPE1_TASK_CXT_SIZE(p_hwfn); in qed_cxt_mngr_alloc()
1250 p_mngr->vf_count = p_hwfn->cdev->p_iov_info->total_vfs; in qed_cxt_mngr_alloc()
1252 mutex_init(&p_mngr->mutex); in qed_cxt_mngr_alloc()
1255 p_hwfn->p_cxt_mngr = p_mngr; in qed_cxt_mngr_alloc()
1301 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_mngr_setup() local
1311 p_cfg = &p_mngr->conn_cfg[type]; in qed_cxt_mngr_setup()
1313 p_map = &p_mngr->acquired[type]; in qed_cxt_mngr_setup()
1325 p_map = &p_mngr->acquired_vf[type][vf]; in qed_cxt_mngr_setup()
1544 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_dq_init_pf() local
1547 dq_pf_max_cid += (p_mngr->conn_cfg[0].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1550 dq_vf_max_cid += (p_mngr->conn_cfg[0].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1553 dq_pf_max_cid += (p_mngr->conn_cfg[1].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1556 dq_vf_max_cid += (p_mngr->conn_cfg[1].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1559 dq_pf_max_cid += (p_mngr->conn_cfg[2].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1562 dq_vf_max_cid += (p_mngr->conn_cfg[2].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1565 dq_pf_max_cid += (p_mngr->conn_cfg[3].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1568 dq_vf_max_cid += (p_mngr->conn_cfg[3].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1571 dq_pf_max_cid += (p_mngr->conn_cfg[4].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1574 dq_vf_max_cid += (p_mngr->conn_cfg[4].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1577 dq_pf_max_cid += (p_mngr->conn_cfg[5].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1580 dq_vf_max_cid += (p_mngr->conn_cfg[5].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1677 struct qed_cxt_mngr *p_mngr; in qed_ilt_init_pf() local
1684 p_mngr = p_hwfn->p_cxt_mngr; in qed_ilt_init_pf()
1685 p_shdw = p_mngr->ilt_shadow; in qed_ilt_init_pf()
1692 line = clients[i].first.val - p_mngr->pf_start_line; in qed_ilt_init_pf()
1696 for (; line <= clients[i].last.val - p_mngr->pf_start_line; in qed_ilt_init_pf()
1722 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_src_init_pf() local
1727 qed_cxt_src_iids(p_mngr, &src_iids); in qed_src_init_pf()
1728 conn_num = src_iids.pf_cids + src_iids.per_vf_cids * p_mngr->vf_count; in qed_src_init_pf()
1763 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_tm_init_pf() local
1770 qed_cxt_tm_iids(p_hwfn, p_mngr, &tm_iids); in qed_tm_init_pf()
1775 for (i = 0; i < p_mngr->vf_count; i++) { in qed_tm_init_pf()
1807 for (i = 0; i < p_mngr->vf_count; i++) { in qed_tm_init_pf()
1860 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_prs_init_pf() local
1864 p_fcoe = &p_mngr->conn_cfg[PROTOCOLID_FCOE]; in qed_prs_init_pf()
1903 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in _qed_cxt_acquire_cid() local
1919 p_map = &p_mngr->acquired[type]; in _qed_cxt_acquire_cid()
1921 p_map = &p_mngr->acquired_vf[type][vfid]; in _qed_cxt_acquire_cid()
1958 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_test_cid_acquired() local
1964 *pp_map = &p_mngr->acquired[*p_type]; in qed_cxt_test_cid_acquired()
1966 *pp_map = &p_mngr->acquired_vf[*p_type][vfid]; in qed_cxt_test_cid_acquired()
2030 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_get_cid_info() local
2054 if (!p_mngr->ilt_shadow[line].p_virt) in qed_cxt_get_cid_info()
2057 p_info->p_cxt = p_mngr->ilt_shadow[line].p_virt + in qed_cxt_get_cid_info()
2202 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_get_tid_mem_info() local
2222 p_cli = &p_mngr->clients[ILT_CLI_CDUT]; in qed_cxt_get_tid_mem_info()
2226 p_seg_info = &p_mngr->conn_cfg[proto].tid_seg[seg]; in qed_cxt_get_tid_mem_info()
2237 p_info->blocks[i] = p_mngr->ilt_shadow[shadow_line].p_virt; in qed_cxt_get_tid_mem_info()
2241 p_info->tid_size = p_mngr->task_type_size[p_seg_info->type]; in qed_cxt_get_tid_mem_info()
2502 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_get_task_ctx() local
2525 p_cli = &p_mngr->clients[ILT_CLI_CDUT]; in qed_cxt_get_task_ctx()
2529 p_seg_info = &p_mngr->conn_cfg[proto].tid_seg[seg]; in qed_cxt_get_task_ctx()
2541 tid_size = p_mngr->task_type_size[p_seg_info->type]; in qed_cxt_get_task_ctx()
2548 p_mngr->pf_start_line; in qed_cxt_get_task_ctx()
2549 *pp_task_ctx = (u8 *)p_mngr->ilt_shadow[ilt_idx].p_virt + in qed_cxt_get_task_ctx()