summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2020-10-10 11:57:26 +0300
committerLeon Romanovsky <leonro@nvidia.com>2020-12-06 07:43:54 +0200
commite87114022e1de734de0552e6b4f2dc5309efa27a (patch)
tree2e08bb0c95b7488a4f3c9c0419dfe080298a30a0 /include
parent601c10c89cbb32b9123d8716d193e6d1a8e5300d (diff)
downloadlinux-e87114022e1de734de0552e6b4f2dc5309efa27a.tar.bz2
net/mlx5: Simplify eswitch mode check
Provide mlx5_core device instead of "priv" pointer while checking eswith mode. Reviewed-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mlx5/eswitch.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h
index b0ae8020f13e..29fd832950e0 100644
--- a/include/linux/mlx5/eswitch.h
+++ b/include/linux/mlx5/eswitch.h
@@ -96,10 +96,10 @@ static inline u32 mlx5_eswitch_get_vport_metadata_mask(void)
u32 mlx5_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
u16 vport_num);
-u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
+u8 mlx5_eswitch_mode(struct mlx5_core_dev *dev);
#else /* CONFIG_MLX5_ESWITCH */
-static inline u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw)
+static inline u8 mlx5_eswitch_mode(struct mlx5_core_dev *dev)
{
return MLX5_ESWITCH_NONE;
}
@@ -136,4 +136,8 @@ mlx5_eswitch_get_vport_metadata_mask(void)
}
#endif /* CONFIG_MLX5_ESWITCH */
+static inline bool is_mdev_switchdev_mode(struct mlx5_core_dev *dev)
+{
+ return mlx5_eswitch_mode(dev) == MLX5_ESWITCH_OFFLOADS;
+}
#endif