Skip to content

Commit

Permalink
net/mlx5e: Protect against non-uplink representor for encap
Browse files Browse the repository at this point in the history
TC encap offload is supported only for the physical uplink
representor. Fail for non uplink representor.

Fixes: 3e621b1 ("net/mlx5e: Support TC encapsulation offloads with upper devices")
Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
Reviewed-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Dmytro Linkin authored and Saeed Mahameed committed Apr 9, 2019
1 parent 0318a7b commit 5e0060b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ static int get_route_and_out_devs(struct mlx5e_priv *priv,
return -EOPNOTSUPP;
}

if (!(mlx5e_eswitch_rep(*out_dev) &&
mlx5e_is_uplink_rep(netdev_priv(*out_dev))))
return -EOPNOTSUPP;

return 0;
}

Expand Down

0 comments on commit 5e0060b

Please sign in to comment.