diff options
author | Parav Pandit <parav@mellanox.com> | 2019-10-29 02:35:30 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2019-11-02 00:40:27 +0300 |
commit | e53a9d26cf80565cfb7172fc52a0dfac73613a0f (patch) | |
tree | 9fbfd4442f21289cae8c5780913dd0a7d695f21d /include/linux/mlx5/driver.h | |
parent | 238302fae0216cb2e6a087ba403f3ecc3450b18b (diff) | |
download | linux-e53a9d26cf80565cfb7172fc52a0dfac73613a0f.tar.xz |
IB/mlx5: Introduce and use mlx5_core_is_vf()
Instead of deciding a given device is virtual function or
not based on a device is PF or not, use already defined
MLX5_COREDEV_VF by introducing an helper API mlx5_core_is_vf().
This enables to clearly identify PF, VF and non virtual functions.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Vu Pham <vuhuong@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/driver.h')
-rw-r--r-- | include/linux/mlx5/driver.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 3e80f03a387f..7b4801e96feb 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1121,6 +1121,11 @@ static inline bool mlx5_core_is_pf(const struct mlx5_core_dev *dev) return dev->coredev_type == MLX5_COREDEV_PF; } +static inline bool mlx5_core_is_vf(const struct mlx5_core_dev *dev) +{ + return dev->coredev_type == MLX5_COREDEV_VF; +} + static inline bool mlx5_core_is_ecpf(struct mlx5_core_dev *dev) { return dev->caps.embedded_cpu; |