]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/net-mlx5e-protect-against-non-uplink-representor-for-encap.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.0 / net-mlx5e-protect-against-non-uplink-representor-for-encap.patch
1 From foo@baz Sat Apr 20 16:43:09 CEST 2019
2 From: Dmytro Linkin <dmitrolin@mellanox.com>
3 Date: Fri, 29 Mar 2019 12:50:37 +0000
4 Subject: net/mlx5e: Protect against non-uplink representor for encap
5
6 From: Dmytro Linkin <dmitrolin@mellanox.com>
7
8 [ Upstream commit 5e0060b1491b299b1706414e61ede0b02265680e ]
9
10 TC encap offload is supported only for the physical uplink
11 representor. Fail for non uplink representor.
12
13 Fixes: 3e621b19b0bb ("net/mlx5e: Support TC encapsulation offloads with upper devices")
14 Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
15 Reviewed-by: Eli Britstein <elibr@mellanox.com>
16 Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
17 Reviewed-by: Roi Dayan <roid@mellanox.com>
18 Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 4 ++++
22 1 file changed, 4 insertions(+)
23
24 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
25 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
26 @@ -39,6 +39,10 @@ static int get_route_and_out_devs(struct
27 return -EOPNOTSUPP;
28 }
29
30 + if (!(mlx5e_eswitch_rep(*out_dev) &&
31 + mlx5e_is_uplink_rep(netdev_priv(*out_dev))))
32 + return -EOPNOTSUPP;
33 +
34 return 0;
35 }
36