Lines Matching refs:context

59     lm_context_info_t*       context    = NULL;  in lm_setup_searcher_hash_info()  local
69 context = pdev->context_info; in lm_setup_searcher_hash_info()
70 hash_info = &context->searcher_hash; in lm_setup_searcher_hash_info()
197 lm_context_info_t * context = NULL ; in lm_setup_context_pool() local
208 context = pdev->context_info; in lm_setup_context_pool()
210 if CHK_NULL(context) in lm_setup_context_pool()
212 DbgBreakIf( context == NULL ); in lm_setup_context_pool()
218 array = context->array ; in lm_setup_context_pool()
219 searcher_table = context->searcher_hash.searcher_table ; in lm_setup_context_pool()
221 mm_mem_zero( context, sizeof(lm_context_info_t) ) ; in lm_setup_context_pool()
223 context->array = array ; in lm_setup_context_pool()
224 context->searcher_hash.searcher_table = searcher_table ; in lm_setup_context_pool()
226 context->proto_start[ETH_CONNECTION_TYPE] = 0; in lm_setup_context_pool()
227 context->proto_end [ETH_CONNECTION_TYPE] = pdev->params.max_eth_including_vfs_conns - 1; in lm_setup_context_pool()
228 context->proto_start[TOE_CONNECTION_TYPE] = context->proto_end [ETH_CONNECTION_TYPE] + 1; in lm_setup_context_pool()
229context->proto_end [TOE_CONNECTION_TYPE] = context->proto_start[TOE_CONNECTION_TYPE] + pdev->… in lm_setup_context_pool()
230 context->proto_start[RDMA_CONNECTION_TYPE] = context->proto_end [TOE_CONNECTION_TYPE] + 1; in lm_setup_context_pool()
231context->proto_end [RDMA_CONNECTION_TYPE] = context->proto_start[RDMA_CONNECTION_TYPE] + pdev->… in lm_setup_context_pool()
232 context->proto_start[ISCSI_CONNECTION_TYPE] = context->proto_end [RDMA_CONNECTION_TYPE] + 1; in lm_setup_context_pool()
233context->proto_end [ISCSI_CONNECTION_TYPE] = context->proto_start[ISCSI_CONNECTION_TYPE] + pdev->… in lm_setup_context_pool()
234 context->proto_start[FCOE_CONNECTION_TYPE] = context->proto_end [ISCSI_CONNECTION_TYPE] + 1; in lm_setup_context_pool()
235context->proto_end [FCOE_CONNECTION_TYPE] = context->proto_start[FCOE_CONNECTION_TYPE] + pdev->… in lm_setup_context_pool()
236 DbgBreakIf(context->proto_end[MAX_PROTO - 1] > pdev->params.max_func_connections -1); in lm_setup_context_pool()
238 if CHK_NULL(context->array) in lm_setup_context_pool()
240 DbgBreakIf(!( context->array)); in lm_setup_context_pool()
244 mm_mem_zero(context->array, sizeof(struct lm_context_cookie)*num_con); in lm_setup_context_pool()
246 ASSERT_STATIC( ARRSIZE(context->proto_start) == ARRSIZE(context->proto_end) ); in lm_setup_context_pool()
249 for (i = 0; i < ARRSIZE(context->proto_start); i++ ) in lm_setup_context_pool()
251 for (j = context->proto_start[i]; j <= context->proto_end[i]; j++) in lm_setup_context_pool()
253 context->array[j].next = j+1; in lm_setup_context_pool()
254 context->array[j].invalid = LM_CONTEXT_VALID; in lm_setup_context_pool()
255 context->array[j].ip_type = 0; in lm_setup_context_pool()
256 context->array[j].h_val = 0; in lm_setup_context_pool()
260 if (context->proto_start[i] <= context->proto_end[i]) { in lm_setup_context_pool()
261 context->proto_ffree[i] = context->proto_start[i]; in lm_setup_context_pool()
265 context->proto_ffree[i] = 0; in lm_setup_context_pool()
267 context->proto_pending[i] = 0; in lm_setup_context_pool()
269 context->array[context->proto_end[i]].next = 0; in lm_setup_context_pool()
272 …for (j = context->proto_start[ETH_CONNECTION_TYPE]; j <= context->proto_end[ETH_CONNECTION_TYPE]; … in lm_setup_context_pool()
276 context->array[j].cid_resc.mapped_cid_bar_addr = in lm_setup_context_pool()
279 context->array[j].cid_resc.reg_handle = pdev->vars.reg_handle[BAR_0]; in lm_setup_context_pool()
284 context->array[j].cid_resc.mapped_cid_bar_addr = in lm_setup_context_pool()
287 context->array[j].cid_resc.reg_handle = pdev->vars.reg_handle[BAR_1]; in lm_setup_context_pool()
298 lm_context_info_t * context = NULL ; in lm_alloc_context_pool() local
321 context = mm_alloc_mem(pdev, sizeof(lm_context_info_t), mm_cli_idx); in lm_alloc_context_pool()
322 if CHK_NULL(context) in lm_alloc_context_pool()
329 context->array = mm_alloc_mem(pdev, sizeof(struct lm_context_cookie)*num_con, mm_cli_idx); in lm_alloc_context_pool()
330 if CHK_NULL(context->array) in lm_alloc_context_pool()
339 pdev->context_info = context; in lm_alloc_context_pool()
349 lm_context_info_t* context = NULL; in lm_release_context_pool() local
356 context = pdev->context_info; in lm_release_context_pool()
365 DbgBreakIf( context->array[i].cid_resc.cookies[j] != NULL ); in lm_release_context_pool()
374 DbgBreakIf(context->searcher_hash.num_tuples); in lm_release_context_pool()
448 lm_context_info_t *context = NULL; in lm_searcher_mirror_hash_insert() local
458 context = pdev->context_info; in lm_searcher_mirror_hash_insert()
462 h_val = _lm_searcher_mirror_hash_calc(&context->searcher_hash, tuple); in lm_searcher_mirror_hash_insert()
465 h_val &= ((1 << context->searcher_hash.num_hash_bits) - 1); in lm_searcher_mirror_hash_insert()
468 if (h_val == ((1 << context->searcher_hash.num_hash_bits) - 1)) { in lm_searcher_mirror_hash_insert()
473 hash_entry = &context->searcher_hash.searcher_table[h_val]; in lm_searcher_mirror_hash_insert()
496 … if (context->searcher_hash.hash_depth_reached < hash_entry->depth_ipv4 + hash_entry->num_ipv6) { in lm_searcher_mirror_hash_insert()
497context->searcher_hash.hash_depth_reached = hash_entry->depth_ipv4 + hash_entry->num_ipv6; in lm_searcher_mirror_hash_insert()
499 context->searcher_hash.num_tuples++; in lm_searcher_mirror_hash_insert()
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()
517 lm_context_info_t *context = NULL; in lm_searcher_mirror_hash_remove() local
524 context = pdev->context_info; in lm_searcher_mirror_hash_remove()
526 if(!context->array[cid].ip_type) { in lm_searcher_mirror_hash_remove()
538 h_val = context->array[cid].h_val; in lm_searcher_mirror_hash_remove()
539 hash_entry = &context->searcher_hash.searcher_table[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()
556 context->searcher_hash.num_tuples--; 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()
574 lm_context_info_t *context = NULL; in lm_allocate_cid() local
596 context = pdev->context_info; in lm_allocate_cid()
602 if (context->proto_ffree[type]==0) { in lm_allocate_cid()
603 …if ((pdev->params.cid_allocation_mode == LM_CID_ALLOC_REGULAR) || (context->proto_pending[type] ==… in lm_allocate_cid()
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()
623 cid = context->proto_pending[type]; 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()
656 context->array[cid].cid_resc.mapped_cid_bar_addr = in lm_allocate_cid()
659 context->array[cid].cid_resc.reg_handle = pdev->vars.reg_handle[BAR_1]; 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()
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()
992 struct eth_context * context = NULL; in lm_init_connection_context() local
1003 context = lm_get_context(PFDEV(pdev), VF_TO_PF_CID(pdev,sw_cid)); in lm_init_connection_context()
1005 mm_mem_zero( context, sizeof(struct eth_context) ) ; in lm_init_connection_context()
1188 void *context = NULL; in lm_set_cdu_validation_data() local
1193 context = lm_get_context(PFDEV(pdev), cid); in lm_set_cdu_validation_data()
1195 if (!context) { in lm_set_cdu_validation_data()
1203 cdu_reserved = &((struct toe_context *)context)->xstorm_ag_context.cdu_reserved; in lm_set_cdu_validation_data()
1204 cdu_usage = &(((struct toe_context *)context)->ustorm_ag_context.cdu_usage); in lm_set_cdu_validation_data()
1207 cdu_reserved = &(((struct eth_context *)context)->xstorm_ag_context.cdu_reserved); in lm_set_cdu_validation_data()
1208 cdu_usage = &(((struct eth_context *)context)->ustorm_ag_context.cdu_usage); in lm_set_cdu_validation_data()
1211 cdu_reserved = &(((struct iscsi_context *)context)->xstorm_ag_context.cdu_reserved); in lm_set_cdu_validation_data()
1212 cdu_usage = &(((struct iscsi_context *)context)->ustorm_ag_context.cdu_usage); in lm_set_cdu_validation_data()
1215 cdu_reserved = &(((struct fcoe_context *)context)->xstorm_ag_context.cdu_reserved); in lm_set_cdu_validation_data()
1216 cdu_usage = &(((struct fcoe_context *)context)->ustorm_ag_context.cdu_usage); in lm_set_cdu_validation_data()