Commit 1651925d authored by Guy Shattah's avatar Guy Shattah Committed by Saeed Mahameed

net/mlx5e: Use the inner headers to determine tc/pedit offload limitation on decap flows

In packets that need to be decaped the internal headers
have to be checked, not the external ones.

Fixes: bdd66ac0 ("net/mlx5e: Disallow TC offloading of unsupported match/action combinations")
Signed-off-by: default avatarGuy Shattah <sguy@mellanox.com>
Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 6363651d
...@@ -2181,6 +2181,7 @@ static bool csum_offload_supported(struct mlx5e_priv *priv, ...@@ -2181,6 +2181,7 @@ static bool csum_offload_supported(struct mlx5e_priv *priv,
static bool modify_header_match_supported(struct mlx5_flow_spec *spec, static bool modify_header_match_supported(struct mlx5_flow_spec *spec,
struct tcf_exts *exts, struct tcf_exts *exts,
u32 actions,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
const struct tc_action *a; const struct tc_action *a;
...@@ -2190,7 +2191,11 @@ static bool modify_header_match_supported(struct mlx5_flow_spec *spec, ...@@ -2190,7 +2191,11 @@ static bool modify_header_match_supported(struct mlx5_flow_spec *spec,
u16 ethertype; u16 ethertype;
int nkeys, i; int nkeys, i;
headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, outer_headers); if (actions & MLX5_FLOW_CONTEXT_ACTION_DECAP)
headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, inner_headers);
else
headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, outer_headers);
ethertype = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ethertype); ethertype = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ethertype);
/* for non-IP we only re-write MACs, so we're okay */ /* for non-IP we only re-write MACs, so we're okay */
...@@ -2247,7 +2252,7 @@ static bool actions_match_supported(struct mlx5e_priv *priv, ...@@ -2247,7 +2252,7 @@ static bool actions_match_supported(struct mlx5e_priv *priv,
if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR)
return modify_header_match_supported(&parse_attr->spec, exts, return modify_header_match_supported(&parse_attr->spec, exts,
extack); actions, extack);
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment