net/mlx5: E-Switch, Prepare to return total vports from eswitch struct
authorParav Pandit <parav@nvidia.com>
Tue, 2 Mar 2021 12:10:49 +0000 (14:10 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Sat, 24 Apr 2021 07:58:43 +0000 (00:58 -0700)
commit9f8c7100c8f9879b7e972205cd1f33f0bc1cc8cb
tree4b56cde759f0ce72523836b7dad221eff2499447
parent06ec5acc7747f225154fcafaf2afe52324694baa
net/mlx5: E-Switch, Prepare to return total vports from eswitch struct

Total vports are already stored during eswitch initialization. Instead
of calculating everytime, read directly from eswitch.

Additionally, host PF's SF vport information is available using
QUERY_HCA_CAP command. It is not available through HCA_CAP of the
eswitch manager PF.
Hence, this patch prepares the return total eswitch vport count from the
existing eswitch struct.

This further helps to keep eswitch port counting macros and logic within
eswitch.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
include/linux/mlx5/vport.h