]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: E-Switch, Use getter and iterator to access vport/rep
authorBodong Wang <bodong@mellanox.com>
Tue, 29 Jan 2019 04:12:45 +0000 (22:12 -0600)
committerSaeed Mahameed <saeedm@mellanox.com>
Sat, 16 Feb 2019 01:25:57 +0000 (17:25 -0800)
commit037e21ddd9b1be07a1aa6ce4fbbe862bec2194d8
tree4246864b89dc7d8c696789fbf923f81e694612d8
parent318a9b7a11db4a0b160cf5840375bf3bea07ab30
net/mlx5: E-Switch, Use getter and iterator to access vport/rep

With only PF and VF, it is sufficient to have the vport/rep array
index as the vport number. This is because PF and VF vports numbers
are consecutive serial numbers. In downstream patches with
introducing of ECPF and UPLINK vports, it's not consecutive any more.

Use getter to get specific vport/rep, and use iterator to traversal
a list of vport/rep. This hides the translation between array index
and vport number, and provides flexibility of using different
translation mechanism in the future.

This patch doesn't change any functionality.

Signed-off-by: Bodong Wang <bodong@mellanox.com>
Suggested-by: Saeed Mahameed <saeedm@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_offloads.c