Skip to content

Commit 0fd23db

Browse files
shayshyiSaeed Mahameed
authored andcommitted
net/mlx5: Fix mlx5_cmd_update_root_ft() error flow
The cited patch change mlx5_cmd_update_root_ft() to work with multiple peer devices. However, it didn't align the error flow as well. Hence, Fix the error code to work with multiple peer devices. Fixes: 222dd18 ("{net/RDMA}/mlx5: introduce lag_for_each_peer") Signed-off-by: Shay Drory <shayd@nvidia.com> Reviewed-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent 34a7987 commit 0fd23db

File tree

1 file changed

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

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,20 @@ static int mlx5_cmd_update_root_ft(struct mlx5_flow_root_namespace *ns,
245245
mlx5_lag_is_shared_fdb(dev) &&
246246
mlx5_lag_is_master(dev)) {
247247
struct mlx5_core_dev *peer_dev;
248-
int i;
248+
int i, j;
249249

250250
mlx5_lag_for_each_peer_mdev(dev, peer_dev, i) {
251251
err = mlx5_cmd_set_slave_root_fdb(dev, peer_dev, !disconnect,
252252
(!disconnect) ? ft->id : 0);
253253
if (err && !disconnect) {
254+
mlx5_lag_for_each_peer_mdev(dev, peer_dev, j) {
255+
if (j < i)
256+
mlx5_cmd_set_slave_root_fdb(dev, peer_dev, 1,
257+
ns->root_ft->id);
258+
else
259+
break;
260+
}
261+
254262
MLX5_SET(set_flow_table_root_in, in, op_mod, 0);
255263
MLX5_SET(set_flow_table_root_in, in, table_id,
256264
ns->root_ft->id);

0 commit comments

Comments
 (0)