Skip to content

Commit

Permalink
net/mlx5: Split the activate lag function into two routines
Browse files Browse the repository at this point in the history
Split the activate lag function in order to be symmetric with
the deactivate lag function.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Shahar Klein <shahark@mellanox.com>
Reviewed-by: Aviv Heller <avivh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Roi Dayan authored and Saeed Mahameed committed Dec 14, 2018
1 parent 8bb957d commit 8252cf7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/net/ethernet/mellanox/mlx5/core/lag.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,12 @@ static void mlx5_infer_tx_affinity_mapping(struct lag_tracker *tracker,
*port2 = 1;
}

static void mlx5_activate_lag(struct mlx5_lag *ldev,
struct lag_tracker *tracker)
static int mlx5_create_lag(struct mlx5_lag *ldev,
struct lag_tracker *tracker)
{
struct mlx5_core_dev *dev0 = ldev->pf[0].dev;
int err;

ldev->flags |= MLX5_LAG_FLAG_BONDED;

mlx5_infer_tx_affinity_mapping(tracker, &ldev->v2p_map[0],
&ldev->v2p_map[1]);

Expand All @@ -202,6 +200,14 @@ static void mlx5_activate_lag(struct mlx5_lag *ldev,
mlx5_core_err(dev0,
"Failed to create LAG (%d)\n",
err);
return err;
}

static void mlx5_activate_lag(struct mlx5_lag *ldev,
struct lag_tracker *tracker)
{
ldev->flags |= MLX5_LAG_FLAG_BONDED;
mlx5_create_lag(ldev, tracker);
}

static void mlx5_deactivate_lag(struct mlx5_lag *ldev)
Expand Down

0 comments on commit 8252cf7

Please sign in to comment.