Lines Matching refs:rule
226 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_##_name)) { \
229 flow_rule_match_##_tcget(rule, &fm); \
239 struct flow_rule *rule, in efx_tc_flower_parse_match() argument
243 struct flow_dissector *dissector = rule->match.dissector; in efx_tc_flower_parse_match()
252 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CONTROL)) { in efx_tc_flower_parse_match()
255 flow_rule_match_control(rule, &fm); in efx_tc_flower_parse_match()
321 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { in efx_tc_flower_parse_match()
324 flow_rule_match_vlan(rule, &fm); in efx_tc_flower_parse_match()
335 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CVLAN)) { in efx_tc_flower_parse_match()
338 flow_rule_match_cvlan(rule, &fm); in efx_tc_flower_parse_match()
349 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { in efx_tc_flower_parse_match()
352 flow_rule_match_eth_addrs(rule, &fm); in efx_tc_flower_parse_match()
386 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_CONTROL)) { in efx_tc_flower_parse_match()
389 flow_rule_match_enc_control(rule, &fm); in efx_tc_flower_parse_match()
435 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CT)) { in efx_tc_flower_parse_match()
438 flow_rule_match_ct(rule, &fm); in efx_tc_flower_parse_match()
743 static void efx_tc_delete_rule(struct efx_nic *efx, struct efx_tc_flow_rule *rule) in efx_tc_delete_rule() argument
745 efx_mae_delete_rule(efx, rule->fw_id); in efx_tc_delete_rule()
748 efx_tc_free_action_set_list(efx, &rule->acts, true); in efx_tc_delete_rule()
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()
751 if (rule->match.encap) in efx_tc_delete_rule()
752 efx_tc_flower_release_encap_match(efx, rule->match.encap); in efx_tc_delete_rule()
753 rule->fw_id = MC_CMD_MAE_ACTION_RULE_INSERT_OUT_ACTION_RULE_ID_NULL; in efx_tc_delete_rule()
971 struct efx_tc_lhs_rule *rule) in efx_tc_flower_handle_lhs_actions() argument
975 struct efx_tc_lhs_action *act = &rule->lhs_act; in efx_tc_flower_handle_lhs_actions()
981 ctype = rule->is_ar ? EFX_TC_COUNTER_TYPE_AR : EFX_TC_COUNTER_TYPE_OR; in efx_tc_flower_handle_lhs_actions()
1459 struct efx_tc_lhs_rule *rule, *old; in efx_tc_flower_replace_foreign_lhs_ar() local
1508 rule = kzalloc(sizeof(*rule), GFP_USER); in efx_tc_flower_replace_foreign_lhs_ar()
1509 if (!rule) { in efx_tc_flower_replace_foreign_lhs_ar()
1513 rule->cookie = tc->cookie; in efx_tc_flower_replace_foreign_lhs_ar()
1514 rule->is_ar = true; in efx_tc_flower_replace_foreign_lhs_ar()
1516 &rule->linkage, in efx_tc_flower_replace_foreign_lhs_ar()
1527 rc = efx_tc_flower_handle_lhs_actions(efx, tc, fr, net_dev, rule); in efx_tc_flower_replace_foreign_lhs_ar()
1531 rule->match = *match; in efx_tc_flower_replace_foreign_lhs_ar()
1532 rule->lhs_act.tun_type = type; in efx_tc_flower_replace_foreign_lhs_ar()
1534 rc = efx_mae_insert_lhs_rule(efx, rule, EFX_TC_PRIO_TC); in efx_tc_flower_replace_foreign_lhs_ar()
1545 efx_tc_flower_release_lhs_actions(efx, &rule->lhs_act); in efx_tc_flower_replace_foreign_lhs_ar()
1547 rhashtable_remove_fast(&efx->tc->lhs_rule_ht, &rule->linkage, in efx_tc_flower_replace_foreign_lhs_ar()
1549 kfree(rule); in efx_tc_flower_replace_foreign_lhs_ar()
1563 struct efx_tc_lhs_rule *rule, *old; in efx_tc_flower_replace_foreign_lhs() local
1621 rule = kzalloc(sizeof(*rule), GFP_USER); in efx_tc_flower_replace_foreign_lhs()
1622 if (!rule) { in efx_tc_flower_replace_foreign_lhs()
1626 rule->cookie = tc->cookie; in efx_tc_flower_replace_foreign_lhs()
1628 &rule->linkage, in efx_tc_flower_replace_foreign_lhs()
1639 rc = efx_tc_flower_handle_lhs_actions(efx, tc, fr, net_dev, rule); in efx_tc_flower_replace_foreign_lhs()
1643 rule->match = *match; in efx_tc_flower_replace_foreign_lhs()
1644 rule->lhs_act.tun_type = type; in efx_tc_flower_replace_foreign_lhs()
1646 rc = efx_mae_insert_lhs_rule(efx, rule, EFX_TC_PRIO_TC); in efx_tc_flower_replace_foreign_lhs()
1657 efx_tc_flower_release_lhs_actions(efx, &rule->lhs_act); in efx_tc_flower_replace_foreign_lhs()
1659 rhashtable_remove_fast(&efx->tc->lhs_rule_ht, &rule->linkage, in efx_tc_flower_replace_foreign_lhs()
1661 kfree(rule); in efx_tc_flower_replace_foreign_lhs()
1674 struct efx_tc_flow_rule *rule = NULL, *old = NULL; in efx_tc_flower_replace_foreign() local
1797 rule = kzalloc(sizeof(*rule), GFP_USER); in efx_tc_flower_replace_foreign()
1798 if (!rule) { in efx_tc_flower_replace_foreign()
1802 INIT_LIST_HEAD(&rule->acts.list); in efx_tc_flower_replace_foreign()
1803 rule->cookie = tc->cookie; in efx_tc_flower_replace_foreign()
1805 &rule->linkage, in efx_tc_flower_replace_foreign()
1899 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace_foreign()
1945 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace_foreign()
1949 rule->match = match; in efx_tc_flower_replace_foreign()
1955 rc = efx_mae_alloc_action_set_list(efx, &rule->acts); in efx_tc_flower_replace_foreign()
1960 rc = efx_mae_insert_rule(efx, &rule->match, EFX_TC_PRIO_TC, in efx_tc_flower_replace_foreign()
1961 rule->acts.fw_id, &rule->fw_id); in efx_tc_flower_replace_foreign()
1969 efx_mae_free_action_set_list(efx, &rule->acts); in efx_tc_flower_replace_foreign()
1978 if (rule) { in efx_tc_flower_replace_foreign()
1981 &rule->linkage, in efx_tc_flower_replace_foreign()
1983 efx_tc_free_action_set_list(efx, &rule->acts, false); in efx_tc_flower_replace_foreign()
1985 kfree(rule); in efx_tc_flower_replace_foreign()
1999 struct efx_tc_lhs_rule *rule, *old; in efx_tc_flower_replace_lhs() local
2019 rule = kzalloc(sizeof(*rule), GFP_USER); in efx_tc_flower_replace_lhs()
2020 if (!rule) in efx_tc_flower_replace_lhs()
2022 rule->cookie = tc->cookie; in efx_tc_flower_replace_lhs()
2024 &rule->linkage, in efx_tc_flower_replace_lhs()
2041 rc = efx_tc_flower_handle_lhs_actions(efx, tc, fr, efx->net_dev, rule); in efx_tc_flower_replace_lhs()
2045 rule->match = *match; in efx_tc_flower_replace_lhs()
2047 rc = efx_mae_insert_lhs_rule(efx, rule, EFX_TC_PRIO_TC); in efx_tc_flower_replace_lhs()
2058 efx_tc_flower_release_lhs_actions(efx, &rule->lhs_act); in efx_tc_flower_replace_lhs()
2060 rhashtable_remove_fast(&efx->tc->lhs_rule_ht, &rule->linkage, in efx_tc_flower_replace_lhs()
2062 kfree(rule); in efx_tc_flower_replace_lhs()
2074 struct efx_tc_flow_rule *rule = NULL, *old; in efx_tc_flower_replace() local
2180 rule = kzalloc(sizeof(*rule), GFP_USER); in efx_tc_flower_replace()
2181 if (!rule) { in efx_tc_flower_replace()
2185 INIT_LIST_HEAD(&rule->acts.list); in efx_tc_flower_replace()
2186 rule->cookie = tc->cookie; in efx_tc_flower_replace()
2188 &rule->linkage, in efx_tc_flower_replace()
2292 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2336 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2337 act->user = &rule->acts; in efx_tc_flower_replace()
2377 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2495 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2503 rule->match = match; in efx_tc_flower_replace()
2505 rc = efx_mae_alloc_action_set_list(efx, &rule->acts); in efx_tc_flower_replace()
2512 rule->fallback = &efx->tc->facts.pf; in efx_tc_flower_replace()
2515 rule->fallback = &efx->tc->facts.reps; in efx_tc_flower_replace()
2516 if (!efx_tc_check_ready(efx, rule)) { in efx_tc_flower_replace()
2518 acts_id = rule->fallback->fw_id; in efx_tc_flower_replace()
2521 acts_id = rule->acts.fw_id; in efx_tc_flower_replace()
2523 rc = efx_mae_insert_rule(efx, &rule->match, EFX_TC_PRIO_TC, in efx_tc_flower_replace()
2524 acts_id, &rule->fw_id); in efx_tc_flower_replace()
2532 efx_mae_free_action_set_list(efx, &rule->acts); in efx_tc_flower_replace()
2541 if (rule) { in efx_tc_flower_replace()
2544 &rule->linkage, in efx_tc_flower_replace()
2546 efx_tc_free_action_set_list(efx, &rule->acts, false); in efx_tc_flower_replace()
2548 kfree(rule); in efx_tc_flower_replace()
2558 struct efx_tc_flow_rule *rule; in efx_tc_flower_destroy() local
2577 rule = rhashtable_lookup_fast(&efx->tc->match_action_ht, &tc->cookie, in efx_tc_flower_destroy()
2579 if (!rule) { in efx_tc_flower_destroy()
2593 efx_tc_delete_rule(efx, rule); in efx_tc_flower_destroy()
2595 rhashtable_remove_fast(&efx->tc->match_action_ht, &rule->linkage, in efx_tc_flower_destroy()
2597 netif_dbg(efx, drv, efx->net_dev, "Removed filter %lx\n", rule->cookie); in efx_tc_flower_destroy()
2598 kfree(rule); in efx_tc_flower_destroy()
2666 u32 eg_port, struct efx_tc_flow_rule *rule) in efx_tc_configure_default_rule() argument
2668 struct efx_tc_action_set_list *acts = &rule->acts; in efx_tc_configure_default_rule()
2669 struct efx_tc_match *match = &rule->match; in efx_tc_configure_default_rule()
2689 acts->fw_id, &rule->fw_id); in efx_tc_configure_default_rule()
2705 struct efx_tc_flow_rule *rule = &efx->tc->dflt.pf; in efx_tc_configure_default_rule_pf() local
2710 return efx_tc_configure_default_rule(efx, ing_port, eg_port, rule); in efx_tc_configure_default_rule_pf()
2715 struct efx_tc_flow_rule *rule = &efx->tc->dflt.wire; in efx_tc_configure_default_rule_wire() local
2720 return efx_tc_configure_default_rule(efx, ing_port, eg_port, rule); in efx_tc_configure_default_rule_wire()
2725 struct efx_tc_flow_rule *rule = &efv->dflt; in efx_tc_configure_default_rule_rep() local
2731 return efx_tc_configure_default_rule(efx, ing_port, eg_port, rule); in efx_tc_configure_default_rule_rep()
2735 struct efx_tc_flow_rule *rule) in efx_tc_deconfigure_default_rule() argument
2737 if (rule->fw_id != MC_CMD_MAE_ACTION_RULE_INSERT_OUT_ACTION_RULE_ID_NULL) in efx_tc_deconfigure_default_rule()
2738 efx_tc_delete_rule(efx, rule); in efx_tc_deconfigure_default_rule()
2739 rule->fw_id = MC_CMD_MAE_ACTION_RULE_INSERT_OUT_ACTION_RULE_ID_NULL; in efx_tc_deconfigure_default_rule()
2945 struct efx_tc_lhs_rule *rule = ptr; in efx_tc_lhs_free() local
2950 rule->cookie); in efx_tc_lhs_free()
2952 if (rule->lhs_act.zone) in efx_tc_lhs_free()
2953 efx_tc_ct_unregister_zone(efx, rule->lhs_act.zone); in efx_tc_lhs_free()
2954 if (rule->lhs_act.count) in efx_tc_lhs_free()
2955 efx_tc_flower_put_counter_index(efx, rule->lhs_act.count); in efx_tc_lhs_free()
2956 efx_mae_remove_lhs_rule(efx, rule); in efx_tc_lhs_free()
2958 kfree(rule); in efx_tc_lhs_free()
2971 struct efx_tc_flow_rule *rule = ptr; in efx_tc_flow_free() local
2976 rule->cookie); in efx_tc_flow_free()
2979 efx_tc_delete_rule(efx, rule); in efx_tc_flow_free()
2981 kfree(rule); in efx_tc_flow_free()