Lines Matching refs:ct_ft
294 static void tcf_ct_flow_table_get_ref(struct tcf_ct_flow_table *ct_ft);
298 struct tcf_ct_flow_table *ct_ft = in tcf_ct_nf_get() local
301 tcf_ct_flow_table_get_ref(ct_ft); in tcf_ct_nf_get()
304 static void tcf_ct_flow_table_put(struct tcf_ct_flow_table *ct_ft);
308 struct tcf_ct_flow_table *ct_ft = in tcf_ct_nf_put() local
311 tcf_ct_flow_table_put(ct_ft); in tcf_ct_nf_put()
325 struct tcf_ct_flow_table *ct_ft; in tcf_ct_flow_table_get() local
329 ct_ft = rhashtable_lookup_fast(&zones_ht, &key, zones_params); in tcf_ct_flow_table_get()
330 if (ct_ft && refcount_inc_not_zero(&ct_ft->ref)) in tcf_ct_flow_table_get()
333 ct_ft = kzalloc(sizeof(*ct_ft), GFP_KERNEL); in tcf_ct_flow_table_get()
334 if (!ct_ft) in tcf_ct_flow_table_get()
336 refcount_set(&ct_ft->ref, 1); in tcf_ct_flow_table_get()
338 ct_ft->key = key; in tcf_ct_flow_table_get()
339 err = rhashtable_insert_fast(&zones_ht, &ct_ft->node, zones_params); in tcf_ct_flow_table_get()
343 ct_ft->nf_ft.type = &flowtable_ct; in tcf_ct_flow_table_get()
344 ct_ft->nf_ft.flags |= NF_FLOWTABLE_HW_OFFLOAD | in tcf_ct_flow_table_get()
346 err = nf_flow_table_init(&ct_ft->nf_ft); in tcf_ct_flow_table_get()
349 write_pnet(&ct_ft->nf_ft.net, net); in tcf_ct_flow_table_get()
353 params->ct_ft = ct_ft; in tcf_ct_flow_table_get()
354 params->nf_ft = &ct_ft->nf_ft; in tcf_ct_flow_table_get()
360 rhashtable_remove_fast(&zones_ht, &ct_ft->node, zones_params); in tcf_ct_flow_table_get()
362 kfree(ct_ft); in tcf_ct_flow_table_get()
368 static void tcf_ct_flow_table_get_ref(struct tcf_ct_flow_table *ct_ft) in tcf_ct_flow_table_get_ref() argument
370 refcount_inc(&ct_ft->ref); in tcf_ct_flow_table_get_ref()
375 struct tcf_ct_flow_table *ct_ft; in tcf_ct_flow_table_cleanup_work() local
378 ct_ft = container_of(to_rcu_work(work), struct tcf_ct_flow_table, in tcf_ct_flow_table_cleanup_work()
380 nf_flow_table_free(&ct_ft->nf_ft); in tcf_ct_flow_table_cleanup_work()
382 block = &ct_ft->nf_ft.flow_block; in tcf_ct_flow_table_cleanup_work()
383 down_write(&ct_ft->nf_ft.flow_block_lock); in tcf_ct_flow_table_cleanup_work()
385 up_write(&ct_ft->nf_ft.flow_block_lock); in tcf_ct_flow_table_cleanup_work()
386 kfree(ct_ft); in tcf_ct_flow_table_cleanup_work()
391 static void tcf_ct_flow_table_put(struct tcf_ct_flow_table *ct_ft) in tcf_ct_flow_table_put() argument
393 if (refcount_dec_and_test(&ct_ft->ref)) { in tcf_ct_flow_table_put()
394 rhashtable_remove_fast(&zones_ht, &ct_ft->node, zones_params); in tcf_ct_flow_table_put()
395 INIT_RCU_WORK(&ct_ft->rwork, tcf_ct_flow_table_cleanup_work); in tcf_ct_flow_table_put()
396 queue_rcu_work(act_ct_wq, &ct_ft->rwork); in tcf_ct_flow_table_put()
418 static void tcf_ct_flow_table_add(struct tcf_ct_flow_table *ct_ft, in tcf_ct_flow_table_add() argument
448 err = flow_offload_add(&ct_ft->nf_ft, entry); in tcf_ct_flow_table_add()
460 static void tcf_ct_flow_table_process_conn(struct tcf_ct_flow_table *ct_ft, in tcf_ct_flow_table_process_conn() argument
507 tcf_ct_flow_table_add(ct_ft, ct, tcp, bidirectional); in tcf_ct_flow_table_process_conn()
656 struct nf_flowtable *nf_ft = &p->ct_ft->nf_ft; in tcf_ct_flow_table_lookup()
878 if (params->ct_ft) in tcf_ct_params_free()
879 tcf_ct_flow_table_put(params->ct_ft); in tcf_ct_params_free()
1095 tcf_ct_flow_table_process_conn(p->ct_ft, ct, ctinfo); in tcf_ct_act()