Skip to content

Commit 292612d

Browse files
Aviv HellerSaeed Mahameed
authored andcommitted
net/mlx5: Rename mlx5_lag_is_bonded() to __mlx5_lag_is_active()
The new name better represents the function's aim, and sets a precedent for a '__' prefix for internal, non-locked versions of LAG APIs. Signed-off-by: Aviv Heller <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8aaca19 commit 292612d

File tree

1 file changed

+9
-9
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+9
-9
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lag.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static int mlx5_lag_dev_get_netdev_idx(struct mlx5_lag *ldev,
161161
return -1;
162162
}
163163

164-
static bool mlx5_lag_is_bonded(struct mlx5_lag *ldev)
164+
static bool __mlx5_lag_is_active(struct mlx5_lag *ldev)
165165
{
166166
return !!(ldev->flags & MLX5_LAG_FLAG_BONDED);
167167
}
@@ -278,7 +278,7 @@ static void mlx5_do_bond(struct mlx5_lag *ldev)
278278

279279
do_bond = tracker.is_bonded && mlx5_lag_check_prereq(ldev);
280280

281-
if (do_bond && !mlx5_lag_is_bonded(ldev)) {
281+
if (do_bond && !__mlx5_lag_is_active(ldev)) {
282282
if (!sriov_enabled)
283283
for (i = 0; i < MLX5_MAX_PORTS; i++)
284284
mlx5_remove_dev_by_protocol(ldev->pf[i].dev,
@@ -290,9 +290,9 @@ static void mlx5_do_bond(struct mlx5_lag *ldev)
290290
mlx5_add_dev_by_protocol(dev0, MLX5_INTERFACE_PROTOCOL_IB);
291291
mlx5_nic_vport_enable_roce(dev1);
292292
}
293-
} else if (do_bond && mlx5_lag_is_bonded(ldev)) {
293+
} else if (do_bond && __mlx5_lag_is_active(ldev)) {
294294
mlx5_modify_lag(ldev, &tracker);
295-
} else if (!do_bond && mlx5_lag_is_bonded(ldev)) {
295+
} else if (!do_bond && __mlx5_lag_is_active(ldev)) {
296296
if (!sriov_enabled) {
297297
mlx5_remove_dev_by_protocol(dev0, MLX5_INTERFACE_PROTOCOL_IB);
298298
mlx5_nic_vport_disable_roce(dev1);
@@ -555,7 +555,7 @@ void mlx5_lag_remove(struct mlx5_core_dev *dev)
555555
if (!ldev)
556556
return;
557557

558-
if (mlx5_lag_is_bonded(ldev))
558+
if (__mlx5_lag_is_active(ldev))
559559
mlx5_deactivate_lag(ldev);
560560

561561
mlx5_lag_dev_remove_pf(ldev, dev);
@@ -579,7 +579,7 @@ bool mlx5_lag_is_active(struct mlx5_core_dev *dev)
579579

580580
mutex_lock(&lag_mutex);
581581
ldev = mlx5_lag_dev_get(dev);
582-
res = ldev && mlx5_lag_is_bonded(ldev);
582+
res = ldev && __mlx5_lag_is_active(ldev);
583583
mutex_unlock(&lag_mutex);
584584

585585
return res;
@@ -609,7 +609,7 @@ struct net_device *mlx5_lag_get_roce_netdev(struct mlx5_core_dev *dev)
609609
mutex_lock(&lag_mutex);
610610
ldev = mlx5_lag_dev_get(dev);
611611

612-
if (!(ldev && mlx5_lag_is_bonded(ldev)))
612+
if (!(ldev && __mlx5_lag_is_active(ldev)))
613613
goto unlock;
614614

615615
if (ldev->tracker.tx_type == NETDEV_LAG_TX_TYPE_ACTIVEBACKUP) {
@@ -638,7 +638,7 @@ bool mlx5_lag_intf_add(struct mlx5_interface *intf, struct mlx5_priv *priv)
638638
return true;
639639

640640
ldev = mlx5_lag_dev_get(dev);
641-
if (!ldev || !mlx5_lag_is_bonded(ldev) || ldev->pf[0].dev == dev)
641+
if (!ldev || !__mlx5_lag_is_active(ldev) || ldev->pf[0].dev == dev)
642642
return true;
643643

644644
/* If bonded, we do not add an IB device for PF1. */
@@ -665,7 +665,7 @@ int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev,
665665

666666
mutex_lock(&lag_mutex);
667667
ldev = mlx5_lag_dev_get(dev);
668-
if (ldev && mlx5_lag_is_bonded(ldev)) {
668+
if (ldev && __mlx5_lag_is_active(ldev)) {
669669
num_ports = MLX5_MAX_PORTS;
670670
mdev[0] = ldev->pf[0].dev;
671671
mdev[1] = ldev->pf[1].dev;

0 commit comments

Comments
 (0)