Commit c2ccf84e authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller
Browse files

net/sched: act_api: Add extack to offload_act_setup() callback



The callback is used by various actions to populate the flow action
structure prior to offload. Pass extack to this callback so that the
various actions will be able to report accurate error messages to user
space.

Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 11c95317
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -134,7 +134,8 @@ struct tc_action_ops {
	(*get_psample_group)(const struct tc_action *a,
			     tc_action_priv_destructor *destructor);
	int     (*offload_act_setup)(struct tc_action *act, void *entry_data,
				     u32 *index_inc, bool bind);
				     u32 *index_inc, bool bind,
				     struct netlink_ext_ack *extack);
};

struct tc_action_net {
+4 −2
Original line number Diff line number Diff line
@@ -547,10 +547,12 @@ tcf_match_indev(struct sk_buff *skb, int ifindex)
}

int tc_setup_offload_action(struct flow_action *flow_action,
			    const struct tcf_exts *exts);
			    const struct tcf_exts *exts,
			    struct netlink_ext_ack *extack);
void tc_cleanup_offload_action(struct flow_action *flow_action);
int tc_setup_action(struct flow_action *flow_action,
		    struct tc_action *actions[]);
		    struct tc_action *actions[],
		    struct netlink_ext_ack *extack);

int tc_setup_cb_call(struct tcf_block *block, enum tc_setup_type type,
		     void *type_data, bool err_stop, bool rtnl_held);
+2 −2
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ static int offload_action_init(struct flow_offload_action *fl_action,
	if (act->ops->offload_act_setup) {
		spin_lock_bh(&act->tcfa_lock);
		err = act->ops->offload_act_setup(act, fl_action, NULL,
						  false);
						  false, extack);
		spin_unlock_bh(&act->tcfa_lock);
		return err;
	}
@@ -271,7 +271,7 @@ static int tcf_action_offload_add_ex(struct tc_action *action,
	if (err)
		goto fl_err;

	err = tc_setup_action(&fl_action->action, actions);
	err = tc_setup_action(&fl_action->action, actions, extack);
	if (err) {
		NL_SET_ERR_MSG_MOD(extack,
				   "Failed to setup tc actions for offload");
+2 −1
Original line number Diff line number Diff line
@@ -696,7 +696,8 @@ static size_t tcf_csum_get_fill_size(const struct tc_action *act)
}

static int tcf_csum_offload_act_setup(struct tc_action *act, void *entry_data,
				      u32 *index_inc, bool bind)
				      u32 *index_inc, bool bind,
				      struct netlink_ext_ack *extack)
{
	if (bind) {
		struct flow_action_entry *entry = entry_data;
+2 −1
Original line number Diff line number Diff line
@@ -1584,7 +1584,8 @@ static void tcf_stats_update(struct tc_action *a, u64 bytes, u64 packets,
}

static int tcf_ct_offload_act_setup(struct tc_action *act, void *entry_data,
				    u32 *index_inc, bool bind)
				    u32 *index_inc, bool bind,
				    struct netlink_ext_ack *extack)
{
	if (bind) {
		struct flow_action_entry *entry = entry_data;
Loading