Lines Matching refs:p
59 tcindex_lookup(struct tcindex_data *p, u16 key) in tcindex_lookup() argument
61 if (p->perfect) { in tcindex_lookup()
62 struct tcindex_filter_result *f = p->perfect + key; in tcindex_lookup()
65 } else if (p->h) { in tcindex_lookup()
69 fp = &p->h[key % p->hash]; in tcindex_lookup()
84 struct tcindex_data *p = rcu_dereference_bh(tp->root); in tcindex_classify() local
86 int key = (skb->tc_index & p->mask) >> p->shift; in tcindex_classify()
89 skb, tp, res, p); in tcindex_classify()
91 f = tcindex_lookup(p, key); in tcindex_classify()
93 if (!p->fall_through) in tcindex_classify()
109 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_get() local
113 if (p->perfect && handle >= p->alloc_hash) in tcindex_get()
115 r = tcindex_lookup(p, handle); in tcindex_get()
121 struct tcindex_data *p; in tcindex_init() local
124 p = kzalloc(sizeof(struct tcindex_data), GFP_KERNEL); in tcindex_init()
125 if (!p) in tcindex_init()
128 p->mask = 0xffff; in tcindex_init()
129 p->hash = DEFAULT_HASH_SIZE; in tcindex_init()
130 p->fall_through = 1; in tcindex_init()
132 rcu_assign_pointer(tp->root, p); in tcindex_init()
139 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_delete() local
144 pr_debug("tcindex_delete(tp %p,arg 0x%lx),p %p\n", tp, arg, p); in tcindex_delete()
145 if (p->perfect) { in tcindex_delete()
151 for (i = 0; i < p->hash; i++) { in tcindex_delete()
152 walk = p->h + i; in tcindex_delete()
180 struct tcindex_data *p = container_of(head, struct tcindex_data, rcu); in __tcindex_destroy() local
182 kfree(p->perfect); in __tcindex_destroy()
183 kfree(p->h); in __tcindex_destroy()
184 kfree(p); in __tcindex_destroy()
188 valid_perfect_hash(struct tcindex_data *p) in valid_perfect_hash() argument
190 return p->hash > (p->mask >> p->shift); in valid_perfect_hash()
209 struct tcindex_data *p = container_of(head, struct tcindex_data, rcu); in __tcindex_partial_destroy() local
211 kfree(p->perfect); in __tcindex_partial_destroy()
212 kfree(p); in __tcindex_partial_destroy()
217 u32 handle, struct tcindex_data *p, in tcindex_set_parms() argument
242 cp->mask = p->mask; in tcindex_set_parms()
243 cp->shift = p->shift; in tcindex_set_parms()
244 cp->hash = p->hash; in tcindex_set_parms()
245 cp->alloc_hash = p->alloc_hash; in tcindex_set_parms()
246 cp->fall_through = p->fall_through; in tcindex_set_parms()
249 if (p->perfect) { in tcindex_set_parms()
252 cp->perfect = kmemdup(p->perfect, in tcindex_set_parms()
261 cp->h = p->h; in tcindex_set_parms()
372 oldp = p; in tcindex_set_parms()
413 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_change() local
419 tp, handle, tca, arg, opt, p, r, arg ? *arg : 0L); in tcindex_change()
428 return tcindex_set_parms(net, tp, base, handle, p, r, tb, in tcindex_change()
434 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_walk() local
438 pr_debug("tcindex_walk(tp %p,walker %p),p %p\n", tp, walker, p); in tcindex_walk()
439 if (p->perfect) { in tcindex_walk()
440 for (i = 0; i < p->hash; i++) { in tcindex_walk()
441 if (!p->perfect[i].res.class) in tcindex_walk()
445 (unsigned long) (p->perfect+i), walker) in tcindex_walk()
454 if (!p->h) in tcindex_walk()
456 for (i = 0; i < p->hash; i++) { in tcindex_walk()
457 for (f = rtnl_dereference(p->h[i]); f; f = next) { in tcindex_walk()
473 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_destroy() local
479 pr_debug("tcindex_destroy(tp %p),p %p\n", tp, p); in tcindex_destroy()
486 call_rcu(&p->rcu, __tcindex_destroy); in tcindex_destroy()
494 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_dump() local
499 tp, fh, skb, t, p, r); in tcindex_dump()
500 pr_debug("p->perfect %p p->h %p\n", p->perfect, p->h); in tcindex_dump()
508 if (nla_put_u32(skb, TCA_TCINDEX_HASH, p->hash) || in tcindex_dump()
509 nla_put_u16(skb, TCA_TCINDEX_MASK, p->mask) || in tcindex_dump()
510 nla_put_u32(skb, TCA_TCINDEX_SHIFT, p->shift) || in tcindex_dump()
511 nla_put_u32(skb, TCA_TCINDEX_FALL_THROUGH, p->fall_through)) in tcindex_dump()
515 if (p->perfect) { in tcindex_dump()
516 t->tcm_handle = r - p->perfect; in tcindex_dump()
523 for (i = 0; !t->tcm_handle && i < p->hash; i++) { in tcindex_dump()
524 fp = &p->h[i]; in tcindex_dump()