Lines Matching refs:nve

205 	struct mlxsw_sp_nve *nve = mlxsw_sp->nve;  in mlxsw_sp_nve_mc_list_find()  local
207 return rhashtable_lookup_fast(&nve->mc_list_ht, key, in mlxsw_sp_nve_mc_list_find()
215 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_mc_list_create() local
226 err = rhashtable_insert_fast(&nve->mc_list_ht, &mc_list->ht_node, in mlxsw_sp_nve_mc_list_create()
241 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_mc_list_destroy() local
243 rhashtable_remove_fast(&nve->mc_list_ht, &mc_list->ht_node, in mlxsw_sp_nve_mc_list_destroy()
276 unsigned int num_max_entries = mlxsw_sp->nve->num_max_mc_entries[proto]; in mlxsw_sp_nve_mc_record_create()
324 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_mc_record_get() local
327 num_entries < nve->num_max_mc_entries[proto]) in mlxsw_sp_nve_mc_record_get()
346 struct mlxsw_sp_nve *nve = mc_record->mlxsw_sp->nve; in mlxsw_sp_nve_mc_free_entry_find() local
350 num_max_entries = nve->num_max_mc_entries[mc_record->proto]; in mlxsw_sp_nve_mc_free_entry_find()
385 num_max_entries = mlxsw_sp->nve->num_max_mc_entries[mc_record->proto]; in mlxsw_sp_nve_mc_record_refresh()
417 struct mlxsw_sp_nve *nve = mc_record->mlxsw_sp->nve; in mlxsw_sp_nve_mc_entry_find() local
421 num_max_entries = nve->num_max_mc_entries[mc_record->proto]; in mlxsw_sp_nve_mc_entry_find()
685 struct mlxsw_sp_nve *nve = mc_record->mlxsw_sp->nve; in mlxsw_sp_nve_mc_record_delete() local
689 num_max_entries = nve->num_max_mc_entries[mc_record->proto]; in mlxsw_sp_nve_mc_record_delete()
729 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_tunnel_init() local
733 if (nve->num_nve_tunnels++ != 0) in mlxsw_sp_nve_tunnel_init()
736 nve->config = *config; in mlxsw_sp_nve_tunnel_init()
739 &nve->tunnel_index); in mlxsw_sp_nve_tunnel_init()
743 ops = nve->nve_ops_arr[config->type]; in mlxsw_sp_nve_tunnel_init()
744 err = ops->init(nve, config); in mlxsw_sp_nve_tunnel_init()
752 nve->tunnel_index); in mlxsw_sp_nve_tunnel_init()
754 memset(&nve->config, 0, sizeof(nve->config)); in mlxsw_sp_nve_tunnel_init()
755 nve->num_nve_tunnels--; in mlxsw_sp_nve_tunnel_init()
761 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_tunnel_fini() local
764 ops = nve->nve_ops_arr[nve->config.type]; in mlxsw_sp_nve_tunnel_fini()
766 if (mlxsw_sp->nve->num_nve_tunnels == 1) { in mlxsw_sp_nve_tunnel_fini()
767 ops->fini(nve); in mlxsw_sp_nve_tunnel_fini()
769 nve->tunnel_index); in mlxsw_sp_nve_tunnel_fini()
770 memset(&nve->config, 0, sizeof(nve->config)); in mlxsw_sp_nve_tunnel_fini()
772 nve->num_nve_tunnels--; in mlxsw_sp_nve_tunnel_fini()
796 ops = mlxsw_sp->nve->nve_ops_arr[type]; in mlxsw_sp_nve_fdb_clear_offload()
839 return rhashtable_lookup_fast(&mlxsw_sp->nve->ipv6_ht, &key, in mlxsw_sp_nve_ipv6_ht_node_lookup()
848 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_ipv6_ht_insert() local
859 err = rhashtable_insert_fast(&nve->ipv6_ht, &ipv6_ht_node->ht_node, in mlxsw_sp_nve_ipv6_ht_insert()
864 list_add(&ipv6_ht_node->list, &nve->ipv6_addr_list); in mlxsw_sp_nve_ipv6_ht_insert()
877 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_ipv6_ht_remove() local
880 rhashtable_remove_fast(&nve->ipv6_ht, &ipv6_ht_node->ht_node, in mlxsw_sp_nve_ipv6_ht_remove()
924 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_ipv6_addr_flush_by_fid() local
926 list_for_each_entry_safe(ipv6_ht_node, tmp, &nve->ipv6_addr_list, in mlxsw_sp_nve_ipv6_addr_flush_by_fid()
940 struct mlxsw_sp_nve *nve = mlxsw_sp->nve; in mlxsw_sp_nve_fid_enable() local
945 ops = nve->nve_ops_arr[params->type]; in mlxsw_sp_nve_fid_enable()
947 if (!ops->can_offload(nve, params, extack)) in mlxsw_sp_nve_fid_enable()
951 ops->nve_config(nve, params, &config); in mlxsw_sp_nve_fid_enable()
952 if (nve->num_nve_tunnels && in mlxsw_sp_nve_fid_enable()
953 memcmp(&config, &nve->config, sizeof(config))) { in mlxsw_sp_nve_fid_enable()
1110 mlxsw_sp->nve->num_max_mc_entries[MLXSW_SP_L3_PROTO_IPV4] = max; in mlxsw_sp_nve_resources_query()
1112 mlxsw_sp->nve->num_max_mc_entries[MLXSW_SP_L3_PROTO_IPV6] = max; in mlxsw_sp_nve_resources_query()
1119 struct mlxsw_sp_nve *nve; in mlxsw_sp_nve_init() local
1122 nve = kzalloc(sizeof(*mlxsw_sp->nve), GFP_KERNEL); in mlxsw_sp_nve_init()
1123 if (!nve) in mlxsw_sp_nve_init()
1125 mlxsw_sp->nve = nve; in mlxsw_sp_nve_init()
1126 nve->mlxsw_sp = mlxsw_sp; in mlxsw_sp_nve_init()
1127 nve->nve_ops_arr = mlxsw_sp->nve_ops_arr; in mlxsw_sp_nve_init()
1129 err = rhashtable_init(&nve->mc_list_ht, in mlxsw_sp_nve_init()
1134 err = rhashtable_init(&nve->ipv6_ht, &mlxsw_sp_nve_ipv6_ht_params); in mlxsw_sp_nve_init()
1138 INIT_LIST_HEAD(&nve->ipv6_addr_list); in mlxsw_sp_nve_init()
1157 rhashtable_destroy(&nve->ipv6_ht); in mlxsw_sp_nve_init()
1159 rhashtable_destroy(&nve->mc_list_ht); in mlxsw_sp_nve_init()
1161 mlxsw_sp->nve = NULL; in mlxsw_sp_nve_init()
1162 kfree(nve); in mlxsw_sp_nve_init()
1168 WARN_ON(mlxsw_sp->nve->num_nve_tunnels); in mlxsw_sp_nve_fini()
1169 WARN_ON(!list_empty(&mlxsw_sp->nve->ipv6_addr_list)); in mlxsw_sp_nve_fini()
1170 rhashtable_destroy(&mlxsw_sp->nve->ipv6_ht); in mlxsw_sp_nve_fini()
1171 rhashtable_destroy(&mlxsw_sp->nve->mc_list_ht); in mlxsw_sp_nve_fini()
1172 kfree(mlxsw_sp->nve); in mlxsw_sp_nve_fini()
1173 mlxsw_sp->nve = NULL; in mlxsw_sp_nve_fini()