diff options
| author | Mark Bloch <mbloch@nvidia.com> | 2021-08-03 16:19:46 -0700 |
|---|---|---|
| committer | Saeed Mahameed <saeedm@nvidia.com> | 2021-08-05 13:49:23 -0700 |
| commit | 97a8a8c1f985baf13a3d0d252b787850330d2ea7 (patch) | |
| tree | 53a137bb8922a2be1f7445794ae5da065cfcd0da /include/linux/mlx5 | |
| parent | 616d5769345528b989294a242a5906b157a92837 (diff) | |
| download | cachepc-linux-97a8a8c1f985baf13a3d0d252b787850330d2ea7.tar.gz cachepc-linux-97a8a8c1f985baf13a3d0d252b787850330d2ea7.zip | |
net/mlx5: Return mdev from eswitch
Export a function so users can retrieve the mellanox device that manages
the eswitch from the eswitch device.
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Mark Zhang <markzhang@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'include/linux/mlx5')
| -rw-r--r-- | include/linux/mlx5/eswitch.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h index bc7db2e059eb..c2a34ff85188 100644 --- a/include/linux/mlx5/eswitch.h +++ b/include/linux/mlx5/eswitch.h @@ -128,6 +128,7 @@ u32 mlx5_eswitch_get_vport_metadata_for_set(struct mlx5_eswitch *esw, u8 mlx5_eswitch_mode(struct mlx5_core_dev *dev); u16 mlx5_eswitch_get_total_vports(const struct mlx5_core_dev *dev); +struct mlx5_core_dev *mlx5_eswitch_get_core_dev(struct mlx5_eswitch *esw); #else /* CONFIG_MLX5_ESWITCH */ @@ -171,6 +172,11 @@ static inline u16 mlx5_eswitch_get_total_vports(const struct mlx5_core_dev *dev) return 0; } +static inline struct mlx5_core_dev *mlx5_eswitch_get_core_dev(struct mlx5_eswitch *esw) +{ + return NULL; +} + #endif /* CONFIG_MLX5_ESWITCH */ static inline bool is_mdev_switchdev_mode(struct mlx5_core_dev *dev) |
