Lines Matching refs:fcp
99 static void flow_cache_queue_garbage(struct flow_cache_percpu *fcp, in flow_cache_queue_garbage() argument
104 fcp->hash_count -= deleted; in flow_cache_queue_garbage()
113 struct flow_cache_percpu *fcp, in __flow_cache_shrink() argument
127 &fcp->hash_table[i], u.hlist) { in __flow_cache_shrink()
139 flow_cache_queue_garbage(fcp, deleted, &gc_list, xfrm); in __flow_cache_shrink()
143 struct flow_cache_percpu *fcp) in flow_cache_shrink() argument
147 __flow_cache_shrink(fc, fcp, shrink_to); in flow_cache_shrink()
151 struct flow_cache_percpu *fcp) in flow_new_hash_rnd() argument
153 get_random_bytes(&fcp->hash_rnd, sizeof(u32)); in flow_new_hash_rnd()
154 fcp->hash_rnd_recalc = 0; in flow_new_hash_rnd()
155 __flow_cache_shrink(fc, fcp, 0); in flow_new_hash_rnd()
159 struct flow_cache_percpu *fcp, in flow_hash_code() argument
166 return jhash2(k, length, fcp->hash_rnd) in flow_hash_code()
196 struct flow_cache_percpu *fcp; in flow_cache_lookup() local
203 fcp = this_cpu_ptr(fc->percpu); in flow_cache_lookup()
214 if (!fcp->hash_table) in flow_cache_lookup()
217 if (fcp->hash_rnd_recalc) in flow_cache_lookup()
218 flow_new_hash_rnd(fc, fcp); in flow_cache_lookup()
220 hash = flow_hash_code(fc, fcp, key, keysize); in flow_cache_lookup()
221 hlist_for_each_entry(tfle, &fcp->hash_table[hash], u.hlist) { in flow_cache_lookup()
232 if (fcp->hash_count > fc->high_watermark) in flow_cache_lookup()
233 flow_cache_shrink(fc, fcp); in flow_cache_lookup()
242 hlist_add_head(&fle->u.hlist, &fcp->hash_table[hash]); in flow_cache_lookup()
243 fcp->hash_count++; in flow_cache_lookup()
285 struct flow_cache_percpu *fcp; in flow_cache_flush_tasklet() local
293 fcp = this_cpu_ptr(fc->percpu); in flow_cache_flush_tasklet()
296 &fcp->hash_table[i], u.hlist) { in flow_cache_flush_tasklet()
306 flow_cache_queue_garbage(fcp, deleted, &gc_list, xfrm); in flow_cache_flush_tasklet()
320 struct flow_cache_percpu *fcp; in flow_cache_percpu_empty() local
323 fcp = per_cpu_ptr(fc->percpu, cpu); in flow_cache_percpu_empty()
325 if (!hlist_empty(&fcp->hash_table[i])) in flow_cache_percpu_empty()
395 struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu); in flow_cache_cpu_prepare() local
398 if (!fcp->hash_table) { in flow_cache_cpu_prepare()
399 fcp->hash_table = kzalloc_node(sz, GFP_KERNEL, cpu_to_node(cpu)); in flow_cache_cpu_prepare()
400 if (!fcp->hash_table) { in flow_cache_cpu_prepare()
404 fcp->hash_rnd_recalc = 1; in flow_cache_cpu_prepare()
405 fcp->hash_count = 0; in flow_cache_cpu_prepare()
406 tasklet_init(&fcp->flush_tasklet, flow_cache_flush_tasklet, 0); in flow_cache_cpu_prepare()
418 struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu); in flow_cache_cpu() local
429 __flow_cache_shrink(fc, fcp, 0); in flow_cache_cpu()
480 struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, i); in flow_cache_init() local
481 kfree(fcp->hash_table); in flow_cache_init()
482 fcp->hash_table = NULL; in flow_cache_init()
503 struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, i); in flow_cache_fini() local
504 kfree(fcp->hash_table); in flow_cache_fini()
505 fcp->hash_table = NULL; in flow_cache_fini()