]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit93e902009d1ef41a808d12cdffb9efc4cf854999
tree4b56cde759f0ce72523836b7dad221eff2499447
parentb08b3d716066fe76670874ec258d4245dd254900
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