diff options
author | Bodong Wang | 2019-04-16 00:36:43 +0200 |
---|---|---|
committer | Saeed Mahameed | 2019-05-01 23:39:17 +0200 |
commit | 4314ebaa1e423d398035cdb7d15c50defa0f48af (patch) | |
tree | 13e6a5a9b4f72869d3d2c5007ead3ee30e7cb6c7 /drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | |
parent | net/mlx5: Use available mlx5_vport struct (diff) | |
download | kernel-qcow2-linux-4314ebaa1e423d398035cdb7d15c50defa0f48af.tar.gz kernel-qcow2-linux-4314ebaa1e423d398035cdb7d15c50defa0f48af.tar.xz kernel-qcow2-linux-4314ebaa1e423d398035cdb7d15c50defa0f48af.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/eswitch.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index fc512a5d0c4c..2e6b37d4fc7f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -488,6 +488,8 @@ void mlx5e_tc_clean_fdb_peer_flows(struct mlx5_eswitch *esw); #define mlx5_esw_for_each_vf_vport_num_reverse(esw, vport, nvfs) \ for ((vport) = (nvfs); (vport) >= MLX5_VPORT_FIRST_VF; (vport)--) +struct mlx5_vport *mlx5_eswitch_get_vport(struct mlx5_eswitch *esw, + u16 vport_num); #else /* CONFIG_MLX5_ESWITCH */ /* eswitch API stubs */ static inline int mlx5_eswitch_init(struct mlx5_core_dev *dev) { return 0; } |