Commit 2afcfae7 authored by Roi Dayan's avatar Roi Dayan Committed by Saeed Mahameed

net/mlx5: Lag, Update multiport eswitch check to log an error

Update the function to log an error to the user if failing to offload
the rule and while there add correct prefix for the function name.
Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
Reviewed-by: default avatarMaor Dickman <maord@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 042b7858
......@@ -232,9 +232,9 @@ parse_mirred(struct mlx5e_tc_act_parse_state *parse_state,
parse_state->ifindexes[if_count] = out_dev->ifindex;
parse_state->if_count++;
is_uplink_rep = mlx5e_eswitch_uplink_rep(out_dev);
err = mlx5_lag_do_mirred(priv->mdev, out_dev);
if (err)
return err;
if (mlx5_lag_mpesw_do_mirred(priv->mdev, out_dev, extack))
return -EOPNOTSUPP;
out_dev = get_fdb_out_dev(uplink_dev, out_dev);
if (!out_dev)
......
......@@ -96,17 +96,20 @@ int mlx5_lag_add_mpesw_rule(struct mlx5_core_dev *dev)
return mlx5_lag_mpesw_queue_work(dev, MLX5_MPESW_OP_ENABLE);
}
int mlx5_lag_do_mirred(struct mlx5_core_dev *mdev, struct net_device *out_dev)
int mlx5_lag_mpesw_do_mirred(struct mlx5_core_dev *mdev,
struct net_device *out_dev,
struct netlink_ext_ack *extack)
{
struct mlx5_lag *ldev = mdev->priv.lag;
if (!netif_is_bond_master(out_dev) || !ldev)
return 0;
if (ldev->mode == MLX5_LAG_MODE_MPESW)
return -EOPNOTSUPP;
if (ldev->mode != MLX5_LAG_MODE_MPESW)
return 0;
return 0;
NL_SET_ERR_MSG_MOD(extack, "can't forward to bond in mpesw mode");
return -EOPNOTSUPP;
}
bool mlx5_lag_mpesw_is_activated(struct mlx5_core_dev *dev)
......
......@@ -12,7 +12,9 @@ struct lag_mpesw {
atomic_t mpesw_rule_count;
};
int mlx5_lag_do_mirred(struct mlx5_core_dev *mdev, struct net_device *out_dev);
int mlx5_lag_mpesw_do_mirred(struct mlx5_core_dev *mdev,
struct net_device *out_dev,
struct netlink_ext_ack *extack);
bool mlx5_lag_mpesw_is_activated(struct mlx5_core_dev *dev);
#if IS_ENABLED(CONFIG_MLX5_ESWITCH)
void mlx5_lag_mpesw_init(struct mlx5_lag *ldev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment