]> 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)
commit2a1a2ab2c4b0107c1ae5154f45f256d27c18f3e3
tree4b56cde759f0ce72523836b7dad221eff2499447
parent87b560910527c99361cb3731ab7b353530e32955
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