mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-04 01:57:59 +00:00
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 <avivh@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
8aaca1976e
commit
292612d68c
@ -161,7 +161,7 @@ static int mlx5_lag_dev_get_netdev_idx(struct mlx5_lag *ldev,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static bool mlx5_lag_is_bonded(struct mlx5_lag *ldev)
|
||||
static bool __mlx5_lag_is_active(struct mlx5_lag *ldev)
|
||||
{
|
||||
return !!(ldev->flags & MLX5_LAG_FLAG_BONDED);
|
||||
}
|
||||
@ -278,7 +278,7 @@ static void mlx5_do_bond(struct mlx5_lag *ldev)
|
||||
|
||||
do_bond = tracker.is_bonded && mlx5_lag_check_prereq(ldev);
|
||||
|
||||
if (do_bond && !mlx5_lag_is_bonded(ldev)) {
|
||||
if (do_bond && !__mlx5_lag_is_active(ldev)) {
|
||||
if (!sriov_enabled)
|
||||
for (i = 0; i < MLX5_MAX_PORTS; i++)
|
||||
mlx5_remove_dev_by_protocol(ldev->pf[i].dev,
|
||||
@ -290,9 +290,9 @@ static void mlx5_do_bond(struct mlx5_lag *ldev)
|
||||
mlx5_add_dev_by_protocol(dev0, MLX5_INTERFACE_PROTOCOL_IB);
|
||||
mlx5_nic_vport_enable_roce(dev1);
|
||||
}
|
||||
} else if (do_bond && mlx5_lag_is_bonded(ldev)) {
|
||||
} else if (do_bond && __mlx5_lag_is_active(ldev)) {
|
||||
mlx5_modify_lag(ldev, &tracker);
|
||||
} else if (!do_bond && mlx5_lag_is_bonded(ldev)) {
|
||||
} else if (!do_bond && __mlx5_lag_is_active(ldev)) {
|
||||
if (!sriov_enabled) {
|
||||
mlx5_remove_dev_by_protocol(dev0, MLX5_INTERFACE_PROTOCOL_IB);
|
||||
mlx5_nic_vport_disable_roce(dev1);
|
||||
@ -555,7 +555,7 @@ void mlx5_lag_remove(struct mlx5_core_dev *dev)
|
||||
if (!ldev)
|
||||
return;
|
||||
|
||||
if (mlx5_lag_is_bonded(ldev))
|
||||
if (__mlx5_lag_is_active(ldev))
|
||||
mlx5_deactivate_lag(ldev);
|
||||
|
||||
mlx5_lag_dev_remove_pf(ldev, dev);
|
||||
@ -579,7 +579,7 @@ bool mlx5_lag_is_active(struct mlx5_core_dev *dev)
|
||||
|
||||
mutex_lock(&lag_mutex);
|
||||
ldev = mlx5_lag_dev_get(dev);
|
||||
res = ldev && mlx5_lag_is_bonded(ldev);
|
||||
res = ldev && __mlx5_lag_is_active(ldev);
|
||||
mutex_unlock(&lag_mutex);
|
||||
|
||||
return res;
|
||||
@ -609,7 +609,7 @@ struct net_device *mlx5_lag_get_roce_netdev(struct mlx5_core_dev *dev)
|
||||
mutex_lock(&lag_mutex);
|
||||
ldev = mlx5_lag_dev_get(dev);
|
||||
|
||||
if (!(ldev && mlx5_lag_is_bonded(ldev)))
|
||||
if (!(ldev && __mlx5_lag_is_active(ldev)))
|
||||
goto unlock;
|
||||
|
||||
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)
|
||||
return true;
|
||||
|
||||
ldev = mlx5_lag_dev_get(dev);
|
||||
if (!ldev || !mlx5_lag_is_bonded(ldev) || ldev->pf[0].dev == dev)
|
||||
if (!ldev || !__mlx5_lag_is_active(ldev) || ldev->pf[0].dev == dev)
|
||||
return true;
|
||||
|
||||
/* 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,
|
||||
|
||||
mutex_lock(&lag_mutex);
|
||||
ldev = mlx5_lag_dev_get(dev);
|
||||
if (ldev && mlx5_lag_is_bonded(ldev)) {
|
||||
if (ldev && __mlx5_lag_is_active(ldev)) {
|
||||
num_ports = MLX5_MAX_PORTS;
|
||||
mdev[0] = ldev->pf[0].dev;
|
||||
mdev[1] = ldev->pf[1].dev;
|
||||
|
Loading…
x
Reference in New Issue
Block a user