net/mlx5: E-Switch, Use getter to access all vport array
authorBodong Wang <bodong@mellanox.com>
Mon, 15 Apr 2019 22:36:43 +0000 (17:36 -0500)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 1 May 2019 21:39:17 +0000 (14:39 -0700)
commit4314ebaa1e423d398035cdb7d15c50defa0f48af
tree13e6a5a9b4f72869d3d2c5007ead3ee30e7cb6c7
parentee813f314b2486549cd06e9e2c4d56ccab005609
net/mlx5: E-Switch, Use getter to access all vport array

Some functions issue vport commands and access vport array using
vport_index/vport_num interchangeably which is OK for VFs vports.
However, this creates potential bug if those vports are not VFs
(E.g, uplink, sf) where their vport_index don't equal to vport_num.

Prepare code to access mlx5_vport structure using a getter function.

Signed-off-by: Bodong Wang <bodong@mellanox.com>
Signed-off-by: Vu Pham <vuhuong@mellanox.com>
Reviewed-by: Parav Pandit <parav@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