net/mlx5: E-Switch, Assign a different position for uplink rep and vport
In offloads mode, the current implementation puts the uplink representor at index zero of the vport reps array. It is not "natural" to place it at index 0 since we want to put the representor for vport 0 at index 0 with the introduction of SmartNIC. A separate patch will handle the case whether a rep is needed for vport 0 (PF vport). So, we want to have a different placeholder for uplink vport and representor. It was placed at the end of vport and rep array. Since vport number can no longer act as an index into the vport or representors arrays, use functions to map vport numbers to indices when accessing the vports or representors arrays, and vice versa. Signed-off-by: Bodong Wang <bodong@mellanox.com> Signed-off-by: Eli Cohen <eli@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:

committed by
Saeed Mahameed

parent
f8e8fa0262
commit
5ae5162066
@@ -36,9 +36,14 @@
|
||||
#include <linux/mlx5/driver.h>
|
||||
#include <linux/mlx5/device.h>
|
||||
|
||||
#define MLX5_VPORT_PF_PLACEHOLDER (1u)
|
||||
#define MLX5_SPECIAL_VPORTS (MLX5_VPORT_PF_PLACEHOLDER)
|
||||
#define MLX5_TOTAL_VPORTS(mdev) (MLX5_SPECIAL_VPORTS + mlx5_core_max_vfs(mdev))
|
||||
#define MLX5_VPORT_PF_PLACEHOLDER (1u)
|
||||
#define MLX5_VPORT_UPLINK_PLACEHOLDER (1u)
|
||||
|
||||
#define MLX5_SPECIAL_VPORTS (MLX5_VPORT_PF_PLACEHOLDER + \
|
||||
MLX5_VPORT_UPLINK_PLACEHOLDER)
|
||||
|
||||
#define MLX5_TOTAL_VPORTS(mdev) (MLX5_SPECIAL_VPORTS + \
|
||||
mlx5_core_max_vfs(mdev))
|
||||
|
||||
#define MLX5_VPORT_MANAGER(mdev) \
|
||||
(MLX5_CAP_GEN(mdev, vport_group_manager) && \
|
||||
|
Reference in New Issue
Block a user