Commit 658cfceb authored by Mark Bloch's avatar Mark Bloch Committed by Saeed Mahameed

RDMA/mlx5: Use representor E-Switch when getting netdev and metadata

Now that a pointer to the managing E-Switch is stored in the representor
use it.
Signed-off-by: default avatarMark Bloch <mbloch@nvidia.com>
Reviewed-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Acked-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 59c904c8
...@@ -879,7 +879,7 @@ static void mlx5_ib_set_rule_source_port(struct mlx5_ib_dev *dev, ...@@ -879,7 +879,7 @@ static void mlx5_ib_set_rule_source_port(struct mlx5_ib_dev *dev,
misc_parameters_2); misc_parameters_2);
MLX5_SET(fte_match_set_misc2, misc, metadata_reg_c_0, MLX5_SET(fte_match_set_misc2, misc, metadata_reg_c_0,
mlx5_eswitch_get_vport_metadata_for_match(esw, mlx5_eswitch_get_vport_metadata_for_match(rep->esw,
rep->vport)); rep->vport));
misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria,
misc_parameters_2); misc_parameters_2);
......
...@@ -20,7 +20,7 @@ mlx5_ib_set_vport_rep(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) ...@@ -20,7 +20,7 @@ mlx5_ib_set_vport_rep(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
rep->rep_data[REP_IB].priv = ibdev; rep->rep_data[REP_IB].priv = ibdev;
write_lock(&ibdev->port[vport_index].roce.netdev_lock); write_lock(&ibdev->port[vport_index].roce.netdev_lock);
ibdev->port[vport_index].roce.netdev = ibdev->port[vport_index].roce.netdev =
mlx5_ib_get_rep_netdev(dev->priv.eswitch, rep->vport); mlx5_ib_get_rep_netdev(rep->esw, rep->vport);
write_unlock(&ibdev->port[vport_index].roce.netdev_lock); write_unlock(&ibdev->port[vport_index].roce.netdev_lock);
return 0; return 0;
......
...@@ -126,7 +126,6 @@ static struct mlx5_roce *mlx5_get_rep_roce(struct mlx5_ib_dev *dev, ...@@ -126,7 +126,6 @@ static struct mlx5_roce *mlx5_get_rep_roce(struct mlx5_ib_dev *dev,
struct net_device *ndev, struct net_device *ndev,
u8 *port_num) u8 *port_num)
{ {
struct mlx5_eswitch *esw = dev->mdev->priv.eswitch;
struct net_device *rep_ndev; struct net_device *rep_ndev;
struct mlx5_ib_port *port; struct mlx5_ib_port *port;
int i; int i;
...@@ -137,7 +136,7 @@ static struct mlx5_roce *mlx5_get_rep_roce(struct mlx5_ib_dev *dev, ...@@ -137,7 +136,7 @@ static struct mlx5_roce *mlx5_get_rep_roce(struct mlx5_ib_dev *dev,
continue; continue;
read_lock(&port->roce.netdev_lock); read_lock(&port->roce.netdev_lock);
rep_ndev = mlx5_ib_get_rep_netdev(esw, rep_ndev = mlx5_ib_get_rep_netdev(port->rep->esw,
port->rep->vport); port->rep->vport);
if (rep_ndev == ndev) { if (rep_ndev == ndev) {
read_unlock(&port->roce.netdev_lock); read_unlock(&port->roce.netdev_lock);
......
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