diff options
author | Bodong Wang <bodong@mellanox.com> | 2019-02-13 09:55:41 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2019-02-14 23:14:42 +0300 |
commit | bf3e4d387daed36aad2cfd4f493b07714ac0cd5e (patch) | |
tree | 9ab3d05b79f658aa0fcecbd80a2c49e55f5d435e /include/linux/mlx5/vport.h | |
parent | b05af6aacdb920dc3bfd27d53ade7f680d43265c (diff) | |
download | linux-bf3e4d387daed36aad2cfd4f493b07714ac0cd5e.tar.xz |
net/mlx5: Relocate vport macros to the vport header file
These are two macros in the driver general header which deal with the
number of total vports and if a vport is vport manager. Such macros
are vport entities, better to place them at the vport header file.
This patch doesn't change any functionality.
Signed-off-by: Bodong Wang <bodong@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/vport.h')
-rw-r--r-- | include/linux/mlx5/vport.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mlx5/vport.h b/include/linux/mlx5/vport.h index 2e2928eacd97..28f47e868fbc 100644 --- a/include/linux/mlx5/vport.h +++ b/include/linux/mlx5/vport.h @@ -36,6 +36,13 @@ #include <linux/mlx5/driver.h> #include <linux/mlx5/device.h> +#define MLX5_TOTAL_VPORTS(mdev) (1 + mlx5_core_max_vfs(mdev)) + +#define MLX5_VPORT_MANAGER(mdev) \ + (MLX5_CAP_GEN(mdev, vport_group_manager) && \ + (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \ + mlx5_core_is_pf(mdev)) + enum { MLX5_CAP_INLINE_MODE_L2, MLX5_CAP_INLINE_MODE_VPORT_CONTEXT, |