Skip to content

Commit

Permalink
net/mlx5: Remove pointless devlink_rate checks
Browse files Browse the repository at this point in the history
It is guaranteed that the devlink rate leaf is created during init paths.
No need to check during cleanup. Remove the checks.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Jiri Pirko authored and Saeed Mahameed committed Jul 27, 2023
1 parent 550449d commit 3e82a9c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ void mlx5_esw_offloads_devlink_port_unregister(struct mlx5_eswitch *esw, u16 vpo
if (IS_ERR(vport))
return;

if (vport->dl_port->devlink_rate) {
mlx5_esw_qos_vport_update_group(esw, vport, NULL, NULL);
devl_rate_leaf_destroy(vport->dl_port);
}
mlx5_esw_qos_vport_update_group(esw, vport, NULL, NULL);
devl_rate_leaf_destroy(vport->dl_port);

devl_port_unregister(vport->dl_port);
mlx5_esw_dl_port_free(vport->dl_port);
Expand Down Expand Up @@ -211,10 +209,8 @@ void mlx5_esw_devlink_sf_port_unregister(struct mlx5_eswitch *esw, u16 vport_num
if (IS_ERR(vport))
return;

if (vport->dl_port->devlink_rate) {
mlx5_esw_qos_vport_update_group(esw, vport, NULL, NULL);
devl_rate_leaf_destroy(vport->dl_port);
}
mlx5_esw_qos_vport_update_group(esw, vport, NULL, NULL);
devl_rate_leaf_destroy(vport->dl_port);

devl_port_unregister(vport->dl_port);
vport->dl_port = NULL;
Expand Down

0 comments on commit 3e82a9c

Please sign in to comment.