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()
783 static bool efx_tc_flower_action_order_ok(const struct efx_tc_action_set *act, in efx_tc_flower_action_order_ok() argument
788 if (act->decap) in efx_tc_flower_action_order_ok()
793 if (act->dst_mac || act->src_mac) in efx_tc_flower_action_order_ok()
797 if (act->do_ttl_dec) in efx_tc_flower_action_order_ok()
801 if (act->vlan_pop >= 2) in efx_tc_flower_action_order_ok()
807 if (act->vlan_push) in efx_tc_flower_action_order_ok()
811 if (act->vlan_push >= 2) in efx_tc_flower_action_order_ok()
815 if (act->count) in efx_tc_flower_action_order_ok()
820 if (act->encap_md) in efx_tc_flower_action_order_ok()
824 return !act->deliver; in efx_tc_flower_action_order_ok()
826 if (act->encap_md) in efx_tc_flower_action_order_ok()
828 return !act->do_ttl_dec; in efx_tc_flower_action_order_ok()
975 struct efx_tc_lhs_action *act = &rule->lhs_act; in efx_tc_flower_handle_lhs_actions() local
1004 act->rid = rid; in efx_tc_flower_handle_lhs_actions()
1020 WARN_ON(act->count); /* can't happen */ in efx_tc_flower_handle_lhs_actions()
1021 act->count = cnt; in efx_tc_flower_handle_lhs_actions()
1026 if (act->zone) { in efx_tc_flower_handle_lhs_actions()
1056 act->zone = ct_zone; in efx_tc_flower_handle_lhs_actions()
1073 struct efx_tc_lhs_action *act) in efx_tc_flower_release_lhs_actions() argument
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()
1077 if (act->zone) in efx_tc_flower_release_lhs_actions()
1078 efx_tc_ct_unregister_zone(efx, act->zone); in efx_tc_flower_release_lhs_actions()
1079 if (act->count) in efx_tc_flower_release_lhs_actions()
1080 efx_tc_flower_put_counter_index(efx, act->count); in efx_tc_flower_release_lhs_actions()
1109 * @act: action set (cursor) to update
1114 * combined into a complete packet field edit, add that edit to @act,
1119 struct efx_tc_action_set *act, in efx_tc_complete_mac_mangle() argument
1131 if (act->dst_mac) in efx_tc_complete_mac_mangle()
1132 efx_tc_flower_put_mac(efx, act->dst_mac); in efx_tc_complete_mac_mangle()
1134 act->dst_mac = ped; in efx_tc_complete_mac_mangle()
1146 if (act->src_mac) in efx_tc_complete_mac_mangle()
1147 efx_tc_flower_put_mac(efx, act->src_mac); in efx_tc_complete_mac_mangle()
1149 act->src_mac = ped; in efx_tc_complete_mac_mangle()
1158 static int efx_tc_pedit_add(struct efx_nic *efx, struct efx_tc_action_set *act, in efx_tc_pedit_add() argument
1177 if (!efx_tc_flower_action_order_ok(act, in efx_tc_pedit_add()
1182 act->do_ttl_dec = 1; in efx_tc_pedit_add()
1202 if (!efx_tc_flower_action_order_ok(act, in efx_tc_pedit_add()
1207 act->do_ttl_dec = 1; in efx_tc_pedit_add()
1227 * @act: action set (cursor) to update
1235 * earlier partial mangle, consume and apply to @act by calling
1239 static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act, in efx_tc_mangle() argument
1253 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_PEDIT_MAC_ADDRS)) { in efx_tc_mangle()
1270 return efx_tc_complete_mac_mangle(efx, act, mung, extack); in efx_tc_mangle()
1286 return efx_tc_complete_mac_mangle(efx, act, mung, extack); in efx_tc_mangle()
1297 return efx_tc_complete_mac_mangle(efx, act, mung, extack); in efx_tc_mangle()
1340 if (!efx_tc_flower_action_order_ok(act, in efx_tc_mangle()
1350 act->do_ttl_dec = 1; in efx_tc_mangle()
1399 if (!efx_tc_flower_action_order_ok(act, in efx_tc_mangle()
1409 act->do_ttl_dec = 1; in efx_tc_mangle()
1675 struct efx_tc_action_set *act = NULL; in efx_tc_flower_replace_foreign() local
1818 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace_foreign()
1819 if (!act) { in efx_tc_flower_replace_foreign()
1826 * operation & how 'act' cursor is used. in efx_tc_flower_replace_foreign()
1837 save = *act; in efx_tc_flower_replace_foreign()
1848 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_COUNT)) { in efx_tc_flower_replace_foreign()
1862 act->count = ctr; in efx_tc_flower_replace_foreign()
1863 INIT_LIST_HEAD(&act->count_user); in efx_tc_flower_replace_foreign()
1866 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DELIVER)) { in efx_tc_flower_replace_foreign()
1891 act->dest_mport = rc; in efx_tc_flower_replace_foreign()
1892 act->deliver = 1; in efx_tc_flower_replace_foreign()
1893 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace_foreign()
1899 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace_foreign()
1900 act = NULL; in efx_tc_flower_replace_foreign()
1903 /* Mirror, so continue on with saved act */ in efx_tc_flower_replace_foreign()
1904 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace_foreign()
1905 if (!act) { in efx_tc_flower_replace_foreign()
1909 *act = save; in efx_tc_flower_replace_foreign()
1912 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DECAP)) { in efx_tc_flower_replace_foreign()
1917 act->decap = 1; in efx_tc_flower_replace_foreign()
1932 if (act) { in efx_tc_flower_replace_foreign()
1937 efx_mae_mport_uplink(efx, &act->dest_mport); in efx_tc_flower_replace_foreign()
1938 act->deliver = 1; in efx_tc_flower_replace_foreign()
1940 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace_foreign()
1945 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace_foreign()
1946 act = NULL; /* Prevent double-free in error path */ in efx_tc_flower_replace_foreign()
1976 if (act) in efx_tc_flower_replace_foreign()
1977 efx_tc_free_action_set(efx, act, false); in efx_tc_flower_replace_foreign()
2076 struct efx_tc_action_set *act = NULL; in efx_tc_flower_replace() local
2202 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace()
2203 if (!act) { in efx_tc_flower_replace()
2216 * To translate between these two models, we maintain a 'cursor', @act, in efx_tc_flower_replace()
2220 * append @act to the action-set list (@rule->acts); if this is a pipe in efx_tc_flower_replace()
2221 * action (mirred mirror) we then allocate a new @act with a copy of in efx_tc_flower_replace()
2222 * the cursor state _before_ the delivery action, otherwise we set @act in efx_tc_flower_replace()
2225 * @rule->acts or pointed to by @act (and never both), and that only in efx_tc_flower_replace()
2227 * in the failure path, @act only needs to be freed in memory, whereas in efx_tc_flower_replace()
2236 if (!act) { in efx_tc_flower_replace()
2256 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_COUNT)) { in efx_tc_flower_replace()
2258 * (gact shot, mirred redirect) or clone act in efx_tc_flower_replace()
2281 act->count = ctr; in efx_tc_flower_replace()
2282 INIT_LIST_HEAD(&act->count_user); in efx_tc_flower_replace()
2287 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace()
2292 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2293 act = NULL; /* end of the line */ in efx_tc_flower_replace()
2297 save = *act; in efx_tc_flower_replace()
2302 if (!efx_tc_flower_action_order_ok(act, in efx_tc_flower_replace()
2316 act->encap_md = encap; in efx_tc_flower_replace()
2317 list_add_tail(&act->encap_user, &encap->users); in efx_tc_flower_replace()
2318 act->dest_mport = encap->dest_mport; in efx_tc_flower_replace()
2319 act->deliver = 1; in efx_tc_flower_replace()
2320 if (act->count && !WARN_ON(!act->count->cnt)) { in efx_tc_flower_replace()
2326 spin_lock_bh(&act->count->cnt->lock); in efx_tc_flower_replace()
2327 list_add_tail(&act->count_user, in efx_tc_flower_replace()
2328 &act->count->cnt->users); in efx_tc_flower_replace()
2329 spin_unlock_bh(&act->count->cnt->lock); in efx_tc_flower_replace()
2331 rc = efx_mae_alloc_action_set(efx, act); 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()
2338 act = NULL; in efx_tc_flower_replace()
2341 /* Mirror, so continue on with saved act */ in efx_tc_flower_replace()
2343 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace()
2344 if (!act) { in efx_tc_flower_replace()
2348 *act = save; in efx_tc_flower_replace()
2352 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DELIVER)) { in efx_tc_flower_replace()
2370 act->dest_mport = rc; in efx_tc_flower_replace()
2371 act->deliver = 1; in efx_tc_flower_replace()
2372 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace()
2377 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2378 act = NULL; in efx_tc_flower_replace()
2381 /* Mirror, so continue on with saved act */ in efx_tc_flower_replace()
2383 act = kzalloc(sizeof(*act), GFP_USER); in efx_tc_flower_replace()
2384 if (!act) { in efx_tc_flower_replace()
2388 *act = save; in efx_tc_flower_replace()
2391 if (act->vlan_push) { in efx_tc_flower_replace()
2392 act->vlan_push--; in efx_tc_flower_replace()
2393 } else if (efx_tc_flower_action_order_ok(act, EFX_TC_AO_VLAN_POP)) { in efx_tc_flower_replace()
2394 act->vlan_pop++; in efx_tc_flower_replace()
2403 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_VLAN_PUSH)) { in efx_tc_flower_replace()
2411 act->vlan_tci[act->vlan_push] = cpu_to_be16(tci); in efx_tc_flower_replace()
2412 act->vlan_proto[act->vlan_push] = fa->vlan.proto; in efx_tc_flower_replace()
2413 act->vlan_push++; in efx_tc_flower_replace()
2416 rc = efx_tc_pedit_add(efx, act, fa, extack); in efx_tc_flower_replace()
2421 rc = efx_tc_mangle(efx, act, fa, &mung, extack, &match); in efx_tc_flower_replace()
2462 act->do_nat = 1; in efx_tc_flower_replace()
2475 if (act) { in efx_tc_flower_replace()
2481 efx_mae_mport_uplink(efx, &act->dest_mport); in efx_tc_flower_replace()
2488 &act->dest_mport); in efx_tc_flower_replace()
2489 act->deliver = 1; in efx_tc_flower_replace()
2490 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_flower_replace()
2495 list_add_tail(&act->list, &rule->acts.list); in efx_tc_flower_replace()
2496 act = NULL; /* Prevent double-free in error path */ in efx_tc_flower_replace()
2539 if (act) in efx_tc_flower_replace()
2540 efx_tc_free_action_set(efx, act, false); in efx_tc_flower_replace()
2670 struct efx_tc_action_set *act; in efx_tc_configure_default_rule() local
2675 act = kzalloc(sizeof(*act), GFP_KERNEL); in efx_tc_configure_default_rule()
2676 if (!act) in efx_tc_configure_default_rule()
2678 act->deliver = 1; in efx_tc_configure_default_rule()
2679 act->dest_mport = eg_port; in efx_tc_configure_default_rule()
2680 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_configure_default_rule()
2684 list_add_tail(&act->list, &acts->list); in efx_tc_configure_default_rule()
2696 list_del(&act->list); in efx_tc_configure_default_rule()
2697 efx_mae_free_action_set(efx, act->fw_id); in efx_tc_configure_default_rule()
2699 kfree(act); in efx_tc_configure_default_rule()
2745 struct efx_tc_action_set *act; in efx_tc_configure_fallback_acts() local
2748 act = kzalloc(sizeof(*act), GFP_KERNEL); in efx_tc_configure_fallback_acts()
2749 if (!act) in efx_tc_configure_fallback_acts()
2751 act->deliver = 1; in efx_tc_configure_fallback_acts()
2752 act->dest_mport = eg_port; in efx_tc_configure_fallback_acts()
2753 rc = efx_mae_alloc_action_set(efx, act); in efx_tc_configure_fallback_acts()
2757 list_add_tail(&act->list, &acts->list); in efx_tc_configure_fallback_acts()
2763 list_del(&act->list); in efx_tc_configure_fallback_acts()
2764 efx_mae_free_action_set(efx, act->fw_id); in efx_tc_configure_fallback_acts()
2766 kfree(act); in efx_tc_configure_fallback_acts()