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