1 From foo@baz Sun Feb 10 12:42:47 CET 2019
2 From: Guy Shattah <sguy@mellanox.com>
3 Date: Mon, 28 Jan 2019 13:58:07 +0000
4 Subject: net/mlx5e: Use the inner headers to determine tc/pedit offload limitation on decap flows
6 From: Guy Shattah <sguy@mellanox.com>
8 [ Upstream commit 1651925d403e077e3fc86f961905e27c6810e132 ]
10 In packets that need to be decaped the internal headers
11 have to be checked, not the external ones.
13 Fixes: bdd66ac0aeed ("net/mlx5e: Disallow TC offloading of unsupported match/action combinations")
14 Signed-off-by: Guy Shattah <sguy@mellanox.com>
15 Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
16 Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 +++++++--
20 1 file changed, 7 insertions(+), 2 deletions(-)
22 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
23 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
24 @@ -2133,6 +2133,7 @@ static bool csum_offload_supported(struc
26 static bool modify_header_match_supported(struct mlx5_flow_spec *spec,
27 struct tcf_exts *exts,
29 struct netlink_ext_ack *extack)
31 const struct tc_action *a;
32 @@ -2143,7 +2144,11 @@ static bool modify_header_match_supporte
36 - headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, outer_headers);
37 + if (match_actions & MLX5_FLOW_CONTEXT_ACTION_DECAP)
38 + headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, inner_headers);
40 + headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, outer_headers);
42 ethertype = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ethertype);
44 /* for non-IP we only re-write MACs, so we're okay */
45 @@ -2200,7 +2205,7 @@ static bool actions_match_supported(stru
47 if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR)
48 return modify_header_match_supported(&parse_attr->spec, exts,