]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: Simplify condition on esw_vport_enable_qos()
authorEli Cohen <elic@nvidia.com>
Tue, 12 Jan 2021 07:05:25 +0000 (23:05 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 Jan 2021 23:45:51 +0000 (15:45 -0800)
esw->qos.enabled will only be true if both MLX5_CAP_GEN(dev, qos) and
MLX5_CAP_QOS(dev, esw_scheduling) are true. Therefore, remove them from
the condition in and rely only on esw->qos.enabled.

Signed-off-by: Eli Cohen <elic@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

index da901e3646564bb9420fe9f85323f53b1aed0493..876e6449edb33bc8207fa1658d076ce88f35e751 100644 (file)
@@ -1042,8 +1042,7 @@ static int esw_vport_enable_qos(struct mlx5_eswitch *esw,
        void *vport_elem;
        int err = 0;
 
-       if (!esw->qos.enabled || !MLX5_CAP_GEN(dev, qos) ||
-           !MLX5_CAP_QOS(dev, esw_scheduling))
+       if (!esw->qos.enabled)
                return 0;
 
        if (vport->qos.enabled)