Lines Matching full:act
175 struct efx_tc_action_set *act, bool in_hw) in efx_tc_free_action_set() argument
179 * not still have it in act. in efx_tc_free_action_set()
182 efx_mae_free_action_set(efx, act->fw_id); in efx_tc_free_action_set()
186 list_del(&act->list); in efx_tc_free_action_set()
188 if (act->count) { in efx_tc_free_action_set()
189 spin_lock_bh(&act->count->cnt->lock); in efx_tc_free_action_set()
190 if (!list_empty(&act->count_user)) in efx_tc_free_action_set()
191 list_del(&act->count_user); in efx_tc_free_action_set()
192 spin_unlock_bh(&act->count->cnt->lock); in efx_tc_free_action_set()
193 efx_tc_flower_put_counter_index(efx, act->count); in efx_tc_free_action_set()
195 if (act->encap_md) { in efx_tc_free_action_set()
196 list_del(&act->encap_user); in efx_tc_free_action_set()
197 efx_tc_flower_release_encap_md(efx, act->encap_md); in efx_tc_free_action_set()
199 if (act->src_mac) in efx_tc_free_action_set()
200 efx_tc_flower_put_mac(efx, act->src_mac); in efx_tc_free_action_set()
201 if (act->dst_mac) in efx_tc_free_action_set()
202 efx_tc_flower_put_mac(efx, act->dst_mac); in efx_tc_free_action_set()
203 kfree(act); in efx_tc_free_action_set()
210 struct efx_tc_action_set *act, *next; in efx_tc_free_action_set_list() local
218 /* Any act that's on the list will be in_hw even if the list isn't */ in efx_tc_free_action_set_list()
219 list_for_each_entry_safe(act, next, &acts->list, list) in efx_tc_free_action_set_list()
220 efx_tc_free_action_set(efx, act, true); in efx_tc_free_action_set_list()
778 static bool efx_tc_flower_action_order_ok(const struct efx_tc_action_set *act, in efx_tc_flower_action_order_ok() argument
783 if (act->decap) in efx_tc_flower_action_order_ok()
788 if (act->dst_mac || act->src_mac) in efx_tc_flower_action_order_ok()
792 if (act->do_ttl_dec) in efx_tc_flower_action_order_ok()
796 if (act->vlan_pop >= 2) in efx_tc_flower_action_order_ok()
802 if (act->vlan_push) in efx_tc_flower_action_order_ok()
806 if (act->vlan_push >= 2) in efx_tc_flower_action_order_ok()
810 if (act->count) in efx_tc_flower_action_order_ok()
815 if (act->encap_md) in efx_tc_flower_action_order_ok()
819 return !act->deliver; in efx_tc_flower_action_order_ok()
821 if (act->encap_md) in efx_tc_flower_action_order_ok()
823 return !act->do_ttl_dec; in efx_tc_flower_action_order_ok()
883 struct efx_tc_lhs_action *act = &rule->lhs_act; in efx_tc_flower_handle_lhs_actions() local
909 act->rid = rid; in efx_tc_flower_handle_lhs_actions()
925 WARN_ON(act->count); /* can't happen */ in efx_tc_flower_handle_lhs_actions()
926 act->count = cnt; in efx_tc_flower_handle_lhs_actions()
931 if (act->zone) { in efx_tc_flower_handle_lhs_actions()
961 act->zone = ct_zone; in efx_tc_flower_handle_lhs_actions()
978 struct efx_tc_lhs_action *act) in efx_tc_flower_release_lhs_actions() argument
980 if (act->rid) in efx_tc_flower_release_lhs_actions()
981 efx_tc_put_recirc_id(efx, act->rid); in efx_tc_flower_release_lhs_actions()
982 if (act->zone) in efx_tc_flower_release_lhs_actions()
983 efx_tc_ct_unregister_zone(efx, act->zone); in efx_tc_flower_release_lhs_actions()
984 if (act->count) in efx_tc_flower_release_lhs_actions()
985 efx_tc_flower_put_counter_index(efx, act->count); in efx_tc_flower_release_lhs_actions()
1014 * @act: action set (cursor) to update
1019 * combined into a complete packet field edit, add that edit to @act,
1024 struct efx_tc_action_set *act, in efx_tc_complete_mac_mangle() argument
1036 if (act->dst_mac) in efx_tc_complete_mac_mangle()
1037 efx_tc_flower_put_mac(efx, act->dst_mac); in efx_tc_complete_mac_mangle()
1039 act->dst_mac = ped; in efx_tc_complete_mac_mangle()
1051 if (act->src_mac) in efx_tc_complete_mac_mangle()
1052 efx_tc_flower_put_mac(efx, act->src_mac); in efx_tc_complete_mac_mangle()
1054 act->src_mac = ped; in efx_tc_complete_mac_mangle()
1063 static int efx_tc_pedit_add(struct efx_nic *efx, struct efx_tc_action_set *act, in efx_tc_pedit_add() argument
1082 if (!efx_tc_flower_action_order_ok(act, in efx_tc_pedit_add()
1087 act->do_ttl_dec = 1; in efx_tc_pedit_add()
1107 if (!efx_tc_flower_action_order_ok(act, in efx_tc_pedit_add()
1112 act->do_ttl_dec = 1; in efx_tc_pedit_add()
1132 * @act: action set (cursor) to update
1140 * earlier partial mangle, consume and apply to @act by calling
1144 static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act, in efx_tc_mangle() argument
1158 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_PEDIT_MAC_ADDRS)) { in efx_tc_mangle()
1175 return efx_tc_complete_mac_mangle(efx, act, mung, extack); in efx_tc_mangle()
1191 return efx_tc_complete_mac_mangle(efx, act, mung, extack); in efx_tc_mangle()
1202 return efx_tc_complete_mac_mangle(efx, act, mung, extack); in efx_tc_mangle()
1245 if (!efx_tc_flower_action_order_ok(act, in efx_tc_mangle()
1255 act->do_ttl_dec = 1; in efx_tc_mangle()
1304 if (!efx_tc_flower_action_order_ok(act, in efx_tc_mangle()
1314 act->do_ttl_dec = 1; in efx_tc_mangle()
1364 struct efx_tc_action_set *act = NULL; in efx_tc_flower_replace_foreign() local
1502 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace_foreign()
1503 if (!act) { in efx_tc_flower_replace_foreign()
1510 * operation & how 'act' cursor is used. in efx_tc_flower_replace_foreign()
1521 save = *act; in efx_tc_flower_replace_foreign()
1532 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_COUNT)) { in efx_tc_flower_replace_foreign()
1545 act->count = ctr; in efx_tc_flower_replace_foreign()
1546 INIT_LIST_HEAD(&act->count_user); in efx_tc_flower_replace_foreign()
1549 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DELIVER)) { in efx_tc_flower_replace_foreign()
1574 act->dest_mport = rc; in efx_tc_flower_replace_foreign()
1575 act->deliver = 1; in efx_tc_flower_replace_foreign()
1576 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace_foreign()
1582 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace_foreign()
1583 act = NULL; in efx_tc_flower_replace_foreign()
1586 /* Mirror, so continue on with saved act */ in efx_tc_flower_replace_foreign()
1587 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace_foreign()
1588 if (!act) { in efx_tc_flower_replace_foreign()
1592 *act = save; in efx_tc_flower_replace_foreign()
1595 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DECAP)) { in efx_tc_flower_replace_foreign()
1600 act->decap = 1; in efx_tc_flower_replace_foreign()
1615 if (act) { in efx_tc_flower_replace_foreign()
1620 efx_mae_mport_uplink(efx, &act->dest_mport); in efx_tc_flower_replace_foreign()
1621 act->deliver = 1; in efx_tc_flower_replace_foreign()
1623 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace_foreign()
1628 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace_foreign()
1629 act = NULL; /* Prevent double-free in error path */ in efx_tc_flower_replace_foreign()
1659 if (act) in efx_tc_flower_replace_foreign()
1660 efx_tc_free_action_set(efx, act, false); in efx_tc_flower_replace_foreign()
1759 struct efx_tc_action_set *act = NULL; in efx_tc_flower_replace() local
1885 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace()
1886 if (!act) { in efx_tc_flower_replace()
1899 * To translate between these two models, we maintain a 'cursor', @act, in efx_tc_flower_replace()
1903 * append @act to the action-set list (@rule->acts); if this is a pipe in efx_tc_flower_replace()
1904 * action (mirred mirror) we then allocate a new @act with a copy of in efx_tc_flower_replace()
1905 * the cursor state _before_ the delivery action, otherwise we set @act in efx_tc_flower_replace()
1908 * @rule->acts or pointed to by @act (and never both), and that only in efx_tc_flower_replace()
1910 * in the failure path, @act only needs to be freed in memory, whereas in efx_tc_flower_replace()
1919 if (!act) { in efx_tc_flower_replace()
1939 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_COUNT)) { in efx_tc_flower_replace()
1941 * (gact shot, mirred redirect) or clone act in efx_tc_flower_replace()
1964 act->count = ctr; in efx_tc_flower_replace()
1965 INIT_LIST_HEAD(&act->count_user); in efx_tc_flower_replace()
1970 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace()
1975 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
1976 act = NULL; /* end of the line */ in efx_tc_flower_replace()
1980 save = *act; in efx_tc_flower_replace()
1985 if (!efx_tc_flower_action_order_ok(act, in efx_tc_flower_replace()
1999 act->encap_md = encap; in efx_tc_flower_replace()
2000 list_add_tail(&act->encap_user, &encap->users); in efx_tc_flower_replace()
2001 act->dest_mport = encap->dest_mport; in efx_tc_flower_replace()
2002 act->deliver = 1; in efx_tc_flower_replace()
2003 if (act->count && !WARN_ON(!act->count->cnt)) { in efx_tc_flower_replace()
2009 spin_lock_bh(&act->count->cnt->lock); in efx_tc_flower_replace()
2010 list_add_tail(&act->count_user, in efx_tc_flower_replace()
2011 &act->count->cnt->users); in efx_tc_flower_replace()
2012 spin_unlock_bh(&act->count->cnt->lock); in efx_tc_flower_replace()
2014 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace()
2019 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2020 act->user = &rule->acts; in efx_tc_flower_replace()
2021 act = NULL; in efx_tc_flower_replace()
2024 /* Mirror, so continue on with saved act */ in efx_tc_flower_replace()
2026 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace()
2027 if (!act) { in efx_tc_flower_replace()
2031 *act = save; in efx_tc_flower_replace()
2035 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DELIVER)) { in efx_tc_flower_replace()
2053 act->dest_mport = rc; in efx_tc_flower_replace()
2054 act->deliver = 1; in efx_tc_flower_replace()
2055 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace()
2060 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2061 act = NULL; in efx_tc_flower_replace()
2064 /* Mirror, so continue on with saved act */ in efx_tc_flower_replace()
2066 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace()
2067 if (!act) { in efx_tc_flower_replace()
2071 *act = save; in efx_tc_flower_replace()
2074 if (act->vlan_push) { in efx_tc_flower_replace()
2075 act->vlan_push--; in efx_tc_flower_replace()
2076 } else if (efx_tc_flower_action_order_ok(act, EFX_TC_AO_VLAN_POP)) { in efx_tc_flower_replace()
2077 act->vlan_pop++; in efx_tc_flower_replace()
2086 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_VLAN_PUSH)) { in efx_tc_flower_replace()
2094 act->vlan_tci[act->vlan_push] = cpu_to_be16(tci); in efx_tc_flower_replace()
2095 act->vlan_proto[act->vlan_push] = fa->vlan.proto; in efx_tc_flower_replace()
2096 act->vlan_push++; in efx_tc_flower_replace()
2099 rc = efx_tc_pedit_add(efx, act, fa, extack); in efx_tc_flower_replace()
2104 rc = efx_tc_mangle(efx, act, fa, &mung, extack, &match); in efx_tc_flower_replace()
2150 if (act) { in efx_tc_flower_replace()
2156 efx_mae_mport_uplink(efx, &act->dest_mport); in efx_tc_flower_replace()
2163 &act->dest_mport); in efx_tc_flower_replace()
2164 act->deliver = 1; in efx_tc_flower_replace()
2165 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace()
2170 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2171 act = NULL; /* Prevent double-free in error path */ in efx_tc_flower_replace()
2214 if (act) in efx_tc_flower_replace()
2215 efx_tc_free_action_set(efx, act, false); in efx_tc_flower_replace()
2345 struct efx_tc_action_set *act; in efx_tc_configure_default_rule() local
2350 act = kzalloc(sizeof(*act), GFP_KERNEL); in efx_tc_configure_default_rule()
2351 if (!act) in efx_tc_configure_default_rule()
2353 act->deliver = 1; in efx_tc_configure_default_rule()
2354 act->dest_mport = eg_port; in efx_tc_configure_default_rule()
2355 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_configure_default_rule()
2359 list_add_tail(&act->list, &acts->list); in efx_tc_configure_default_rule()
2371 list_del(&act->list); in efx_tc_configure_default_rule()
2372 efx_mae_free_action_set(efx, act->fw_id); in efx_tc_configure_default_rule()
2374 kfree(act); in efx_tc_configure_default_rule()
2420 struct efx_tc_action_set *act; in efx_tc_configure_fallback_acts() local
2423 act = kzalloc(sizeof(*act), GFP_KERNEL); in efx_tc_configure_fallback_acts()
2424 if (!act) in efx_tc_configure_fallback_acts()
2426 act->deliver = 1; in efx_tc_configure_fallback_acts()
2427 act->dest_mport = eg_port; in efx_tc_configure_fallback_acts()
2428 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_configure_fallback_acts()
2432 list_add_tail(&act->list, &acts->list); in efx_tc_configure_fallback_acts()
2438 list_del(&act->list); in efx_tc_configure_fallback_acts()
2439 efx_mae_free_action_set(efx, act->fw_id); in efx_tc_configure_fallback_acts()
2441 kfree(act); in efx_tc_configure_fallback_acts()