]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Lag, refactor lag state machine
authorEli Cohen <elic@nvidia.com>
Mon, 24 Jan 2022 09:30:46 +0000 (11:30 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 18 May 2022 06:41:50 +0000 (23:41 -0700)
commit22a172815ea14393588c27c3129684c0b533d16d
tree0e2c1c6fcd4753aafb887c549bb7cb86a1142346
parentffed6d7a020f7015305b6bb5cad42e964dc7b792
net/mlx5: Lag, refactor lag state machine

LAG state machine is implemented using bit flags. However, all these bit
flags, except for MLX5_LAG_FLAG_HASH_BASED, are really mutual exclusive.

In addition, MLX5_LAG_FLAG_READY is used by bonding to mark if we have
our netdevices successfully added to lag and does not really belong in
the same flags variable as the other flags.

Rename MLX5_LAG_FLAG_READY to MLX5_LAG_FLAG_NDEVS_READY to better
reflect its purpose and put it in a new flags variable.

For the rest of the flags, we introduce a mode enum to hold the state
of the LAG.

Remove the shared fdb boolean flag from struct mlx5_lag and store this
configuration as a mode flag.

Change all flag related operations to use standard Linux APIs.

Signed-off-by: Eli Cohen <elic@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/lag/debugfs.c
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h
drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c