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.
Unified · Split
| @@ -34,6 +34,7 @@ · 33 unmodified lines | |||
| 34 | #include <linux/notifier.h> | 34 | #include <linux/notifier.h> |
| 35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
| 36 | #include <linux/mlx5/driver.h> | 36 | #include <linux/mlx5/driver.h> |
| 37 | #include <linux/mlx5/vport.h> | ||
| 37 | #include <linux/mlx5/eq.h> | 38 | #include <linux/mlx5/eq.h> |
| 38 | #include <linux/mlx5/cmd.h> | 39 | #include <linux/mlx5/cmd.h> |
| 39 | #ifdef CONFIG_RFS_ACCEL | 40 | #ifdef CONFIG_RFS_ACCEL |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | |||
| 32 | 32 | ||
| 33 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
| 34 | #include <linux/mlx5/driver.h> | 34 | #include <linux/mlx5/driver.h> |
| 35 | #include <linux/mlx5/vport.h> | ||
| 35 | #include <linux/mlx5/eswitch.h> | 36 | #include <linux/mlx5/eswitch.h> |
| 36 | 37 | ||
| 37 | #include "mlx5_core.h" | 38 | #include "mlx5_core.h" |
| @@ -1097,12 +1097,6 @@ static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev) · 1096 unmodified lines | |||
| 1097 | return pci_sriov_get_totalvfs(dev->pdev); | 1097 | return pci_sriov_get_totalvfs(dev->pdev); |
| 1098 | } | 1098 | } |
| 1099 | 1099 | ||
| 1100 | #define MLX5_TOTAL_VPORTS(mdev) (1 + mlx5_core_max_vfs(mdev)) | ||
| 1101 | #define MLX5_VPORT_MANAGER(mdev) \ | ||
| 1102 | (MLX5_CAP_GEN(mdev, vport_group_manager) && \ | ||
| 1103 | (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \ | ||
| 1104 | mlx5_core_is_pf(mdev)) | ||
| 1105 | |||
| 1106 | static inline int mlx5_get_gid_table_len(u16 param) | 1100 | static inline int mlx5_get_gid_table_len(u16 param) |
| 1107 | { | 1101 | { |
| 1108 | if (param > 4) { | 1102 | if (param > 4) { |
| @@ -36,6 +36,13 @@ · 35 unmodified lines | |||
| 36 | #include <linux/mlx5/driver.h> | 36 | #include <linux/mlx5/driver.h> |
| 37 | #include <linux/mlx5/device.h> | 37 | #include <linux/mlx5/device.h> |
| 38 | 38 | ||
| 39 | #define MLX5_TOTAL_VPORTS(mdev) (1 + mlx5_core_max_vfs(mdev)) | ||
| 40 | |||
| 41 | #define MLX5_VPORT_MANAGER(mdev) \ | ||
| 42 | (MLX5_CAP_GEN(mdev, vport_group_manager) && \ | ||
| 43 | (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \ | ||
| 44 | mlx5_core_is_pf(mdev)) | ||
| 45 | |||
| 39 | enum { | 46 | enum { |
| 40 | MLX5_CAP_INLINE_MODE_L2, | 47 | MLX5_CAP_INLINE_MODE_L2, |
| 41 | MLX5_CAP_INLINE_MODE_VPORT_CONTEXT, | 48 | MLX5_CAP_INLINE_MODE_VPORT_CONTEXT, |