]> 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)
commitce62b814463c8627cd8895d1b23ac863dc1d0031
tree4246864b89dc7d8c696789fbf923f81e694612d8
parent35dcccb9488e4f8f69ae3068c8b19b14ae1ba601
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