提交 9278287e 编写于 作者: M Mark Bloch 提交者: Saeed Mahameed

net/mlx5: Lag, use local variable already defined to access E-Switch

Use the local variable for dev0 (and add from dev1) instead of using
the devices stored in the ldev structure. Makes the code easier
to read.
Signed-off-by: NMark Bloch <mbloch@nvidia.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
上级 1749c4c5
...@@ -347,6 +347,7 @@ int mlx5_activate_lag(struct mlx5_lag *ldev, ...@@ -347,6 +347,7 @@ int mlx5_activate_lag(struct mlx5_lag *ldev,
static int mlx5_deactivate_lag(struct mlx5_lag *ldev) static int mlx5_deactivate_lag(struct mlx5_lag *ldev)
{ {
struct mlx5_core_dev *dev0 = ldev->pf[MLX5_LAG_P1].dev; struct mlx5_core_dev *dev0 = ldev->pf[MLX5_LAG_P1].dev;
struct mlx5_core_dev *dev1 = ldev->pf[MLX5_LAG_P2].dev;
u32 in[MLX5_ST_SZ_DW(destroy_lag_in)] = {}; u32 in[MLX5_ST_SZ_DW(destroy_lag_in)] = {};
bool roce_lag = __mlx5_lag_is_roce(ldev); bool roce_lag = __mlx5_lag_is_roce(ldev);
u8 flags = ldev->flags; u8 flags = ldev->flags;
...@@ -356,8 +357,8 @@ static int mlx5_deactivate_lag(struct mlx5_lag *ldev) ...@@ -356,8 +357,8 @@ static int mlx5_deactivate_lag(struct mlx5_lag *ldev)
mlx5_lag_mp_reset(ldev); mlx5_lag_mp_reset(ldev);
if (ldev->shared_fdb) { if (ldev->shared_fdb) {
mlx5_eswitch_offloads_destroy_single_fdb(ldev->pf[MLX5_LAG_P1].dev->priv.eswitch, mlx5_eswitch_offloads_destroy_single_fdb(dev0->priv.eswitch,
ldev->pf[MLX5_LAG_P2].dev->priv.eswitch); dev1->priv.eswitch);
ldev->shared_fdb = false; ldev->shared_fdb = false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册