From: Eli Cohen Date: Thu, 12 Mar 2020 15:20:32 +0000 (+0200) Subject: net/mlx5: Avoid forwarding to other eswitch uplink X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=87b51810f4ad99a833883f6f00795ee550f3a622;p=openwrt%2Fstaging%2Fblogic.git net/mlx5: Avoid forwarding to other eswitch uplink Do not allow forwarding of encapsulated traffic received from one eswtich's uplink to another eswtich's uplink. Signed-off-by: Eli Cohen Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c index 608d0e07c308..b45c3f46570b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c @@ -66,6 +66,9 @@ static int get_route_and_out_devs(struct mlx5e_priv *priv, mlx5e_is_uplink_rep(netdev_priv(*out_dev)))) return -EOPNOTSUPP; + if (mlx5e_eswitch_uplink_rep(priv->netdev) && *out_dev != priv->netdev) + return -EOPNOTSUPP; + return 0; }