]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: E-Switch, Assign a different position for uplink rep and vport
authorBodong Wang <bodong@mellanox.com>
Fri, 14 Dec 2018 15:33:22 +0000 (09:33 -0600)
committerSaeed Mahameed <saeedm@mellanox.com>
Sat, 16 Feb 2019 01:25:58 +0000 (17:25 -0800)
commit5ae5162066d8e59e365678a9e76fc4d8f6b78d40
tree2d29337265affb5773a80c1af263005fdd73a7d9
parentf8e8fa0262eaf544490a11746c524333158ef0b6
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>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
include/linux/mlx5/vport.h