net/mlx5: Support querying max VFs from device
authorBodong Wang <bodong@mellanox.com>
Mon, 10 Jun 2019 23:38:19 +0000 (23:38 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 13 Jun 2019 17:59:48 +0000 (10:59 -0700)
commit86eec50beaf3a45f6432d491072fa5c54284dbca
treea4d9df04a29b68c20056306b1b404eb670382ce4
parent10ee82cedb62dd716c44ba7a2c458688638873ab
net/mlx5: Support querying max VFs from device

For ECPF with eswitch manager privilege, query the host max VF count
by querying the device using query_functions command.

With this enhancement:
1. flow steering entries are created only for valid vports based on
   the max VF count of the PF.
2. Driver only queries cap of valid vport.

Eswitch requires the max VFs when doing initialization, so do sr-iov
init before eswitch init.

Signed-off-by: Bodong Wang <bodong@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/main.c
drivers/net/ethernet/mellanox/mlx5/core/sriov.c
include/linux/mlx5/driver.h
include/linux/mlx5/mlx5_ifc.h