Lines Matching refs:p_mngr

272 static void qed_cxt_cdu_iids(struct qed_cxt_mngr *p_mngr,  in qed_cxt_cdu_iids()  argument
278 iids->pf_cids += p_mngr->conn_cfg[type].cid_count; in qed_cxt_cdu_iids()
279 iids->per_vf_cids += p_mngr->conn_cfg[type].cids_per_vf; in qed_cxt_cdu_iids()
289 static void qed_cxt_src_iids(struct qed_cxt_mngr *p_mngr, in qed_cxt_src_iids() argument
298 iids->pf_cids += p_mngr->conn_cfg[i].cid_count; in qed_cxt_src_iids()
299 iids->per_vf_cids += p_mngr->conn_cfg[i].cids_per_vf; in qed_cxt_src_iids()
303 iids->pf_cids += p_mngr->arfs_count; in qed_cxt_src_iids()
316 struct qed_cxt_mngr *p_mngr, in qed_cxt_tm_iids() argument
330 struct qed_conn_type_cfg *p_cfg = &p_mngr->conn_cfg[i]; in qed_cxt_tm_iids()
376 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_qm_iids() local
382 iids->cids += p_mngr->conn_cfg[type].cid_count; in qed_cxt_qm_iids()
383 vf_cids += p_mngr->conn_cfg[type].cids_per_vf; in qed_cxt_qm_iids()
385 segs = p_mngr->conn_cfg[type].tid_seg; in qed_cxt_qm_iids()
399 iids->vf_cids += vf_cids * p_mngr->vf_count; in qed_cxt_qm_iids()
400 iids->tids += vf_tids * p_mngr->vf_count; in qed_cxt_qm_iids()
489 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_set_proto_tid_count() local
490 struct qed_tid_seg *p_seg = &p_mngr->conn_cfg[proto].tid_seg[seg]; in qed_cxt_set_proto_tid_count()
573 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_cfg_ilt_compute() local
588 p_mngr->pf_start_line = RESC_START(p_hwfn, QED_ILT); in qed_cxt_cfg_ilt_compute()
595 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_CDUC]); in qed_cxt_cfg_ilt_compute()
597 curr_line = p_mngr->pf_start_line; in qed_cxt_cfg_ilt_compute()
603 qed_cxt_cdu_iids(p_mngr, &cdu_iids); in qed_cxt_cfg_ilt_compute()
628 for (i = 1; i < p_mngr->vf_count; i++) in qed_cxt_cfg_ilt_compute()
633 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_CDUT]); in qed_cxt_cfg_ilt_compute()
643 total = p_seg->count * p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute()
645 p_mngr->task_type_size[p_seg->type]); in qed_cxt_cfg_ilt_compute()
682 total = p_seg->count * p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute()
686 p_mngr->task_type_size[p_seg->type]); in qed_cxt_cfg_ilt_compute()
701 total = p_seg->count * p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute()
706 p_mngr->task_type_size[p_seg->type]); in qed_cxt_cfg_ilt_compute()
719 task_size = p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute()
729 for (i = 1; i < p_mngr->vf_count; i++) { in qed_cxt_cfg_ilt_compute()
741 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_QM]); in qed_cxt_cfg_ilt_compute()
766 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_SRC]); in qed_cxt_cfg_ilt_compute()
767 qed_cxt_src_iids(p_mngr, &src_iids); in qed_cxt_cfg_ilt_compute()
773 total = src_iids.pf_cids + src_iids.per_vf_cids * p_mngr->vf_count; in qed_cxt_cfg_ilt_compute()
791 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_TM]); in qed_cxt_cfg_ilt_compute()
792 qed_cxt_tm_iids(p_hwfn, p_mngr, &tm_iids); in qed_cxt_cfg_ilt_compute()
815 for (i = 1; i < p_mngr->vf_count; i++) in qed_cxt_cfg_ilt_compute()
824 p_cli = qed_cxt_set_cli(&p_mngr->clients[ILT_CLI_TSDM]); in qed_cxt_cfg_ilt_compute()
847 struct qed_cxt_mngr *p_mngr; in qed_cxt_cfg_ilt_compute_excess() local
861 p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_cfg_ilt_compute_excess()
862 p_cli = &p_mngr->clients[ILT_CLI_CDUT]; in qed_cxt_cfg_ilt_compute_excess()
870 elem_size = p_mngr->task_type_size[p_seg->type]; in qed_cxt_cfg_ilt_compute_excess()
883 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_src_t2_free() local
886 if (!p_mngr->t2) in qed_cxt_src_t2_free()
889 for (i = 0; i < p_mngr->t2_num_pages; i++) in qed_cxt_src_t2_free()
890 if (p_mngr->t2[i].p_virt) in qed_cxt_src_t2_free()
892 p_mngr->t2[i].size, in qed_cxt_src_t2_free()
893 p_mngr->t2[i].p_virt, in qed_cxt_src_t2_free()
894 p_mngr->t2[i].p_phys); in qed_cxt_src_t2_free()
896 kfree(p_mngr->t2); in qed_cxt_src_t2_free()
897 p_mngr->t2 = NULL; in qed_cxt_src_t2_free()
902 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_src_t2_alloc() local
918 qed_cxt_src_iids(p_mngr, &src_iids); in qed_cxt_src_t2_alloc()
919 conn_num = src_iids.pf_cids + src_iids.per_vf_cids * p_mngr->vf_count; in qed_cxt_src_t2_alloc()
924 p_mngr->t2_num_pages = DIV_ROUND_UP(total_size, psz); in qed_cxt_src_t2_alloc()
927 p_mngr->t2 = kcalloc(p_mngr->t2_num_pages, sizeof(struct qed_dma_mem), in qed_cxt_src_t2_alloc()
929 if (!p_mngr->t2) { in qed_cxt_src_t2_alloc()
935 for (i = 0; i < p_mngr->t2_num_pages; i++) { in qed_cxt_src_t2_alloc()
937 void **p_virt = &p_mngr->t2[i].p_virt; in qed_cxt_src_t2_alloc()
940 &p_mngr->t2[i].p_phys, in qed_cxt_src_t2_alloc()
942 if (!p_mngr->t2[i].p_virt) { in qed_cxt_src_t2_alloc()
946 p_mngr->t2[i].size = size; in qed_cxt_src_t2_alloc()
955 p_mngr->first_free = (u64) p_mngr->t2[0].p_phys; in qed_cxt_src_t2_alloc()
957 p_t2 = &p_mngr->t2[(conn_num - 1) / ent_per_page]; in qed_cxt_src_t2_alloc()
958 p_mngr->last_free = (u64) p_t2->p_phys + in qed_cxt_src_t2_alloc()
961 for (i = 0; i < p_mngr->t2_num_pages; i++) { in qed_cxt_src_t2_alloc()
965 struct src_ent *entries = p_mngr->t2[i].p_virt; in qed_cxt_src_t2_alloc()
966 u64 p_ent_phys = (u64) p_mngr->t2[i].p_phys, val; in qed_cxt_src_t2_alloc()
974 if (i < p_mngr->t2_num_pages - 1) in qed_cxt_src_t2_alloc()
975 val = (u64) p_mngr->t2[i + 1].p_phys; in qed_cxt_src_t2_alloc()
1011 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_ilt_shadow_free() local
1016 for (i = 0; p_mngr->ilt_shadow && i < ilt_size; i++) { in qed_ilt_shadow_free()
1017 struct qed_dma_mem *p_dma = &p_mngr->ilt_shadow[i]; in qed_ilt_shadow_free()
1025 kfree(p_mngr->ilt_shadow); in qed_ilt_shadow_free()
1079 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_ilt_shadow_alloc() local
1080 struct qed_ilt_client_cfg *clients = p_mngr->clients; in qed_ilt_shadow_alloc()
1086 p_mngr->ilt_shadow = kcalloc(size, sizeof(struct qed_dma_mem), in qed_ilt_shadow_alloc()
1088 if (!p_mngr->ilt_shadow) { in qed_ilt_shadow_alloc()
1104 for (k = 0; k < p_mngr->vf_count; k++) { in qed_ilt_shadow_alloc()
1125 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cid_map_free() local
1129 kfree(p_mngr->acquired[type].cid_map); in qed_cid_map_free()
1130 p_mngr->acquired[type].max_count = 0; in qed_cid_map_free()
1131 p_mngr->acquired[type].start_cid = 0; in qed_cid_map_free()
1134 kfree(p_mngr->acquired_vf[type][vf].cid_map); in qed_cid_map_free()
1135 p_mngr->acquired_vf[type][vf].max_count = 0; in qed_cid_map_free()
1136 p_mngr->acquired_vf[type][vf].start_cid = 0; in qed_cid_map_free()
1171 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cid_map_alloc() local
1176 struct qed_conn_type_cfg *p_cfg = &p_mngr->conn_cfg[type]; in qed_cid_map_alloc()
1180 p_map = &p_mngr->acquired[type]; in qed_cid_map_alloc()
1187 p_map = &p_mngr->acquired_vf[type][vf]; in qed_cid_map_alloc()
1208 struct qed_cxt_mngr *p_mngr; in qed_cxt_mngr_alloc() local
1211 p_mngr = kzalloc(sizeof(*p_mngr), GFP_KERNEL); in qed_cxt_mngr_alloc()
1212 if (!p_mngr) in qed_cxt_mngr_alloc()
1216 clients = p_mngr->clients; in qed_cxt_mngr_alloc()
1242 p_mngr->clients[i].p_size.val = ILT_DEFAULT_HW_P_SIZE; in qed_cxt_mngr_alloc()
1245 p_mngr->task_type_size[0] = TYPE0_TASK_CXT_SIZE(p_hwfn); in qed_cxt_mngr_alloc()
1246 p_mngr->task_type_size[1] = TYPE1_TASK_CXT_SIZE(p_hwfn); in qed_cxt_mngr_alloc()
1249 p_mngr->vf_count = p_hwfn->cdev->p_iov_info->total_vfs; in qed_cxt_mngr_alloc()
1251 mutex_init(&p_mngr->mutex); in qed_cxt_mngr_alloc()
1254 p_hwfn->p_cxt_mngr = p_mngr; in qed_cxt_mngr_alloc()
1300 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_mngr_setup() local
1310 p_cfg = &p_mngr->conn_cfg[type]; in qed_cxt_mngr_setup()
1312 p_map = &p_mngr->acquired[type]; in qed_cxt_mngr_setup()
1324 p_map = &p_mngr->acquired_vf[type][vf]; in qed_cxt_mngr_setup()
1543 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_dq_init_pf() local
1546 dq_pf_max_cid += (p_mngr->conn_cfg[0].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1549 dq_vf_max_cid += (p_mngr->conn_cfg[0].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1552 dq_pf_max_cid += (p_mngr->conn_cfg[1].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1555 dq_vf_max_cid += (p_mngr->conn_cfg[1].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1558 dq_pf_max_cid += (p_mngr->conn_cfg[2].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1561 dq_vf_max_cid += (p_mngr->conn_cfg[2].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1564 dq_pf_max_cid += (p_mngr->conn_cfg[3].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1567 dq_vf_max_cid += (p_mngr->conn_cfg[3].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1570 dq_pf_max_cid += (p_mngr->conn_cfg[4].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1573 dq_vf_max_cid += (p_mngr->conn_cfg[4].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1576 dq_pf_max_cid += (p_mngr->conn_cfg[5].cid_count >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1579 dq_vf_max_cid += (p_mngr->conn_cfg[5].cids_per_vf >> DQ_RANGE_SHIFT); in qed_dq_init_pf()
1676 struct qed_cxt_mngr *p_mngr; in qed_ilt_init_pf() local
1683 p_mngr = p_hwfn->p_cxt_mngr; in qed_ilt_init_pf()
1684 p_shdw = p_mngr->ilt_shadow; in qed_ilt_init_pf()
1691 line = clients[i].first.val - p_mngr->pf_start_line; in qed_ilt_init_pf()
1695 for (; line <= clients[i].last.val - p_mngr->pf_start_line; in qed_ilt_init_pf()
1721 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_src_init_pf() local
1726 qed_cxt_src_iids(p_mngr, &src_iids); in qed_src_init_pf()
1727 conn_num = src_iids.pf_cids + src_iids.per_vf_cids * p_mngr->vf_count; in qed_src_init_pf()
1762 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_tm_init_pf() local
1769 qed_cxt_tm_iids(p_hwfn, p_mngr, &tm_iids); in qed_tm_init_pf()
1774 for (i = 0; i < p_mngr->vf_count; i++) { in qed_tm_init_pf()
1806 for (i = 0; i < p_mngr->vf_count; i++) { in qed_tm_init_pf()
1859 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_prs_init_pf() local
1863 p_fcoe = &p_mngr->conn_cfg[PROTOCOLID_FCOE]; in qed_prs_init_pf()
1902 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in _qed_cxt_acquire_cid() local
1918 p_map = &p_mngr->acquired[type]; in _qed_cxt_acquire_cid()
1920 p_map = &p_mngr->acquired_vf[type][vfid]; in _qed_cxt_acquire_cid()
1957 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_test_cid_acquired() local
1963 *pp_map = &p_mngr->acquired[*p_type]; in qed_cxt_test_cid_acquired()
1965 *pp_map = &p_mngr->acquired_vf[*p_type][vfid]; in qed_cxt_test_cid_acquired()
2029 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_get_cid_info() local
2053 if (!p_mngr->ilt_shadow[line].p_virt) in qed_cxt_get_cid_info()
2056 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()
2503 struct qed_cxt_mngr *p_mngr = p_hwfn->p_cxt_mngr; in qed_cxt_get_task_ctx() local
2526 p_cli = &p_mngr->clients[ILT_CLI_CDUT]; in qed_cxt_get_task_ctx()
2530 p_seg_info = &p_mngr->conn_cfg[proto].tid_seg[seg]; in qed_cxt_get_task_ctx()
2542 tid_size = p_mngr->task_type_size[p_seg_info->type]; in qed_cxt_get_task_ctx()
2549 p_mngr->pf_start_line; in qed_cxt_get_task_ctx()
2550 *pp_task_ctx = (u8 *)p_mngr->ilt_shadow[ilt_idx].p_virt + in qed_cxt_get_task_ctx()