Lines Matching refs:tun
739 app_priv = container_of(nb, struct nfp_flower_priv, tun.neigh_nb); in nfp_tun_neigh_event_handler()
852 mutex_lock(&priv->tun.ipv4_off_lock); in nfp_tun_write_ipv4_list()
854 list_for_each_safe(ptr, storage, &priv->tun.ipv4_off_list) { in nfp_tun_write_ipv4_list()
856 mutex_unlock(&priv->tun.ipv4_off_lock); in nfp_tun_write_ipv4_list()
864 mutex_unlock(&priv->tun.ipv4_off_lock); in nfp_tun_write_ipv4_list()
877 mutex_lock(&priv->tun.ipv4_off_lock); in nfp_tunnel_add_ipv4_off()
878 list_for_each_safe(ptr, storage, &priv->tun.ipv4_off_list) { in nfp_tunnel_add_ipv4_off()
882 mutex_unlock(&priv->tun.ipv4_off_lock); in nfp_tunnel_add_ipv4_off()
889 mutex_unlock(&priv->tun.ipv4_off_lock); in nfp_tunnel_add_ipv4_off()
895 list_add_tail(&entry->list, &priv->tun.ipv4_off_list); in nfp_tunnel_add_ipv4_off()
896 mutex_unlock(&priv->tun.ipv4_off_lock); in nfp_tunnel_add_ipv4_off()
907 mutex_lock(&priv->tun.ipv4_off_lock); in nfp_tunnel_del_ipv4_off()
908 list_for_each_safe(ptr, storage, &priv->tun.ipv4_off_list) { in nfp_tunnel_del_ipv4_off()
919 mutex_unlock(&priv->tun.ipv4_off_lock); in nfp_tunnel_del_ipv4_off()
932 mutex_lock(&priv->tun.ipv6_off_lock); in nfp_tun_write_ipv6_list()
933 list_for_each_entry(entry, &priv->tun.ipv6_off_list, list) { in nfp_tun_write_ipv6_list()
940 mutex_unlock(&priv->tun.ipv6_off_lock); in nfp_tun_write_ipv6_list()
954 mutex_lock(&priv->tun.ipv6_off_lock); in nfp_tunnel_add_ipv6_off()
955 list_for_each_entry(entry, &priv->tun.ipv6_off_list, list) in nfp_tunnel_add_ipv6_off()
958 mutex_unlock(&priv->tun.ipv6_off_lock); in nfp_tunnel_add_ipv6_off()
964 mutex_unlock(&priv->tun.ipv6_off_lock); in nfp_tunnel_add_ipv6_off()
970 list_add_tail(&entry->list, &priv->tun.ipv6_off_list); in nfp_tunnel_add_ipv6_off()
971 mutex_unlock(&priv->tun.ipv6_off_lock); in nfp_tunnel_add_ipv6_off()
984 mutex_lock(&priv->tun.ipv6_off_lock); in nfp_tunnel_put_ipv6_off()
990 mutex_unlock(&priv->tun.ipv6_off_lock); in nfp_tunnel_put_ipv6_off()
1050 return rhashtable_lookup_fast(&priv->tun.offloaded_macs, mac, in nfp_tunnel_lookup_offloaded_macs()
1102 ida_idx = ida_alloc_max(&priv->tun.mac_off_ids, in nfp_tunnel_add_shared_mac()
1129 if (rhashtable_insert_fast(&priv->tun.offloaded_macs, in nfp_tunnel_add_shared_mac()
1152 rhashtable_remove_fast(&priv->tun.offloaded_macs, &entry->ht_node, in nfp_tunnel_add_shared_mac()
1158 ida_free(&priv->tun.mac_off_ids, ida_idx); in nfp_tunnel_add_shared_mac()
1221 ida_free(&priv->tun.mac_off_ids, ida_idx); in nfp_tunnel_del_shared_mac()
1229 WARN_ON_ONCE(rhashtable_remove_fast(&priv->tun.offloaded_macs, in nfp_tunnel_del_shared_mac()
1241 ida_free(&priv->tun.mac_off_ids, ida_idx); in nfp_tunnel_del_shared_mac()
1514 err = rhashtable_init(&priv->tun.offloaded_macs, in nfp_tunnel_config_start()
1519 ida_init(&priv->tun.mac_off_ids); in nfp_tunnel_config_start()
1522 mutex_init(&priv->tun.ipv4_off_lock); in nfp_tunnel_config_start()
1523 INIT_LIST_HEAD(&priv->tun.ipv4_off_list); in nfp_tunnel_config_start()
1524 mutex_init(&priv->tun.ipv6_off_lock); in nfp_tunnel_config_start()
1525 INIT_LIST_HEAD(&priv->tun.ipv6_off_list); in nfp_tunnel_config_start()
1528 priv->tun.neigh_nb.notifier_call = nfp_tun_neigh_event_handler; in nfp_tunnel_config_start()
1530 err = register_netevent_notifier(&priv->tun.neigh_nb); in nfp_tunnel_config_start()
1532 rhashtable_free_and_destroy(&priv->tun.offloaded_macs, in nfp_tunnel_config_start()
1546 unregister_netevent_notifier(&priv->tun.neigh_nb); in nfp_tunnel_config_stop()
1548 ida_destroy(&priv->tun.mac_off_ids); in nfp_tunnel_config_stop()
1551 list_for_each_safe(ptr, storage, &priv->tun.ipv4_off_list) { in nfp_tunnel_config_stop()
1557 mutex_destroy(&priv->tun.ipv6_off_lock); in nfp_tunnel_config_stop()
1560 rhashtable_free_and_destroy(&priv->tun.offloaded_macs, in nfp_tunnel_config_stop()