Skip to content

Commit 909ffe4

Browse files
Chris Mikuba-moo
authored andcommitted
net/mlx5: E-switch, Don't update group if qos is not enabled
Currently, qos group will be updated and qos will be enabled when unregistering devlink port. Actually no need to update group if qos is not enabled. Add a check to prevent unnecessary enabling and disabling qos for every port. Signed-off-by: Chris Mi <[email protected]> Reviewed-by: Dmytro Linkin <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8c9cc1e commit 909ffe4

File tree

1 file changed

+5
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/esw

1 file changed

+5
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,12 +924,16 @@ int mlx5_esw_qos_vport_update_group(struct mlx5_eswitch *esw,
924924
struct mlx5_esw_rate_group *group,
925925
struct netlink_ext_ack *extack)
926926
{
927-
int err;
927+
int err = 0;
928928

929929
mutex_lock(&esw->state_lock);
930+
if (!vport->qos.enabled && !group)
931+
goto unlock;
932+
930933
err = esw_qos_vport_enable(esw, vport, 0, 0, extack);
931934
if (!err)
932935
err = esw_qos_vport_update_group(esw, vport, group, extack);
936+
unlock:
933937
mutex_unlock(&esw->state_lock);
934938
return err;
935939
}

0 commit comments

Comments
 (0)