History

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.

Bodong Wang committed 7 years ago

Commit bf3e4d31 parent b05af6a4 files · +9 −6Browse files

Unified · Split

4 files
  1. drivers/net/ethernet/mellanox/mlx5/core/eq.c +1 −0
  2. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +1 −0
  3. include/linux/mlx5/driver.h +0 −6
  4. include/linux/mlx5/vport.h +7 −0
drivers/net/ethernet/mellanox/mlx5/core/eq.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include <linux/notifier.h>
3535 #include <linux/module.h>
3636 #include <linux/mlx5/driver.h>
37+#include <linux/mlx5/vport.h>
3738 #include <linux/mlx5/eq.h>
3839 #include <linux/mlx5/cmd.h>
3940 #ifdef CONFIG_RFS_ACCEL
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232
3333 #include <linux/mutex.h>
3434 #include <linux/mlx5/driver.h>
35+#include <linux/mlx5/vport.h>
3536 #include <linux/mlx5/eswitch.h>
3637
3738 #include "mlx5_core.h"
include/linux/mlx5/driver.h+0−6
@@ -1097,12 +1097,6 @@ static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev) · 1096 unmodified lines
10971097 return pci_sriov_get_totalvfs(dev->pdev);
10981098 }
10991099
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−
11061100 static inline int mlx5_get_gid_table_len(u16 param)
11071101 {
11081102 if (param > 4) {
include/linux/mlx5/vport.h+7−0
@@ -36,6 +36,13 @@ · 35 unmodified lines
3636 #include <linux/mlx5/driver.h>
3737 #include <linux/mlx5/device.h>
3838
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+
3946 enum {
4047 MLX5_CAP_INLINE_MODE_L2,
4148 MLX5_CAP_INLINE_MODE_VPORT_CONTEXT,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t