Lines Matching refs:ct_zone

279 static int efx_tc_ct_replace(struct efx_tc_ct_zone *ct_zone,  in efx_tc_ct_replace()  argument
284 struct efx_nic *efx = ct_zone->efx; in efx_tc_ct_replace()
312 conn->zone = ct_zone; in efx_tc_ct_replace()
354 mutex_lock(&ct_zone->mutex); in efx_tc_ct_replace()
355 list_add_tail(&conn->list, &ct_zone->cts); in efx_tc_ct_replace()
356 mutex_unlock(&ct_zone->mutex); in efx_tc_ct_replace()
398 static int efx_tc_ct_destroy(struct efx_tc_ct_zone *ct_zone, in efx_tc_ct_destroy() argument
401 struct efx_nic *efx = ct_zone->efx; in efx_tc_ct_destroy()
412 mutex_lock(&ct_zone->mutex); in efx_tc_ct_destroy()
415 mutex_unlock(&ct_zone->mutex); in efx_tc_ct_destroy()
421 static int efx_tc_ct_stats(struct efx_tc_ct_zone *ct_zone, in efx_tc_ct_stats() argument
424 struct efx_nic *efx = ct_zone->efx; in efx_tc_ct_stats()
453 struct efx_tc_ct_zone *ct_zone = cb_priv; in efx_tc_flow_block() local
460 return efx_tc_ct_replace(ct_zone, tcb); in efx_tc_flow_block()
462 return efx_tc_ct_destroy(ct_zone, tcb); in efx_tc_flow_block()
464 return efx_tc_ct_stats(ct_zone, tcb); in efx_tc_flow_block()
475 struct efx_tc_ct_zone *ct_zone, *old; in efx_tc_ct_register_zone() local
478 ct_zone = kzalloc(sizeof(*ct_zone), GFP_USER); in efx_tc_ct_register_zone()
479 if (!ct_zone) in efx_tc_ct_register_zone()
481 ct_zone->zone = zone; in efx_tc_ct_register_zone()
483 &ct_zone->linkage, in efx_tc_ct_register_zone()
487 kfree(ct_zone); in efx_tc_ct_register_zone()
498 ct_zone->nf_ft = ct_ft; in efx_tc_ct_register_zone()
499 ct_zone->efx = efx; in efx_tc_ct_register_zone()
500 INIT_LIST_HEAD(&ct_zone->cts); in efx_tc_ct_register_zone()
501 mutex_init(&ct_zone->mutex); in efx_tc_ct_register_zone()
502 rc = nf_flow_table_offload_add_cb(ct_ft, efx_tc_flow_block, ct_zone); in efx_tc_ct_register_zone()
507 refcount_set(&ct_zone->ref, 1); in efx_tc_ct_register_zone()
508 return ct_zone; in efx_tc_ct_register_zone()
510 rhashtable_remove_fast(&efx->tc->ct_zone_ht, &ct_zone->linkage, in efx_tc_ct_register_zone()
512 kfree(ct_zone); in efx_tc_ct_register_zone()
517 struct efx_tc_ct_zone *ct_zone) in efx_tc_ct_unregister_zone() argument
521 if (!refcount_dec_and_test(&ct_zone->ref)) in efx_tc_ct_unregister_zone()
523 nf_flow_table_offload_del_cb(ct_zone->nf_ft, efx_tc_flow_block, ct_zone); in efx_tc_ct_unregister_zone()
524 rhashtable_remove_fast(&efx->tc->ct_zone_ht, &ct_zone->linkage, in efx_tc_ct_unregister_zone()
526 mutex_lock(&ct_zone->mutex); in efx_tc_ct_unregister_zone()
527 list_for_each_entry(conn, &ct_zone->cts, list) in efx_tc_ct_unregister_zone()
531 list_for_each_entry_safe(conn, next, &ct_zone->cts, list) in efx_tc_ct_unregister_zone()
533 mutex_unlock(&ct_zone->mutex); in efx_tc_ct_unregister_zone()
534 mutex_destroy(&ct_zone->mutex); in efx_tc_ct_unregister_zone()
536 ct_zone->zone); in efx_tc_ct_unregister_zone()
537 kfree(ct_zone); in efx_tc_ct_unregister_zone()