]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
7d29d0ddfeb8e80ab1e0d9d4aab62f14ba899217
[thirdparty/kernel/stable-queue.git] /
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
5
6 From: Guy Shattah <sguy@mellanox.com>
7
8 [ Upstream commit 1651925d403e077e3fc86f961905e27c6810e132 ]
9
10 In packets that need to be decaped the internal headers
11 have to be checked, not the external ones.
12
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>
18 ---
19 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 +++++++--
20 1 file changed, 7 insertions(+), 2 deletions(-)
21
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
25
26 static bool modify_header_match_supported(struct mlx5_flow_spec *spec,
27 struct tcf_exts *exts,
28 + u32 match_actions,
29 struct netlink_ext_ack *extack)
30 {
31 const struct tc_action *a;
32 @@ -2143,7 +2144,11 @@ static bool modify_header_match_supporte
33 u16 ethertype;
34 int nkeys, i;
35
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);
39 + else
40 + headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, outer_headers);
41 +
42 ethertype = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ethertype);
43
44 /* for non-IP we only re-write MACs, so we're okay */
45 @@ -2200,7 +2205,7 @@ static bool actions_match_supported(stru
46
47 if (actions & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR)
48 return modify_header_match_supported(&parse_attr->spec, exts,
49 - extack);
50 + actions, extack);
51
52 return true;
53 }