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.
Showing the changes to include/linux (2 of 4 files). Show all
Unified · Split
| @@ -470,6 +470,7 @@ struct mlx5_core_sriov { · 469 unmodified lines | |||
| 470 | struct mlx5_vf_context *vfs_ctx; | 470 | struct mlx5_vf_context *vfs_ctx; |
| 471 | int num_vfs; | 471 | int num_vfs; |
| 472 | int enabled_vfs; | 472 | int enabled_vfs; |
| 473 | u16 max_vfs; | ||
| 473 | }; | 474 | }; |
| 474 | 475 | ||
| 475 | struct mlx5_fc_stats { | 476 | struct mlx5_fc_stats { |
| @@ -1103,13 +1104,9 @@ static inline bool mlx5_ecpf_vport_exists(struct mlx5_core_dev *dev) · 627 unmodified lines | |||
| 1103 | return mlx5_core_is_pf(dev) && MLX5_CAP_ESW(dev, ecpf_vport_exists); | 1104 | return mlx5_core_is_pf(dev) && MLX5_CAP_ESW(dev, ecpf_vport_exists); |
| 1104 | } | 1105 | } |
| 1105 | 1106 | ||
| 1106 | #define MLX5_HOST_PF_MAX_VFS (127u) | ||
| 1107 | static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev) | 1107 | static inline u16 mlx5_core_max_vfs(struct mlx5_core_dev *dev) |
| 1108 | { | 1108 | { |
| 1109 | if (mlx5_core_is_ecpf_esw_manager(dev)) | 1109 | return dev->priv.sriov.max_vfs; |
| 1110 | return MLX5_HOST_PF_MAX_VFS; | ||
| 1111 | else | ||
| 1112 | return pci_sriov_get_totalvfs(dev->pdev); | ||
| 1113 | } | 1110 | } |
| 1114 | 1111 | ||
| 1115 | static inline int mlx5_get_gid_table_len(u16 param) | 1112 | static inline int mlx5_get_gid_table_len(u16 param) |
| @@ -9711,7 +9711,7 @@ struct mlx5_ifc_host_params_context_bits { · 9710 unmodified lines | |||
| 9711 | u8 reserved_at_8[0x8]; | 9711 | u8 reserved_at_8[0x8]; |
| 9712 | u8 host_num_of_vfs[0x10]; | 9712 | u8 host_num_of_vfs[0x10]; |
| 9713 | 9713 | ||
| 9714 | u8 reserved_at_20[0x10]; | 9714 | u8 host_total_vfs[0x10]; |
| 9715 | u8 host_pci_bus[0x10]; | 9715 | u8 host_pci_bus[0x10]; |
| 9716 | 9716 | ||
| 9717 | u8 reserved_at_40[0x10]; | 9717 | u8 reserved_at_40[0x10]; |