Lines Matching refs:cid
11 void * lm_get_context(struct _lm_device_t *pdev, u32_t cid){ in lm_get_context() argument
16 DbgBreakIf(cid > pdev->params.max_func_connections); in lm_get_context()
17 DbgBreakIf(pdev->context_info->array[cid].invalid != LM_CONTEXT_VALID); in lm_get_context()
20 page = cid / (pdev->params.num_context_in_page); in lm_get_context()
23 off = cid % (pdev->params.num_context_in_page); in lm_get_context()
33 u64_t lm_get_context_phys(struct _lm_device_t *pdev, u32_t cid){ in lm_get_context_phys() argument
38 DbgBreakIf(cid > pdev->params.max_func_connections); in lm_get_context_phys()
39 DbgBreakIf(pdev->context_info->array[cid].invalid != LM_CONTEXT_VALID); in lm_get_context_phys()
42 page = cid / (pdev->params.num_context_in_page); in lm_get_context_phys()
45 off = cid % (pdev->params.num_context_in_page); in lm_get_context_phys()
167 lm_status_t lm_init_cid_resc(struct _lm_device_t *pdev, u32_t cid) in lm_init_cid_resc() argument
177 cid_resc = &pdev->context_info->array[cid].cid_resc; in lm_init_cid_resc()
189 lm_sp_req_manager_init(pdev, cid); in lm_init_cid_resc()
446 lm_status_t lm_searcher_mirror_hash_insert(struct _lm_device_t *pdev, u32_t cid, lm_4tuple_t *tuple) in lm_searcher_mirror_hash_insert() argument
503 DbgBreakIf(context->array[cid].ip_type); /* cid can't be inserted twice */ in lm_searcher_mirror_hash_insert()
504 context->array[cid].ip_type = tuple->ip_type; in lm_searcher_mirror_hash_insert()
505 context->array[cid].h_val = h_val; in lm_searcher_mirror_hash_insert()
515 void lm_searcher_mirror_hash_remove(struct _lm_device_t *pdev, u32_t cid) in lm_searcher_mirror_hash_remove() argument
526 if(!context->array[cid].ip_type) { in lm_searcher_mirror_hash_remove()
530 ,cid); in lm_searcher_mirror_hash_remove()
538 h_val = context->array[cid].h_val; in lm_searcher_mirror_hash_remove()
541 if (context->array[cid].ip_type == LM_IP_TYPE_V6) { in lm_searcher_mirror_hash_remove()
559 context->array[cid].ip_type = 0; in lm_searcher_mirror_hash_remove()
560 context->array[cid].h_val = 0; in lm_searcher_mirror_hash_remove()
576 u32_t cid = (u32_t)-1; in lm_allocate_cid() local
614 cid = context->proto_pending[type]; in lm_allocate_cid()
615 context->proto_pending[type] = context->array[cid].next; in lm_allocate_cid()
616 context->array[cid].next = 0; in lm_allocate_cid()
617 context->array[cid].cid_resc.cookies[type] = cookie; in lm_allocate_cid()
618 context->array[cid].cid_resc.cid_pending = LM_CID_STATE_PENDING; in lm_allocate_cid()
619 lm_sp_req_manager_init(pdev, cid); in lm_allocate_cid()
620 *out_cid = cid; in lm_allocate_cid()
623 cid = context->proto_pending[type]; in lm_allocate_cid()
624 if (cid) { in lm_allocate_cid()
625 context->array[cid].prev = 0; in lm_allocate_cid()
631 cid = context->proto_ffree[type]; in lm_allocate_cid()
632 context->proto_ffree[type] = context->array[cid].next; in lm_allocate_cid()
633 context->array[cid].next = 0; in lm_allocate_cid()
634 context->array[cid].prev = 0; in lm_allocate_cid()
635 context->array[cid].cid_resc.cookies[type] = cookie; in lm_allocate_cid()
636 lm_sp_req_manager_init(pdev, cid); in lm_allocate_cid()
637 *out_cid = cid; in lm_allocate_cid()
652 LM_INC64(&phy_addr,(cid*LM_DQ_CID_SIZE)); in lm_allocate_cid()
656 context->array[cid].cid_resc.mapped_cid_bar_addr = in lm_allocate_cid()
658 (volatile void *)((u8_t*)pdev->vars.mapped_bar_addr[BAR_1] + cid*LM_DQ_CID_SIZE); in lm_allocate_cid()
659 context->array[cid].cid_resc.reg_handle = pdev->vars.reg_handle[BAR_1]; in lm_allocate_cid()
664 (cid * LM_DQ_CID_SIZE), in lm_allocate_cid()
666 &context->array[cid].cid_resc.reg_handle); in lm_allocate_cid()
671 context->array[cid].cid_resc.mapped_cid_bar_addr = in lm_allocate_cid()
673 (volatile void *)((u8_t*)pdev->vars.mapped_bar_addr[BAR_1] + cid*LM_DQ_CID_SIZE); in lm_allocate_cid()
681 if CHK_NULL(context->array[cid].cid_resc.mapped_cid_bar_addr) in lm_allocate_cid()
688 context->array[cid].next = pdev->context_info->proto_ffree[type]; in lm_allocate_cid()
689 context->proto_ffree[type] = cid; in lm_allocate_cid()
690 context->array[cid].invalid = LM_CONTEXT_VALID; in lm_allocate_cid()
702 u32_t cid = (u32_t)(uintptr_t)param; in lm_cfc_delete() local
706 ERR_IF(cid > pdev->params.max_func_connections) || in lm_cfc_delete()
707 ERR_IF(pdev->context_info->array[cid].invalid != LM_CONTEXT_INVALID_WAIT) ) in lm_cfc_delete()
710 DbgBreakIf(cid > pdev->params.max_func_connections); in lm_cfc_delete()
714 DbgBreakIf(pdev->context_info->array[cid].invalid != LM_CONTEXT_INVALID_WAIT); in lm_cfc_delete()
718 …pdev, FATAL, "lm_cfc_delete: invalid %d for cid=%d\n", pdev->context_info->array[cid].invalid,cid); in lm_cfc_delete()
720 if (pdev->context_info->array[cid].invalid != LM_CONTEXT_INVALID_DELETE) in lm_cfc_delete()
727 DbgMessage(pdev, WARN, "lm_cfc_delete: cid=0x%x\n",cid); in lm_cfc_delete()
728 pdev->context_info->array[cid].invalid = LM_CONTEXT_INVALID_DELETE; in lm_cfc_delete()
732 lm_recycle_cid(pdev, cid); in lm_cfc_delete()
738 cid, in lm_cfc_delete()
749 void lm_free_cid(struct _lm_device_t *pdev, u32_t type, u32_t cid, u8_t notify_fw){ in lm_free_cid() argument
758 ERR_IF(cid > (pdev->context_info->proto_end[type])) || in lm_free_cid()
759 ERR_IF(cid < (pdev->context_info->proto_start[type])) || in lm_free_cid()
760 …(!lm_fl_reset_is_inprogress(pdev) && (pdev->context_info->array[cid].invalid != LM_CONTEXT_VALID))) in lm_free_cid()
765 DbgBreakIf(cid > (pdev->context_info->proto_end[type])); in lm_free_cid()
766 DbgBreakIf(cid < (pdev->context_info->proto_start[type])); in lm_free_cid()
767 DbgBreakIf(pdev->context_info->array[cid].invalid != LM_CONTEXT_VALID); in lm_free_cid()
774 DbgBreakIf(pdev->context_info->array[cid].cid_resc.cookies[proto_idx]); in lm_free_cid()
777 lm_sp_req_manager_shutdown(pdev, cid); in lm_free_cid()
788 pdev->context_info->array[cid].invalid = LM_CONTEXT_INVALID_WAIT; in lm_free_cid()
793 pdev->context_info->array[cid].next = curr_cid; in lm_free_cid()
794 pdev->context_info->array[cid].prev = 0; in lm_free_cid()
797 pdev->context_info->array[curr_cid].prev = cid; in lm_free_cid()
799 pdev->context_info->proto_pending[type] = cid; in lm_free_cid()
803 pdev->context_info->array[cid].invalid = LM_CONTEXT_INVALID_DELETE; in lm_free_cid()
811 lm_recycle_cid(pdev, cid); in lm_free_cid()
817 DbgMessage(pdev, WARN, "lm_free_cid: CFC delete: cid=0x%x\n",cid); in lm_free_cid()
818 lm_cfc_delete(pdev,(void *)(uintptr_t)cid); in lm_free_cid()
822 DbgMessage(pdev, WARN, "lm_free_cid: schedule CFC delete: cid=0x%x\n",cid); in lm_free_cid()
824 (void *)(uintptr_t)cid); in lm_free_cid()
830 void lm_recycle_cid(struct _lm_device_t *pdev, u32_t cid){ in lm_recycle_cid() argument
838 ERR_IF(pdev->context_info->array[cid].invalid != LM_CONTEXT_INVALID_DELETE) || in lm_recycle_cid()
839 ERR_IF(cid > pdev->params.max_func_connections) ) in lm_recycle_cid()
842 DbgBreakIf(pdev->context_info->array[cid].invalid != LM_CONTEXT_INVALID_DELETE); in lm_recycle_cid()
843 DbgBreakIf(cid > pdev->params.max_func_connections); in lm_recycle_cid()
848 … if ((cid >= pdev->context_info->proto_start[i]) && (cid <= pdev->context_info->proto_end[i])) in lm_recycle_cid()
868 if (pdev->context_info->array[cid].cid_resc.cid_pending == FALSE) { in lm_recycle_cid()
870 prev_cid = pdev->context_info->array[cid].prev; in lm_recycle_cid()
871 next_cid = pdev->context_info->array[cid].next; in lm_recycle_cid()
878 if (pdev->context_info->proto_pending[type] == cid) { in lm_recycle_cid()
882 pdev->context_info->array[cid].prev = pdev->context_info->array[cid].next = 0; in lm_recycle_cid()
884 pdev->context_info->array[cid].next = pdev->context_info->proto_ffree[type]; in lm_recycle_cid()
885 pdev->context_info->array[cid].invalid = LM_CONTEXT_VALID; in lm_recycle_cid()
886 pdev->context_info->array[cid].cfc_delete_cnt = 0; in lm_recycle_cid()
887 pdev->context_info->proto_ffree[type] = cid; in lm_recycle_cid()
891 …mm_unmap_io_space(pdev,(void *)pdev->context_info->array[cid].cid_resc.mapped_cid_bar_addr, LM_DQ_… in lm_recycle_cid()
901 pdev->context_info->array[cid].invalid = LM_CONTEXT_VALID; in lm_recycle_cid()
906 lm_set_cdu_validation_data(pdev, cid, TRUE /* Invalidate */); in lm_recycle_cid()
915 …ev->cid_recycled_callbacks[type](pdev, pdev->context_info->array[cid].cid_resc.cookies[type], cid); in lm_recycle_cid()
924 void * lm_cid_cookie(struct _lm_device_t *pdev, u32_t type, u32_t cid){ in lm_cid_cookie() argument
929 ERR_IF(cid > (pdev->context_info->proto_end[MAX_PROTO - 1])) || in lm_cid_cookie()
930 CHK_NULL(pdev->context_info->array[cid].cid_resc.cookies[type]) || in lm_cid_cookie()
931 ERR_IF(pdev->context_info->array[cid].invalid != LM_CONTEXT_VALID) ) in lm_cid_cookie()
936 DbgBreakIf(cid > (pdev->context_info->proto_end[MAX_PROTO - 1])); in lm_cid_cookie()
937 DbgBreakIf(pdev->context_info->array[cid].invalid != LM_CONTEXT_VALID); in lm_cid_cookie()
940 if (pdev->context_info->array[cid].cid_resc.cookies[type] == NULL) in lm_cid_cookie()
947 if (pdev->context_info->array[cid].cid_resc.cid_pending != LM_CID_STATE_VALID) in lm_cid_cookie()
952 return pdev->context_info->array[cid].cid_resc.cookies[type]; in lm_cid_cookie()
958 lm_cid_resc_t * lm_cid_resc(struct _lm_device_t *pdev, u32_t cid){ in lm_cid_resc() argument
962 ERR_IF(cid > (pdev->context_info->proto_end[MAX_PROTO - 1])) ) in lm_cid_resc()
966 DbgBreakIf(cid > (pdev->context_info->proto_end[MAX_PROTO - 1])); in lm_cid_resc()
969 return &pdev->context_info->array[cid].cid_resc; in lm_cid_resc()
972 u8_t lm_map_cid_to_proto(struct _lm_device_t * pdev, u32_t cid) in lm_map_cid_to_proto() argument
977 if (!pdev || cid > pdev->params.max_func_connections) { in lm_map_cid_to_proto()
982 … if ((cid >= pdev->context_info->proto_start[i]) && (cid <= pdev->context_info->proto_end[i])) { in lm_map_cid_to_proto()
1017 IN u32_t cid) in lm_set_cid_resc() argument
1030 cid_resc = lm_cid_resc(pdev, cid); in lm_set_cid_resc()
1050 IN u32_t cid, in lm_free_cid_resc() argument
1057 if (CHK_NULL(pdev) || (cid == 0)) in lm_free_cid_resc()
1065 cid_resc = lm_cid_resc(pdev, cid); in lm_free_cid_resc()
1086 lm_free_cid(pdev, lm_map_cid_to_proto(pdev, cid), cid, notify_fw); in lm_free_cid_resc()
1097 IN u32_t cid in lm_cid_sp_req_mgr() argument
1107 cid_resc = lm_cid_resc(pdev, cid); in lm_cid_sp_req_mgr()
1122 IN u32_t cid in lm_cid_state() argument
1132 cid_resc = lm_cid_resc(pdev, cid); in lm_cid_state()
1147 IN u32_t cid, in lm_set_cid_state() argument
1161 cid_resc = lm_cid_resc(pdev, cid); in lm_set_cid_state()
1185 lm_status_t lm_set_cdu_validation_data(struct _lm_device_t *pdev, s32_t cid, u8_t invalidate) in lm_set_cdu_validation_data() argument
1193 context = lm_get_context(PFDEV(pdev), cid); in lm_set_cdu_validation_data()
1199 proto_type = lm_map_cid_to_proto(PFDEV(pdev), cid); in lm_set_cdu_validation_data()
1228 … *cdu_reserved = CDU_RSRVD_VALUE_TYPE_A(HW_CID(pdev, cid), CDU_REGION_NUMBER_XCM_AG, proto_type); in lm_set_cdu_validation_data()
1229 … *cdu_usage = CDU_RSRVD_VALUE_TYPE_A(HW_CID(pdev, cid), CDU_REGION_NUMBER_UCM_AG, proto_type); in lm_set_cdu_validation_data()
1243 lm_status_t lm_set_con_state(struct _lm_device_t *pdev, u32_t cid, u32_t state) in lm_set_con_state() argument
1245 lm_cid_resc_t * cid_resc = lm_cid_resc(pdev, cid); in lm_set_con_state()
1257 u32_t lm_get_con_state(struct _lm_device_t *pdev, u32_t cid) in lm_get_con_state() argument
1259 const lm_cid_resc_t * cid_resc = lm_cid_resc(pdev, cid); in lm_get_con_state()