diff options
author | Eli Cohen <elic@nvidia.com> | 2020-11-09 11:35:52 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2020-11-17 11:50:53 -0800 |
commit | 5b8631c7b21ca8bc039f0bc030048973b039e0d2 (patch) | |
tree | 0abf2462259bd9fbb7c73897bc595a9ea691df7e | |
parent | 470b74758260e4abc2508cf1614573c00a00465c (diff) | |
download | linux-stable-5b8631c7b21ca8bc039f0bc030048973b039e0d2.tar.gz linux-stable-5b8631c7b21ca8bc039f0bc030048973b039e0d2.tar.bz2 linux-stable-5b8631c7b21ca8bc039f0bc030048973b039e0d2.zip |
net/mlx5: E-Switch, Fail mlx5_esw_modify_vport_rate if qos disabled
Avoid calling mlx5_esw_modify_vport_rate() if qos is not enabled and
avoid unnecessary syndrome messages from firmware.
Fixes: fcb64c0f5640 ("net/mlx5: E-Switch, add ingress rate support")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 5ad2308a2a6b..d4ee0a9c03db 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1142,6 +1142,10 @@ int mlx5_esw_modify_vport_rate(struct mlx5_eswitch *esw, u16 vport_num, struct mlx5_vport *vport; vport = mlx5_eswitch_get_vport(esw, vport_num); + + if (!vport->qos.enabled) + return -EOPNOTSUPP; + MLX5_SET(scheduling_context, ctx, max_average_bw, rate_mbps); return mlx5_modify_scheduling_element_cmd(esw->dev, |