mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
net/mlx5: Use max_num_eqs_24b capability if set
A new capability with more bits is added. If it's set use that value as
the maximum number of EQs available.
This cap is also writable by the vhca_resource_manager to allow limiting
the number of EQs available to SFs and VFs.
Fixes: 93197c7c50
("mlx5/core: Support max_io_eqs for a function")
Signed-off-by: Daniel Jurgens <danielj@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: William Tu <witu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
048a403648
commit
29c6a562bf
@ -1197,9 +1197,7 @@ static int get_num_eqs(struct mlx5_core_dev *dev)
|
||||
if (!mlx5_core_is_eth_enabled(dev) && mlx5_eth_supported(dev))
|
||||
return 1;
|
||||
|
||||
max_dev_eqs = MLX5_CAP_GEN(dev, max_num_eqs) ?
|
||||
MLX5_CAP_GEN(dev, max_num_eqs) :
|
||||
1 << MLX5_CAP_GEN(dev, log_max_eq);
|
||||
max_dev_eqs = mlx5_max_eq_cap_get(dev);
|
||||
|
||||
num_eqs = min_t(int, mlx5_irq_table_get_num_comp(eq_table->irq_table),
|
||||
max_dev_eqs - MLX5_MAX_ASYNC_EQS);
|
||||
|
@ -383,4 +383,14 @@ static inline int mlx5_vport_to_func_id(const struct mlx5_core_dev *dev, u16 vpo
|
||||
: vport;
|
||||
}
|
||||
|
||||
static inline int mlx5_max_eq_cap_get(const struct mlx5_core_dev *dev)
|
||||
{
|
||||
if (MLX5_CAP_GEN_2(dev, max_num_eqs_24b))
|
||||
return MLX5_CAP_GEN_2(dev, max_num_eqs_24b);
|
||||
|
||||
if (MLX5_CAP_GEN(dev, max_num_eqs))
|
||||
return MLX5_CAP_GEN(dev, max_num_eqs);
|
||||
|
||||
return 1 << MLX5_CAP_GEN(dev, log_max_eq);
|
||||
}
|
||||
#endif /* __MLX5_CORE_H__ */
|
||||
|
@ -711,9 +711,7 @@ int mlx5_irq_table_get_num_comp(struct mlx5_irq_table *table)
|
||||
|
||||
int mlx5_irq_table_create(struct mlx5_core_dev *dev)
|
||||
{
|
||||
int num_eqs = MLX5_CAP_GEN(dev, max_num_eqs) ?
|
||||
MLX5_CAP_GEN(dev, max_num_eqs) :
|
||||
1 << MLX5_CAP_GEN(dev, log_max_eq);
|
||||
int num_eqs = mlx5_max_eq_cap_get(dev);
|
||||
int total_vec;
|
||||
int pcif_vec;
|
||||
int req_vec;
|
||||
|
Loading…
Reference in New Issue
Block a user