Lines Matching refs:n_cache
58 struct prestera_kern_neigh_cache *n_cache; member
455 struct prestera_kern_neigh_cache *n_cache; in prestera_kern_neigh_cache_find() local
457 n_cache = in prestera_kern_neigh_cache_find()
460 return n_cache; in prestera_kern_neigh_cache_find()
465 struct prestera_kern_neigh_cache *n_cache) in __prestera_kern_neigh_cache_destruct() argument
467 dev_put(n_cache->key.dev); in __prestera_kern_neigh_cache_destruct()
472 struct prestera_kern_neigh_cache *n_cache) in __prestera_kern_neigh_cache_destroy() argument
475 &n_cache->ht_node, in __prestera_kern_neigh_cache_destroy()
477 __prestera_kern_neigh_cache_destruct(sw, n_cache); in __prestera_kern_neigh_cache_destroy()
478 kfree(n_cache); in __prestera_kern_neigh_cache_destroy()
485 struct prestera_kern_neigh_cache *n_cache; in __prestera_kern_neigh_cache_create() local
488 n_cache = kzalloc(sizeof(*n_cache), GFP_KERNEL); in __prestera_kern_neigh_cache_create()
489 if (!n_cache) in __prestera_kern_neigh_cache_create()
492 memcpy(&n_cache->key, key, sizeof(*key)); in __prestera_kern_neigh_cache_create()
493 dev_hold(n_cache->key.dev); in __prestera_kern_neigh_cache_create()
495 INIT_LIST_HEAD(&n_cache->kern_fib_cache_list); in __prestera_kern_neigh_cache_create()
497 &n_cache->ht_node, in __prestera_kern_neigh_cache_create()
502 return n_cache; in __prestera_kern_neigh_cache_create()
505 dev_put(n_cache->key.dev); in __prestera_kern_neigh_cache_create()
506 kfree(n_cache); in __prestera_kern_neigh_cache_create()
515 struct prestera_kern_neigh_cache *n_cache; in prestera_kern_neigh_cache_get() local
517 n_cache = prestera_kern_neigh_cache_find(sw, key); in prestera_kern_neigh_cache_get()
518 if (!n_cache) in prestera_kern_neigh_cache_get()
519 n_cache = __prestera_kern_neigh_cache_create(sw, key); in prestera_kern_neigh_cache_get()
521 return n_cache; in prestera_kern_neigh_cache_get()
526 struct prestera_kern_neigh_cache *n_cache) in prestera_kern_neigh_cache_put() argument
528 if (!n_cache->in_kernel && in prestera_kern_neigh_cache_put()
529 list_empty(&n_cache->kern_fib_cache_list)) { in prestera_kern_neigh_cache_put()
530 __prestera_kern_neigh_cache_destroy(sw, n_cache); in prestera_kern_neigh_cache_put()
534 return n_cache; in prestera_kern_neigh_cache_put()
553 struct prestera_kern_neigh_cache *n_cache; in __prestera_kern_fib_cache_destruct() local
557 n_cache = fib_cache->kern_neigh_cache_head[i].n_cache; in __prestera_kern_fib_cache_destruct()
558 if (n_cache) { in __prestera_kern_fib_cache_destruct()
560 prestera_kern_neigh_cache_put(sw, n_cache); in __prestera_kern_fib_cache_destruct()
583 struct prestera_kern_neigh_cache *n_cache; in __prestera_kern_fib_cache_create_nhs() local
600 n_cache = prestera_kern_neigh_cache_get(sw, &nc_key); in __prestera_kern_fib_cache_create_nhs()
601 if (!n_cache) in __prestera_kern_fib_cache_create_nhs()
605 fc->kern_neigh_cache_head[i].n_cache = n_cache; in __prestera_kern_fib_cache_create_nhs()
607 &n_cache->kern_fib_cache_list); in __prestera_kern_fib_cache_create_nhs()
725 struct prestera_kern_neigh_cache *n_cache, in __prestera_k_arb_n_lpm_set() argument
736 fc_key.addr = n_cache->key.addr; in __prestera_k_arb_n_lpm_set()
737 fc_key.prefix_len = PRESTERA_IP_ADDR_PLEN(n_cache->key.addr.v); in __prestera_k_arb_n_lpm_set()
744 fc_key.kern_tb_id = l3mdev_fib_table(n_cache->key.dev); in __prestera_k_arb_n_lpm_set()
747 fib_key.addr = n_cache->key.addr; in __prestera_k_arb_n_lpm_set()
748 fib_key.prefix_len = PRESTERA_IP_ADDR_PLEN(n_cache->key.addr.v); in __prestera_k_arb_n_lpm_set()
761 prestera_util_nc_key2nh_key(&n_cache->key, in __prestera_k_arb_n_lpm_set()
892 if (!fc->kern_neigh_cache_head[nh_cnt].n_cache) in __prestera_pr_k_arb_fc_lpm_info_calc()
896 fc->kern_neigh_cache_head[nh_cnt].n_cache->key.addr; in __prestera_pr_k_arb_fc_lpm_info_calc()
898 fc->kern_neigh_cache_head[nh_cnt].n_cache->key.dev; in __prestera_pr_k_arb_fc_lpm_info_calc()
1078 struct prestera_kern_neigh_cache *n_cache; in prestera_k_arb_hw_evt() local
1084 n_cache = rhashtable_walk_next(&iter); in prestera_k_arb_hw_evt()
1086 if (!n_cache) in prestera_k_arb_hw_evt()
1089 if (IS_ERR(n_cache)) in prestera_k_arb_hw_evt()
1093 __prestera_k_arb_hw_state_upd(sw, n_cache); in prestera_k_arb_hw_evt()
1105 struct prestera_kern_neigh_cache *n_cache; in prestera_k_arb_n_evt() local
1112 n_cache = prestera_kern_neigh_cache_find(sw, &n_key); in prestera_k_arb_n_evt()
1113 if (!n_cache) { in prestera_k_arb_n_evt()
1114 n_cache = prestera_kern_neigh_cache_get(sw, &n_key); in prestera_k_arb_n_evt()
1115 if (!n_cache) in prestera_k_arb_n_evt()
1117 __prestera_k_arb_nc_kern_fib_fetch(sw, n_cache); in prestera_k_arb_n_evt()
1120 __prestera_k_arb_nc_kern_n_fetch(sw, n_cache); in prestera_k_arb_n_evt()
1121 __prestera_k_arb_nc_apply(sw, n_cache); in prestera_k_arb_n_evt()
1123 prestera_kern_neigh_cache_put(sw, n_cache); in prestera_k_arb_n_evt()
1128 struct prestera_kern_neigh_cache *n_cache; in __prestera_k_arb_fib_evt2nc() local
1134 n_cache = rhashtable_walk_next(&iter); in __prestera_k_arb_fib_evt2nc()
1136 if (!n_cache) in __prestera_k_arb_fib_evt2nc()
1139 if (IS_ERR(n_cache)) in __prestera_k_arb_fib_evt2nc()
1143 __prestera_k_arb_nc_kern_fib_fetch(sw, n_cache); in __prestera_k_arb_fib_evt2nc()
1144 __prestera_k_arb_nc_apply(sw, n_cache); in __prestera_k_arb_fib_evt2nc()
1216 struct prestera_kern_neigh_cache *n_cache = ptr; in __prestera_k_arb_abort_neigh_ht_cb() local
1219 if (!list_empty(&n_cache->kern_fib_cache_list)) { in __prestera_k_arb_abort_neigh_ht_cb()
1223 __prestera_k_arb_n_offload_set(sw, n_cache, false); in __prestera_k_arb_abort_neigh_ht_cb()
1224 n_cache->in_kernel = false; in __prestera_k_arb_abort_neigh_ht_cb()
1228 __prestera_kern_neigh_cache_destruct(sw, n_cache); in __prestera_k_arb_abort_neigh_ht_cb()
1229 kfree(n_cache); in __prestera_k_arb_abort_neigh_ht_cb()