Lines Matching refs:hinfo
33 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_destroy() local
35 spin_lock_bh(&hinfo->lock); in tcf_hash_destroy()
37 spin_unlock_bh(&hinfo->lock); in tcf_hash_destroy()
75 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_dump_walker() local
81 spin_lock_bh(&hinfo->lock); in tcf_dump_walker()
85 for (i = 0; i < (hinfo->hmask + 1); i++) { in tcf_dump_walker()
86 head = &hinfo->htab[tcf_hash(i, hinfo->hmask)]; in tcf_dump_walker()
111 spin_unlock_bh(&hinfo->lock); in tcf_dump_walker()
123 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_del_walker() local
136 for (i = 0; i < (hinfo->hmask + 1); i++) { in tcf_del_walker()
137 head = &hinfo->htab[tcf_hash(i, hinfo->hmask)]; in tcf_del_walker()
171 static struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo) in tcf_hash_lookup() argument
176 spin_lock_bh(&hinfo->lock); in tcf_hash_lookup()
177 head = &hinfo->htab[tcf_hash(index, hinfo->hmask)]; in tcf_hash_lookup()
181 spin_unlock_bh(&hinfo->lock); in tcf_hash_lookup()
186 u32 tcf_hash_new_index(struct tcf_hashinfo *hinfo) in tcf_hash_new_index() argument
188 u32 val = hinfo->index; in tcf_hash_new_index()
193 } while (tcf_hash_lookup(val, hinfo)); in tcf_hash_new_index()
195 hinfo->index = val; in tcf_hash_new_index()
202 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_search() local
203 struct tcf_common *p = tcf_hash_lookup(index, hinfo); in tcf_hash_search()
215 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_check() local
217 if (index && (p = tcf_hash_lookup(index, hinfo)) != NULL) { in tcf_hash_check()
241 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_create() local
252 p->tcfc_index = index ? index : tcf_hash_new_index(hinfo); in tcf_hash_create()
273 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_insert() local
274 unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask); in tcf_hash_insert()
276 spin_lock_bh(&hinfo->lock); in tcf_hash_insert()
277 hlist_add_head(&p->tcfc_head, &hinfo->htab[h]); in tcf_hash_insert()
278 spin_unlock_bh(&hinfo->lock); in tcf_hash_insert()
300 act->hinfo = kmalloc(sizeof(struct tcf_hashinfo), GFP_KERNEL); in tcf_register_action()
301 if (!act->hinfo) in tcf_register_action()
303 err = tcf_hashinfo_init(act->hinfo, mask); in tcf_register_action()
305 kfree(act->hinfo); in tcf_register_action()
313 tcf_hashinfo_destroy(act->hinfo); in tcf_register_action()
314 kfree(act->hinfo); in tcf_register_action()
333 tcf_hashinfo_destroy(act->hinfo); in tcf_unregister_action()
334 kfree(act->hinfo); in tcf_unregister_action()