Lines Matching full:rid
694 struct efx_tc_recirc_id *rid, *old; in efx_tc_get_recirc_id() local
697 rid = kzalloc(sizeof(*rid), GFP_USER); in efx_tc_get_recirc_id()
698 if (!rid) in efx_tc_get_recirc_id()
700 rid->chain_index = chain_index; in efx_tc_get_recirc_id()
705 rid->net_dev = net_dev; in efx_tc_get_recirc_id()
707 &rid->linkage, in efx_tc_get_recirc_id()
711 kfree(rid); in efx_tc_get_recirc_id()
717 rid = old; in efx_tc_get_recirc_id()
722 &rid->linkage, in efx_tc_get_recirc_id()
724 kfree(rid); in efx_tc_get_recirc_id()
727 rid->fw_id = rc; in efx_tc_get_recirc_id()
728 refcount_set(&rid->ref, 1); in efx_tc_get_recirc_id()
730 return rid; in efx_tc_get_recirc_id()
733 static void efx_tc_put_recirc_id(struct efx_nic *efx, struct efx_tc_recirc_id *rid) in efx_tc_put_recirc_id() argument
735 if (!refcount_dec_and_test(&rid->ref)) in efx_tc_put_recirc_id()
737 rhashtable_remove_fast(&efx->tc->recirc_ht, &rid->linkage, in efx_tc_put_recirc_id()
739 ida_free(&efx->tc->recirc_ida, rid->fw_id); in efx_tc_put_recirc_id()
740 kfree(rid); in efx_tc_put_recirc_id()
749 if (rule->match.rid) in efx_tc_delete_rule()
750 efx_tc_put_recirc_id(efx, rule->match.rid); in efx_tc_delete_rule()
985 struct efx_tc_recirc_id *rid; in efx_tc_flower_handle_lhs_actions() local
998 rid = efx_tc_get_recirc_id(efx, fa->chain_index, in efx_tc_flower_handle_lhs_actions()
1000 if (IS_ERR(rid)) { in efx_tc_flower_handle_lhs_actions()
1002 return PTR_ERR(rid); in efx_tc_flower_handle_lhs_actions()
1004 act->rid = rid; in efx_tc_flower_handle_lhs_actions()
1075 if (act->rid) in efx_tc_flower_release_lhs_actions()
1076 efx_tc_put_recirc_id(efx, act->rid); in efx_tc_flower_release_lhs_actions()
1706 struct efx_tc_recirc_id *rid; in efx_tc_flower_replace_foreign() local
1708 rid = efx_tc_get_recirc_id(efx, tc->common.chain_index, net_dev); in efx_tc_flower_replace_foreign()
1709 if (IS_ERR(rid)) { in efx_tc_flower_replace_foreign()
1713 return PTR_ERR(rid); in efx_tc_flower_replace_foreign()
1715 match.rid = rid; in efx_tc_flower_replace_foreign()
1716 match.value.recirc_id = rid->fw_id; in efx_tc_flower_replace_foreign()
1974 if (match.rid) in efx_tc_flower_replace_foreign()
1975 efx_tc_put_recirc_id(efx, match.rid); in efx_tc_flower_replace_foreign()
2127 * Conveniently, match.rid == NULL and match.value.recirc_id == 0 owing in efx_tc_flower_replace()
2131 struct efx_tc_recirc_id *rid; in efx_tc_flower_replace() local
2143 rid = efx_tc_get_recirc_id(efx, tc->common.chain_index, in efx_tc_flower_replace()
2145 if (IS_ERR(rid)) { in efx_tc_flower_replace()
2149 return PTR_ERR(rid); in efx_tc_flower_replace()
2151 match.rid = rid; in efx_tc_flower_replace()
2152 match.value.recirc_id = rid->fw_id; in efx_tc_flower_replace()
2537 if (match.rid) in efx_tc_flower_replace()
2538 efx_tc_put_recirc_id(efx, match.rid); in efx_tc_flower_replace()
2935 struct efx_tc_recirc_id *rid = ptr; in efx_tc_recirc_free() local
2938 WARN_ON(refcount_read(&rid->ref)); in efx_tc_recirc_free()
2939 ida_free(&efx->tc->recirc_ida, rid->fw_id); in efx_tc_recirc_free()
2940 kfree(rid); in efx_tc_recirc_free()