Lines Matching defs:action
3 * net/sched/act_api.c Packet action API.
70 int tcf_action_check_ctrlact(int action, struct tcf_proto *tp,
74 int opcode = TC_ACT_EXT_OPCODE(action), ret = -EINVAL;
78 ret = action > TC_ACT_VALUE_MAX ? -EINVAL : 0;
79 else if (opcode <= TC_ACT_EXT_OPCODE_MAX || action == TC_ACT_UNSPEC)
82 NL_SET_ERR_MSG(extack, "invalid control action");
86 if (TC_ACT_EXT_CMP(action, TC_ACT_GOTO_CHAIN)) {
87 chain_index = action & TC_ACT_EXT_VAL_MASK;
106 struct tcf_chain *tcf_action_set_ctrlact(struct tc_action *a, int action,
109 a->tcfa_action = action;
246 static int tcf_action_offload_add_ex(struct tc_action *action,
251 bool skip_sw = tc_act_skip_sw(action->tcfa_flags);
253 [0] = action,
259 if (tc_act_skip_hw(action->tcfa_flags))
262 num = tcf_offload_act_num_actions_single(action);
267 err = offload_action_init(fl_action, action, FLOW_ACT_REPLACE, extack);
271 err = tc_setup_action(&fl_action->action, actions, 0, extack);
280 cb ? offload_action_hw_count_inc(action, in_hw_count) :
281 offload_action_hw_count_set(action, in_hw_count);
283 if (skip_sw && !tc_act_in_hw(action))
286 tc_cleanup_offload_action(&fl_action->action);
294 /* offload the tc action after it is inserted */
295 static int tcf_action_offload_add(struct tc_action *action,
298 return tcf_action_offload_add_ex(action, extack, NULL, NULL);
301 int tcf_action_update_hw_stats(struct tc_action *action)
306 err = offload_action_init(&fl_act, action, FLOW_ACT_STATS, NULL);
313 tcf_action_stats_update(action, fl_act.stats.bytes,
319 action->used_hw_stats = fl_act.stats.used_hw_stats;
320 action->used_hw_stats_valid = true;
329 static int tcf_action_offload_del_ex(struct tc_action *action,
337 if (!tc_act_in_hw(action))
340 err = offload_action_init(&fl_act, action, FLOW_ACT_DESTROY, NULL);
348 if (!cb && action->in_hw_count != in_hw_count)
351 /* do not need to update hw state when deleting action */
353 offload_action_hw_count_dec(action, in_hw_count);
358 static int tcf_action_offload_del(struct tc_action *action)
360 return tcf_action_offload_del_ex(action, NULL, NULL);
398 * interface (classifiers always bind). Only case when action with
401 * action if it was created by classifier). So only case when bind count
402 * can be changed after initial check is when unbound action is
403 * destroyed by act API while classifier binds to action with same id
404 * concurrently. This result either creation of new action(same behavior
405 * as before), or reusing existing action if concurrent process
406 * increments reference count before action is deleted. Both scenarios
444 return nla_total_size(0) /* action number nested */
815 /* Check if action with specified index exists. If actions is found, increments
891 * then there is no way to walk through only all the action
892 * subsystem, so we keep tc action pernet ops id for
953 /* We have to register pernet ops before making the action ops visible,
1315 NL_SET_ERR_MSG(extack, "TC action kind must be specified");
1319 NL_SET_ERR_MSG(extack, "TC action name too long");
1324 NL_SET_ERR_MSG(extack, "TC action name too long");
1351 NL_SET_ERR_MSG(extack, "Failed to load TC action module");
1477 "Mismatch between action and filter offload flags");
1626 NL_SET_ERR_MSG(extack, "Failed to fill netlink attributes while adding TC action");
1652 NL_SET_ERR_MSG(extack, "Invalid TC action index value");
1660 NL_SET_ERR_MSG(extack, "Specified TC action kind not found");
1665 NL_SET_ERR_MSG(extack, "TC action with specified index not found");
1707 if (!ops) { /*some idjot trying to flush unknown action */
1708 NL_SET_ERR_MSG(extack, "Cannot flush unknown TC action");
1715 NL_SET_ERR_MSG(extack, "Failed to create TC action flush notification");
1743 NL_SET_ERR_MSG(extack, "Failed to send TC action flush notification");
1769 /* last reference, action was deleted concurrently */
1784 tcf_reoffload_del_notify(struct net *net, struct tc_action *action)
1786 size_t attr_size = tcf_action_fill_size(action);
1788 [0] = action,
1790 const struct tc_action_ops *ops = action->ops;
1804 ret = tcf_idr_release_unsafe(action);
1887 NL_SET_ERR_MSG(extack, "Failed to fill netlink TC action attributes");
1895 NL_SET_ERR_MSG(extack, "Failed to delete TC action");
1924 NL_SET_ERR_MSG(extack, "Invalid netlink attributes while flushing TC action");
1966 NL_SET_ERR_MSG(extack, "Failed to fill netlink attributes while adding TC action");
2029 NL_SET_ERR_MSG(extack, "Netlink action attributes missing");
2108 pr_info("tc_dump_action: action bad kind\n");