Skip to content

Commit

Permalink
net/mlx5e: Lag, Only handle events from highest priority multipath entry
Browse files Browse the repository at this point in the history
There could be multiple multipath entries but changing the port affinity
for each one doesn't make much sense and there should be a default one.
So only track the entry with lowest priority value.
The commit doesn't affect existing users with a single entry.

Fixes: 544fe7c ("net/mlx5e: Activate HW multipath and handle port affinity based on FIB events")
Signed-off-by: Roi Dayan <[email protected]>
Reviewed-by: Maor Dickman <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
  • Loading branch information
roidayan authored and Saeed Mahameed committed Mar 9, 2022
1 parent 39bab83 commit ad11c4f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev,
return;
}

/* Handle multipath entry with lower priority value */
if (mp->mfi && mp->mfi != fi && fi->fib_priority >= mp->mfi->fib_priority)
return;

/* Handle add/replace event */
nhs = fib_info_num_path(fi);
if (nhs == 1) {
Expand All @@ -135,12 +139,13 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev,
int i = mlx5_lag_dev_get_netdev_idx(ldev, nh_dev);

if (i < 0)
i = MLX5_LAG_NORMAL_AFFINITY;
else
++i;
return;

i++;
mlx5_lag_set_port_affinity(ldev, i);
}

mp->mfi = fi;
return;
}

Expand Down

0 comments on commit ad11c4f

Please sign in to comment.