From: Roi Dayan Date: Thu, 13 Dec 2018 03:11:39 +0000 (-0800) Subject: net/mlx5: Split the activate lag function into two routines X-Git-Tag: v5.4-rc1~1939^2~21^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8252cf728ce230bab2f5898449ffe94ff02c3622;p=platform%2Fkernel%2Flinux-rpi.git net/mlx5: Split the activate lag function into two routines Split the activate lag function in order to be symmetric with the deactivate lag function. Signed-off-by: Roi Dayan Signed-off-by: Shahar Klein Reviewed-by: Aviv Heller Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag.c index 582b2f1..75f7c8e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag.c @@ -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]); @@ -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)