16
16
#endif
17
17
18
18
#define MLX5_SFS_PER_CTRL_IRQ 64
19
+ #define MLX5_MAX_MSIX_PER_SF 256
19
20
#define MLX5_IRQ_CTRL_SF_MAX 8
20
21
/* min num of vectors for SFs to be enabled */
21
22
#define MLX5_IRQ_VEC_COMP_BASE_SF 2
@@ -589,8 +590,6 @@ static void irq_pool_free(struct mlx5_irq_pool *pool)
589
590
static int irq_pools_init (struct mlx5_core_dev * dev , int sf_vec , int pcif_vec )
590
591
{
591
592
struct mlx5_irq_table * table = dev -> priv .irq_table ;
592
- int num_sf_ctrl_by_msix ;
593
- int num_sf_ctrl_by_sfs ;
594
593
int num_sf_ctrl ;
595
594
int err ;
596
595
@@ -608,10 +607,8 @@ static int irq_pools_init(struct mlx5_core_dev *dev, int sf_vec, int pcif_vec)
608
607
}
609
608
610
609
/* init sf_ctrl_pool */
611
- num_sf_ctrl_by_msix = DIV_ROUND_UP (sf_vec , MLX5_COMP_EQS_PER_SF );
612
- num_sf_ctrl_by_sfs = DIV_ROUND_UP (mlx5_sf_max_functions (dev ),
613
- MLX5_SFS_PER_CTRL_IRQ );
614
- num_sf_ctrl = min_t (int , num_sf_ctrl_by_msix , num_sf_ctrl_by_sfs );
610
+ num_sf_ctrl = DIV_ROUND_UP (mlx5_sf_max_functions (dev ),
611
+ MLX5_SFS_PER_CTRL_IRQ );
615
612
num_sf_ctrl = min_t (int , MLX5_IRQ_CTRL_SF_MAX , num_sf_ctrl );
616
613
table -> sf_ctrl_pool = irq_pool_alloc (dev , pcif_vec , num_sf_ctrl ,
617
614
"mlx5_sf_ctrl" ,
@@ -726,8 +723,7 @@ int mlx5_irq_table_create(struct mlx5_core_dev *dev)
726
723
727
724
total_vec = pcif_vec ;
728
725
if (mlx5_sf_max_functions (dev ))
729
- total_vec += MLX5_IRQ_CTRL_SF_MAX +
730
- MLX5_COMP_EQS_PER_SF * mlx5_sf_max_functions (dev );
726
+ total_vec += MLX5_MAX_MSIX_PER_SF * mlx5_sf_max_functions (dev );
731
727
total_vec = min_t (int , total_vec , pci_msix_vec_count (dev -> pdev ));
732
728
pcif_vec = min_t (int , pcif_vec , pci_msix_vec_count (dev -> pdev ));
733
729
0 commit comments