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