• Home
  • Raw
  • Download

Lines Matching refs:p

64 static struct tcindex_filter_result *tcindex_lookup(struct tcindex_data *p,  in tcindex_lookup()  argument
67 if (p->perfect) { in tcindex_lookup()
68 struct tcindex_filter_result *f = p->perfect + key; in tcindex_lookup()
71 } else if (p->h) { in tcindex_lookup()
75 fp = &p->h[key % p->hash]; in tcindex_lookup()
90 struct tcindex_data *p = rcu_dereference_bh(tp->root); in tcindex_classify() local
92 int key = (skb->tc_index & p->mask) >> p->shift; in tcindex_classify()
95 skb, tp, res, p); in tcindex_classify()
97 f = tcindex_lookup(p, key); in tcindex_classify()
99 if (!p->fall_through) in tcindex_classify()
115 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_get() local
119 if (p->perfect && handle >= p->alloc_hash) in tcindex_get()
121 r = tcindex_lookup(p, handle); in tcindex_get()
127 struct tcindex_data *p; in tcindex_init() local
130 p = kzalloc(sizeof(struct tcindex_data), GFP_KERNEL); in tcindex_init()
131 if (!p) in tcindex_init()
134 p->mask = 0xffff; in tcindex_init()
135 p->hash = DEFAULT_HASH_SIZE; in tcindex_init()
136 p->fall_through = 1; in tcindex_init()
138 rcu_assign_pointer(tp->root, p); in tcindex_init()
195 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_delete() local
200 pr_debug("tcindex_delete(tp %p,arg %p),p %p\n", tp, arg, p); in tcindex_delete()
201 if (p->perfect) { in tcindex_delete()
207 for (i = 0; i < p->hash; i++) { in tcindex_delete()
208 walk = p->h + i; in tcindex_delete()
251 struct tcindex_data *p = container_of(head, struct tcindex_data, rcu); in __tcindex_destroy() local
253 kfree(p->perfect); in __tcindex_destroy()
254 kfree(p->h); in __tcindex_destroy()
255 kfree(p); in __tcindex_destroy()
259 valid_perfect_hash(struct tcindex_data *p) in valid_perfect_hash() argument
261 return p->hash > (p->mask >> p->shift); in valid_perfect_hash()
280 struct tcindex_data *p = container_of(head, struct tcindex_data, rcu); in __tcindex_partial_destroy() local
282 kfree(p->perfect); in __tcindex_partial_destroy()
283 kfree(p); in __tcindex_partial_destroy()
320 u32 handle, struct tcindex_data *p, in tcindex_set_parms() argument
347 cp->mask = p->mask; in tcindex_set_parms()
348 cp->shift = p->shift; in tcindex_set_parms()
349 cp->hash = p->hash; in tcindex_set_parms()
350 cp->alloc_hash = p->alloc_hash; in tcindex_set_parms()
351 cp->fall_through = p->fall_through; in tcindex_set_parms()
373 if (p->perfect) { in tcindex_set_parms()
379 for (i = 0; i < min(cp->hash, p->hash); i++) in tcindex_set_parms()
380 cp->perfect[i].res = p->perfect[i].res; in tcindex_set_parms()
383 cp->h = p->h; in tcindex_set_parms()
473 oldp = p; in tcindex_set_parms()
520 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_change() local
526 tp, handle, tca, arg, opt, p, r, arg ? *arg : NULL); in tcindex_change()
535 return tcindex_set_parms(net, tp, base, handle, p, r, tb, in tcindex_change()
541 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_walk() local
545 pr_debug("tcindex_walk(tp %p,walker %p),p %p\n", tp, walker, p); in tcindex_walk()
546 if (p->perfect) { in tcindex_walk()
547 for (i = 0; i < p->hash; i++) { in tcindex_walk()
548 if (!p->perfect[i].res.class) in tcindex_walk()
551 if (walker->fn(tp, p->perfect + i, walker) < 0) { in tcindex_walk()
559 if (!p->h) in tcindex_walk()
561 for (i = 0; i < p->hash; i++) { in tcindex_walk()
562 for (f = rtnl_dereference(p->h[i]); f; f = next) { in tcindex_walk()
577 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_destroy() local
580 pr_debug("tcindex_destroy(tp %p),p %p\n", tp, p); in tcindex_destroy()
586 call_rcu(&p->rcu, __tcindex_destroy); in tcindex_destroy()
593 struct tcindex_data *p = rtnl_dereference(tp->root); in tcindex_dump() local
598 tp, fh, skb, t, p, r); in tcindex_dump()
599 pr_debug("p->perfect %p p->h %p\n", p->perfect, p->h); in tcindex_dump()
607 if (nla_put_u32(skb, TCA_TCINDEX_HASH, p->hash) || in tcindex_dump()
608 nla_put_u16(skb, TCA_TCINDEX_MASK, p->mask) || in tcindex_dump()
609 nla_put_u32(skb, TCA_TCINDEX_SHIFT, p->shift) || in tcindex_dump()
610 nla_put_u32(skb, TCA_TCINDEX_FALL_THROUGH, p->fall_through)) in tcindex_dump()
614 if (p->perfect) { in tcindex_dump()
615 t->tcm_handle = r - p->perfect; in tcindex_dump()
622 for (i = 0; !t->tcm_handle && i < p->hash; i++) { in tcindex_dump()
623 fp = &p->h[i]; in tcindex_dump()