diff options
author | Parav Pandit | 2019-05-15 07:04:27 +0200 |
---|---|---|
committer | Saeed Mahameed | 2019-07-03 21:50:42 +0200 |
commit | 2752b823169b216db142c4466b43269281962dcf (patch) | |
tree | 6c01796b4436773d85fec714f879cc301a66bb79 /include/linux/mlx5/eswitch.h | |
parent | net/mlx5: Expose device definitions for object events (diff) | |
download | kernel-qcow2-linux-2752b823169b216db142c4466b43269281962dcf.tar.gz kernel-qcow2-linux-2752b823169b216db142c4466b43269281962dcf.tar.xz kernel-qcow2-linux-2752b823169b216db142c4466b43269281962dcf.zip |
net/mlx5: Introduce and use mlx5_eswitch_get_total_vports()
Instead MLX5_TOTAL_VPORTS, use mlx5_eswitch_get_total_vports().
mlx5_eswitch_get_total_vports() in subsequent patch accounts for SF
vports as well.
Expanding MLX5_TOTAL_VPORTS macro would require exposing SF internals to
more generic vport.h header file. Such exposure is not desired.
Hence a mlx5_eswitch_get_total_vports() is introduced.
Given that mlx5_eswitch_get_total_vports() API wants to work on const
mlx5_core_dev*, change its helper functions also to accept const *dev.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/eswitch.h')
-rw-r--r-- | include/linux/mlx5/eswitch.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h index d4731199edb4..61db37aa9642 100644 --- a/include/linux/mlx5/eswitch.h +++ b/include/linux/mlx5/eswitch.h @@ -66,6 +66,8 @@ struct mlx5_flow_handle * mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, int vport, u32 sqn); +u16 mlx5_eswitch_get_total_vports(const struct mlx5_core_dev *dev); + #ifdef CONFIG_MLX5_ESWITCH enum devlink_eswitch_encap_mode mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev); @@ -93,4 +95,5 @@ mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw, return 0; }; #endif /* CONFIG_MLX5_ESWITCH */ + #endif |