aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/ib_rep.h
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2018-01-16 15:02:36 +0000
committerSaeed Mahameed <saeedm@mellanox.com>2018-02-23 12:36:39 -0800
commitbcf87f1dbbec0d9abaf89073dd761a41876bc6c1 (patch)
tree104eb13580ced40e47e50277e4ed368804054794 /drivers/infiniband/hw/mlx5/ib_rep.h
parentIB/mlx5: Add match on vport when in switchdev mode (diff)
downloadlinux-dev-bcf87f1dbbec0d9abaf89073dd761a41876bc6c1.tar.xz
linux-dev-bcf87f1dbbec0d9abaf89073dd761a41876bc6c1.zip
IB/mlx5: Listen to netdev register/unresiter events in switchdev mode
Currently we listen to netdev register/unregister event based on PCI device. When in switchdev mode PF and representors share the same PCI device, so in order to pair ib device and netdev in switchdev mode compare the netdev that triggered the event to that of the representor. Expose a function that lets you receive the netdev associated what a given representor. Signed-off-by: Mark Bloch <markb@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/ib_rep.h')
-rw-r--r--drivers/infiniband/hw/mlx5/ib_rep.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/ib_rep.h b/drivers/infiniband/hw/mlx5/ib_rep.h
index 64ab54b82820..923ad4cba941 100644
--- a/drivers/infiniband/hw/mlx5/ib_rep.h
+++ b/drivers/infiniband/hw/mlx5/ib_rep.h
@@ -17,6 +17,8 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw,
int vport_index);
void mlx5_ib_register_vport_reps(struct mlx5_ib_dev *dev);
void mlx5_ib_unregister_vport_reps(struct mlx5_ib_dev *dev);
+struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw,
+ int vport_index);
#else /* CONFIG_MLX5_ESWITCH */
static inline u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw)
{
@@ -39,6 +41,12 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw,
static inline void mlx5_ib_register_vport_reps(struct mlx5_ib_dev *dev) {}
static inline void mlx5_ib_unregister_vport_reps(struct mlx5_ib_dev *dev) {}
+static inline
+struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw,
+ int vport_index)
+{
+ return NULL;
+}
#endif
static inline