net/mlx5e: Use a simpler comparison for uplink rep
authorRoi Dayan <roid@nvidia.com>
Mon, 6 Feb 2023 12:40:24 +0000 (14:40 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 14 Feb 2023 22:08:25 +0000 (14:08 -0800)
get_route_and_out_devs()  is uses the following condition
mlx5e_eswitch_rep() && mlx5e_is_uplink_rep() to check if a given netdev is the
uplink rep.

Alternatively we can just use the straight forward version
mlx5e_eswitch_uplink_rep() that only checks if a given netdev is uplink rep.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c

index 684c0293a4d678540ae41247b6f2ad951580052c..00a04fdd756f570f8a9db368eb1685f9d5df9a8e 100644 (file)
@@ -93,8 +93,7 @@ static int get_route_and_out_devs(struct mlx5e_priv *priv,
        else
                return -EOPNOTSUPP;
 
-       if (!(mlx5e_eswitch_rep(*out_dev) &&
-             mlx5e_is_uplink_rep(netdev_priv(*out_dev))))
+       if (!mlx5e_eswitch_uplink_rep(*out_dev))
                return -EOPNOTSUPP;
 
        if (mlx5e_eswitch_uplink_rep(priv->netdev) && *out_dev != priv->netdev &&