Lines Matching refs:act

175 				   struct efx_tc_action_set *act, bool in_hw)
179 * not still have it in act.
182 efx_mae_free_action_set(efx, act->fw_id);
186 list_del(&act->list);
188 if (act->count) {
189 spin_lock_bh(&act->count->cnt->lock);
190 if (!list_empty(&act->count_user))
191 list_del(&act->count_user);
192 spin_unlock_bh(&act->count->cnt->lock);
193 efx_tc_flower_put_counter_index(efx, act->count);
195 if (act->encap_md) {
196 list_del(&act->encap_user);
197 efx_tc_flower_release_encap_md(efx, act->encap_md);
199 if (act->src_mac)
200 efx_tc_flower_put_mac(efx, act->src_mac);
201 if (act->dst_mac)
202 efx_tc_flower_put_mac(efx, act->dst_mac);
203 kfree(act);
210 struct efx_tc_action_set *act, *next;
218 /* Any act that's on the list will be in_hw even if the list isn't */
219 list_for_each_entry_safe(act, next, &acts->list, list)
220 efx_tc_free_action_set(efx, act, true);
787 static bool efx_tc_flower_action_order_ok(const struct efx_tc_action_set *act,
792 if (act->decap)
797 if (act->dst_mac || act->src_mac)
801 if (act->do_ttl_dec)
805 if (act->vlan_pop >= 2)
811 if (act->vlan_push)
815 if (act->vlan_push >= 2)
819 if (act->count)
824 if (act->encap_md)
828 return !act->deliver;
830 if (act->encap_md)
832 return !act->do_ttl_dec;
979 struct efx_tc_lhs_action *act = &rule->lhs_act;
1008 act->rid = rid;
1024 WARN_ON(act->count); /* can't happen */
1025 act->count = cnt;
1030 if (act->zone) {
1060 act->zone = ct_zone;
1077 struct efx_tc_lhs_action *act)
1079 if (act->rid)
1080 efx_tc_put_recirc_id(efx, act->rid);
1081 if (act->zone)
1082 efx_tc_ct_unregister_zone(efx, act->zone);
1083 if (act->count)
1084 efx_tc_flower_put_counter_index(efx, act->count);
1113 * @act: action set (cursor) to update
1118 * combined into a complete packet field edit, add that edit to @act,
1123 struct efx_tc_action_set *act,
1135 if (act->dst_mac)
1136 efx_tc_flower_put_mac(efx, act->dst_mac);
1138 act->dst_mac = ped;
1150 if (act->src_mac)
1151 efx_tc_flower_put_mac(efx, act->src_mac);
1153 act->src_mac = ped;
1162 static int efx_tc_pedit_add(struct efx_nic *efx, struct efx_tc_action_set *act,
1181 if (!efx_tc_flower_action_order_ok(act,
1186 act->do_ttl_dec = 1;
1206 if (!efx_tc_flower_action_order_ok(act,
1211 act->do_ttl_dec = 1;
1231 * @act: action set (cursor) to update
1239 * earlier partial mangle, consume and apply to @act by calling
1243 static int efx_tc_mangle(struct efx_nic *efx, struct efx_tc_action_set *act,
1257 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_PEDIT_MAC_ADDRS)) {
1274 return efx_tc_complete_mac_mangle(efx, act, mung, extack);
1290 return efx_tc_complete_mac_mangle(efx, act, mung, extack);
1301 return efx_tc_complete_mac_mangle(efx, act, mung, extack);
1344 if (!efx_tc_flower_action_order_ok(act,
1354 act->do_ttl_dec = 1;
1403 if (!efx_tc_flower_action_order_ok(act,
1413 act->do_ttl_dec = 1;
1679 struct efx_tc_action_set *act = NULL;
1822 act = kzalloc(sizeof(*act), GFP_USER);
1823 if (!act) {
1830 * operation & how 'act' cursor is used.
1841 save = *act;
1852 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_COUNT)) {
1866 act->count = ctr;
1867 INIT_LIST_HEAD(&act->count_user);
1870 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DELIVER)) {
1895 act->dest_mport = rc;
1896 act->deliver = 1;
1897 rc = efx_mae_alloc_action_set(efx, act);
1903 list_add_tail(&act->list, &rule->acts.list);
1904 act = NULL;
1907 /* Mirror, so continue on with saved act */
1908 act = kzalloc(sizeof(*act), GFP_USER);
1909 if (!act) {
1913 *act = save;
1916 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DECAP)) {
1921 act->decap = 1;
1936 if (act) {
1941 efx_mae_mport_uplink(efx, &act->dest_mport);
1942 act->deliver = 1;
1944 rc = efx_mae_alloc_action_set(efx, act);
1949 list_add_tail(&act->list, &rule->acts.list);
1950 act = NULL; /* Prevent double-free in error path */
1980 if (act)
1981 efx_tc_free_action_set(efx, act, false);
2080 struct efx_tc_action_set *act = NULL;
2206 act = kzalloc(sizeof(*act), GFP_USER);
2207 if (!act) {
2220 * To translate between these two models, we maintain a 'cursor', @act,
2224 * append @act to the action-set list (@rule->acts); if this is a pipe
2225 * action (mirred mirror) we then allocate a new @act with a copy of
2226 * the cursor state _before_ the delivery action, otherwise we set @act
2229 * @rule->acts or pointed to by @act (and never both), and that only
2231 * in the failure path, @act only needs to be freed in memory, whereas
2240 if (!act) {
2260 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_COUNT)) {
2262 * (gact shot, mirred redirect) or clone act
2285 act->count = ctr;
2286 INIT_LIST_HEAD(&act->count_user);
2291 rc = efx_mae_alloc_action_set(efx, act);
2296 list_add_tail(&act->list, &rule->acts.list);
2297 act = NULL; /* end of the line */
2301 save = *act;
2306 if (!efx_tc_flower_action_order_ok(act,
2320 act->encap_md = encap;
2321 list_add_tail(&act->encap_user, &encap->users);
2322 act->dest_mport = encap->dest_mport;
2323 act->deliver = 1;
2324 if (act->count && !WARN_ON(!act->count->cnt)) {
2330 spin_lock_bh(&act->count->cnt->lock);
2331 list_add_tail(&act->count_user,
2332 &act->count->cnt->users);
2333 spin_unlock_bh(&act->count->cnt->lock);
2335 rc = efx_mae_alloc_action_set(efx, act);
2340 list_add_tail(&act->list, &rule->acts.list);
2341 act->user = &rule->acts;
2342 act = NULL;
2345 /* Mirror, so continue on with saved act */
2347 act = kzalloc(sizeof(*act), GFP_USER);
2348 if (!act) {
2352 *act = save;
2356 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_DELIVER)) {
2374 act->dest_mport = rc;
2375 act->deliver = 1;
2376 rc = efx_mae_alloc_action_set(efx, act);
2381 list_add_tail(&act->list, &rule->acts.list);
2382 act = NULL;
2385 /* Mirror, so continue on with saved act */
2387 act = kzalloc(sizeof(*act), GFP_USER);
2388 if (!act) {
2392 *act = save;
2395 if (act->vlan_push) {
2396 act->vlan_push--;
2397 } else if (efx_tc_flower_action_order_ok(act, EFX_TC_AO_VLAN_POP)) {
2398 act->vlan_pop++;
2407 if (!efx_tc_flower_action_order_ok(act, EFX_TC_AO_VLAN_PUSH)) {
2415 act->vlan_tci[act->vlan_push] = cpu_to_be16(tci);
2416 act->vlan_proto[act->vlan_push] = fa->vlan.proto;
2417 act->vlan_push++;
2420 rc = efx_tc_pedit_add(efx, act, fa, extack);
2425 rc = efx_tc_mangle(efx, act, fa, &mung, extack, &match);
2466 act->do_nat = 1;
2479 if (act) {
2485 efx_mae_mport_uplink(efx, &act->dest_mport);
2492 &act->dest_mport);
2493 act->deliver = 1;
2494 rc = efx_mae_alloc_action_set(efx, act);
2499 list_add_tail(&act->list, &rule->acts.list);
2500 act = NULL; /* Prevent double-free in error path */
2543 if (act)
2544 efx_tc_free_action_set(efx, act, false);
2674 struct efx_tc_action_set *act;
2679 act = kzalloc(sizeof(*act), GFP_KERNEL);
2680 if (!act)
2682 act->deliver = 1;
2683 act->dest_mport = eg_port;
2684 rc = efx_mae_alloc_action_set(efx, act);
2688 list_add_tail(&act->list, &acts->list);
2700 list_del(&act->list);
2701 efx_mae_free_action_set(efx, act->fw_id);
2703 kfree(act);
2749 struct efx_tc_action_set *act;
2752 act = kzalloc(sizeof(*act), GFP_KERNEL);
2753 if (!act)
2755 act->deliver = 1;
2756 act->dest_mport = eg_port;
2757 rc = efx_mae_alloc_action_set(efx, act);
2761 list_add_tail(&act->list, &acts->list);
2767 list_del(&act->list);
2768 efx_mae_free_action_set(efx, act->fw_id);
2770 kfree(act);