Lines Matching defs:key
3 * net/sched/cls_u32.c Ugly (or Universal) 32bit key Packet Classifier.
7 * The filters are packed to hash tables of key nodes
8 * with a set of 32bit key/mask pairs at every node.
94 static inline unsigned int u32_hash_fold(__be32 key,
98 unsigned int h = ntohl(key & sel->hmask) >> fshift;
127 struct tc_u32_key *key = n->sel.keys;
148 for (i = n->sel.nkeys; i > 0; i--, key++) {
149 int toff = off + key->off + (off2 & key->offmask);
158 if ((*data ^ key->val) & key->mask) {
335 static struct hlist_head *tc_u_hash(void *key)
337 return tc_u_common_hash + hash_ptr(key, U32_HASH_SHIFT);
340 static struct tc_u_common *tc_u_common_find(void *key)
343 hlist_for_each_entry(tc, tc_u_hash(key), hnode) {
344 if (tc->ptr == key)
353 void *key = tc_u_common_ptr(tp);
354 struct tc_u_common *tp_c = tc_u_common_find(key);
372 tp_c->ptr = key;
376 hlist_add_head(&tp_c->hnode, tc_u_hash(key));
423 struct tc_u_knode *key = container_of(to_rcu_work(work),
427 u32_destroy_key(key, false);
433 * percpu variables. Only use this if the key is not a copy
440 struct tc_u_knode *key = container_of(to_rcu_work(work),
444 u32_destroy_key(key, true);
448 static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode *key)
453 struct tc_u_hnode *ht = rtnl_dereference(key->ht_up);
456 kp = &ht->ht[TC_U32_HASH(key->handle)];
459 if (pkp == key) {
460 RCU_INIT_POINTER(*kp, key->next);
463 tcf_unbind_filter(tp, &key->res);
464 idr_remove(&ht->handle_idr, key->handle);
465 tcf_exts_get_net(&key->exts);
466 tcf_queue_work(&key->rwork, u32_delete_key_freepf_work);