Commit 8be9686d authored by Roi Dayan's avatar Roi Dayan Committed by Saeed Mahameed
Browse files

net/mlx5e: TC, Pass attr to tc_act can_offload()



In later commit we are going to instantiate multiple attr instances
for flow instead of single attr.
Make sure the parsing using correct attr and not flow->attr.

Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
Reviewed-by: default avatarOz Shlomo <ozsh@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 918ed7bf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@
static bool
tc_act_can_offload_accept(struct mlx5e_tc_act_parse_state *parse_state,
			  const struct flow_action_entry *act,
			  int act_index)
			  int act_index,
			  struct mlx5_flow_attr *attr)
{
	return true;
}
+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ struct mlx5e_tc_act_parse_state {
struct mlx5e_tc_act {
	bool (*can_offload)(struct mlx5e_tc_act_parse_state *parse_state,
			    const struct flow_action_entry *act,
			    int act_index);
			    int act_index,
			    struct mlx5_flow_attr *attr);

	int (*parse_action)(struct mlx5e_tc_act_parse_state *parse_state,
			    const struct flow_action_entry *act,
+3 −2
Original line number Diff line number Diff line
@@ -38,11 +38,12 @@ csum_offload_supported(struct mlx5e_priv *priv,
static bool
tc_act_can_offload_csum(struct mlx5e_tc_act_parse_state *parse_state,
			const struct flow_action_entry *act,
			int act_index)
			int act_index,
			struct mlx5_flow_attr *attr)
{
	struct mlx5e_tc_flow *flow = parse_state->flow;

	return csum_offload_supported(flow->priv, flow->attr->action,
	return csum_offload_supported(flow->priv, attr->action,
				      act->csum_flags, parse_state->extack);
}

+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@
static bool
tc_act_can_offload_ct(struct mlx5e_tc_act_parse_state *parse_state,
		      const struct flow_action_entry *act,
		      int act_index)
		      int act_index,
		      struct mlx5_flow_attr *attr)
{
	struct netlink_ext_ack *extack = parse_state->extack;

+2 −1
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@
static bool
tc_act_can_offload_drop(struct mlx5e_tc_act_parse_state *parse_state,
			const struct flow_action_entry *act,
			int act_index)
			int act_index,
			struct mlx5_flow_attr *attr)
{
	return true;
}
Loading