Lines Matching refs:tbl
19 static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath);
81 struct mesh_table *tbl = tblptr; in mesh_path_rht_free() local
83 mesh_path_free_rcu(tbl, mpath); in mesh_path_rht_free()
86 static void mesh_table_init(struct mesh_table *tbl) in mesh_table_init() argument
88 INIT_HLIST_HEAD(&tbl->known_gates); in mesh_table_init()
89 INIT_HLIST_HEAD(&tbl->walk_head); in mesh_table_init()
90 atomic_set(&tbl->entries, 0); in mesh_table_init()
91 spin_lock_init(&tbl->gates_lock); in mesh_table_init()
92 spin_lock_init(&tbl->walk_lock); in mesh_table_init()
97 WARN_ON(rhashtable_init(&tbl->rhead, &mesh_rht_params)); in mesh_table_init()
100 static void mesh_table_free(struct mesh_table *tbl) in mesh_table_free() argument
102 rhashtable_free_and_destroy(&tbl->rhead, in mesh_table_free()
103 mesh_path_rht_free, tbl); in mesh_table_free()
242 static struct mesh_path *mpath_lookup(struct mesh_table *tbl, const u8 *dst, in mpath_lookup() argument
247 mpath = rhashtable_lookup(&tbl->rhead, dst, mesh_rht_params); in mpath_lookup()
279 __mesh_path_lookup_by_idx(struct mesh_table *tbl, int idx) in __mesh_path_lookup_by_idx() argument
284 hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) { in __mesh_path_lookup_by_idx()
336 struct mesh_table *tbl; in mesh_path_add_gate() local
340 tbl = &mpath->sdata->u.mesh.mesh_paths; in mesh_path_add_gate()
351 spin_lock(&tbl->gates_lock); in mesh_path_add_gate()
352 hlist_add_head_rcu(&mpath->gate_list, &tbl->known_gates); in mesh_path_add_gate()
353 spin_unlock(&tbl->gates_lock); in mesh_path_add_gate()
371 static void mesh_gate_del(struct mesh_table *tbl, struct mesh_path *mpath) in mesh_gate_del() argument
378 spin_lock_bh(&tbl->gates_lock); in mesh_gate_del()
381 spin_unlock_bh(&tbl->gates_lock); in mesh_gate_del()
669 struct mesh_table *tbl; in mesh_path_add() local
686 tbl = &sdata->u.mesh.mesh_paths; in mesh_path_add()
687 spin_lock_bh(&tbl->walk_lock); in mesh_path_add()
688 mpath = rhashtable_lookup_get_insert_fast(&tbl->rhead, in mesh_path_add()
692 hlist_add_head(&new_mpath->walk_list, &tbl->walk_head); in mesh_path_add()
693 spin_unlock_bh(&tbl->walk_lock); in mesh_path_add()
711 struct mesh_table *tbl; in mpp_path_add() local
728 tbl = &sdata->u.mesh.mpp_paths; in mpp_path_add()
730 spin_lock_bh(&tbl->walk_lock); in mpp_path_add()
731 ret = rhashtable_lookup_insert_fast(&tbl->rhead, in mpp_path_add()
735 hlist_add_head_rcu(&new_mpath->walk_list, &tbl->walk_head); in mpp_path_add()
736 spin_unlock_bh(&tbl->walk_lock); in mpp_path_add()
759 struct mesh_table *tbl = &sdata->u.mesh.mesh_paths; in mesh_plink_broken() local
764 hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) { in mesh_plink_broken()
781 static void mesh_path_free_rcu(struct mesh_table *tbl, in mesh_path_free_rcu() argument
788 mesh_gate_del(tbl, mpath); in mesh_path_free_rcu()
792 atomic_dec(&tbl->entries); in mesh_path_free_rcu()
797 static void __mesh_path_del(struct mesh_table *tbl, struct mesh_path *mpath) in __mesh_path_del() argument
800 rhashtable_remove_fast(&tbl->rhead, &mpath->rhash, mesh_rht_params); in __mesh_path_del()
801 if (tbl == &mpath->sdata->u.mesh.mpp_paths) in __mesh_path_del()
805 mesh_path_free_rcu(tbl, mpath); in __mesh_path_del()
822 struct mesh_table *tbl = &sdata->u.mesh.mesh_paths; in mesh_path_flush_by_nexthop() local
826 spin_lock_bh(&tbl->walk_lock); in mesh_path_flush_by_nexthop()
827 hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { in mesh_path_flush_by_nexthop()
829 __mesh_path_del(tbl, mpath); in mesh_path_flush_by_nexthop()
831 spin_unlock_bh(&tbl->walk_lock); in mesh_path_flush_by_nexthop()
837 struct mesh_table *tbl = &sdata->u.mesh.mpp_paths; in mpp_flush_by_proxy() local
841 spin_lock_bh(&tbl->walk_lock); in mpp_flush_by_proxy()
842 hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { in mpp_flush_by_proxy()
844 __mesh_path_del(tbl, mpath); in mpp_flush_by_proxy()
846 spin_unlock_bh(&tbl->walk_lock); in mpp_flush_by_proxy()
849 static void table_flush_by_iface(struct mesh_table *tbl) in table_flush_by_iface() argument
854 spin_lock_bh(&tbl->walk_lock); in table_flush_by_iface()
855 hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { in table_flush_by_iface()
856 __mesh_path_del(tbl, mpath); in table_flush_by_iface()
858 spin_unlock_bh(&tbl->walk_lock); in table_flush_by_iface()
884 static int table_path_del(struct mesh_table *tbl, in table_path_del() argument
890 spin_lock_bh(&tbl->walk_lock); in table_path_del()
891 mpath = rhashtable_lookup_fast(&tbl->rhead, addr, mesh_rht_params); in table_path_del()
893 spin_unlock_bh(&tbl->walk_lock); in table_path_del()
897 __mesh_path_del(tbl, mpath); in table_path_del()
898 spin_unlock_bh(&tbl->walk_lock); in table_path_del()
951 struct mesh_table *tbl; in mesh_path_send_to_gates() local
956 tbl = &sdata->u.mesh.mesh_paths; in mesh_path_send_to_gates()
959 hlist_for_each_entry_rcu(gate, &tbl->known_gates, gate_list) { in mesh_path_send_to_gates()
972 hlist_for_each_entry_rcu(gate, &tbl->known_gates, gate_list) { in mesh_path_send_to_gates()
1046 struct mesh_table *tbl) in mesh_path_tbl_expire() argument
1051 spin_lock_bh(&tbl->walk_lock); in mesh_path_tbl_expire()
1052 hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) { in mesh_path_tbl_expire()
1056 __mesh_path_del(tbl, mpath); in mesh_path_tbl_expire()
1058 spin_unlock_bh(&tbl->walk_lock); in mesh_path_tbl_expire()