Commit 8d93efb8 authored by Mark Bloch's avatar Mark Bloch Committed by Jason Gunthorpe

RDMA/mlx5: Assign profile before calling stages

Assign the profile to the IB device before executing stages. This will
allow to check which profile is being used from within a stage.

Link: https://lore.kernel.org/r/20200506071602.7177-2-leon@kernel.orgSigned-off-by: default avatarMark Bloch <markb@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 029e88fd
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#include <linux/mlx5/eswitch.h> #include <linux/mlx5/eswitch.h>
#include "mlx5_ib.h" #include "mlx5_ib.h"
#ifdef CONFIG_MLX5_ESWITCH
extern const struct mlx5_ib_profile raw_eth_profile; extern const struct mlx5_ib_profile raw_eth_profile;
#ifdef CONFIG_MLX5_ESWITCH
u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw); u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw);
struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw,
u16 vport_num); u16 vport_num);
......
...@@ -7160,6 +7160,8 @@ void *__mlx5_ib_add(struct mlx5_ib_dev *dev, ...@@ -7160,6 +7160,8 @@ void *__mlx5_ib_add(struct mlx5_ib_dev *dev,
int err; int err;
int i; int i;
dev->profile = profile;
for (i = 0; i < MLX5_IB_STAGE_MAX; i++) { for (i = 0; i < MLX5_IB_STAGE_MAX; i++) {
if (profile->stage[i].init) { if (profile->stage[i].init) {
err = profile->stage[i].init(dev); err = profile->stage[i].init(dev);
...@@ -7168,7 +7170,6 @@ void *__mlx5_ib_add(struct mlx5_ib_dev *dev, ...@@ -7168,7 +7170,6 @@ void *__mlx5_ib_add(struct mlx5_ib_dev *dev,
} }
} }
dev->profile = profile;
dev->ib_active = true; dev->ib_active = true;
return dev; return dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment