Skip to content

Commit 71e084e

Browse files
shayshyiSaeed Mahameed
authored andcommitted
net/mlx5: Allocating a pool of MSI-X vectors for SFs
SFs (Sub Functions) currently use IRQs from the global IRQ table their parent Physical Function have. In order to better scale, we need to allocate more IRQs and share them between different SFs. Driver will maintain 3 separated irq pools: 1. A pool that serve the PF consumer (PF's netdev, rdma stacks), similar to what the driver had before this patch. i.e, this pool will share irqs between rdma and netev, and will keep the irq indexes and allocation order. The last is important for PF netdev rmap (aRFS). 2. A pool of control IRQs for SFs. The size of this pool is the number of SFs that can be created divided by SFS_PER_IRQ. This pool will serve the control path EQs of the SFs. 3. A pool of completion data path IRQs for SFs transport queues. The size of this pool is: num_irqs_allocated - pf_pool_size - sf_ctrl_pool_size. This pool will served netdev and rdma stacks. Moreover, rmap is not supported on SFs. Sharing methodology of the SFs pools is explained in the next patch. Important note: rmap is not supported on SFs because rmap mapping cannot function correctly for IRQs that are shared for different core/netdev RX rings. Signed-off-by: Shay Drory <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent fc63dd2 commit 71e084e

File tree

3 files changed

+209
-101
lines changed

3 files changed

+209
-101
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eq.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -471,14 +471,7 @@ static int create_async_eq(struct mlx5_core_dev *dev,
471471
int err;
472472

473473
mutex_lock(&eq_table->lock);
474-
/* Async EQs must share irq index 0 */
475-
if (param->irq_index != 0) {
476-
err = -EINVAL;
477-
goto unlock;
478-
}
479-
480474
err = create_map_eq(dev, eq, param);
481-
unlock:
482475
mutex_unlock(&eq_table->lock);
483476
return err;
484477
}
@@ -996,8 +989,11 @@ int mlx5_eq_table_create(struct mlx5_core_dev *dev)
996989

997990
eq_table->num_comp_eqs =
998991
min_t(int,
999-
mlx5_irq_get_num_comp(eq_table->irq_table),
992+
mlx5_irq_table_get_num_comp(eq_table->irq_table),
1000993
num_eqs - MLX5_MAX_ASYNC_EQS);
994+
if (mlx5_core_is_sf(dev))
995+
eq_table->num_comp_eqs = min_t(int, eq_table->num_comp_eqs,
996+
MLX5_COMP_EQS_PER_SF);
1001997

1002998
err = create_async_eqs(dev);
1003999
if (err) {

drivers/net/ethernet/mellanox/mlx5/core/mlx5_irq.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66

77
#include <linux/mlx5/driver.h>
88

9+
#define MLX5_COMP_EQS_PER_SF 8
10+
11+
#define MLX5_IRQ_EQ_CTRL (0)
12+
913
struct mlx5_irq;
1014

1115
int mlx5_irq_table_init(struct mlx5_core_dev *dev);
1216
void mlx5_irq_table_cleanup(struct mlx5_core_dev *dev);
1317
int mlx5_irq_table_create(struct mlx5_core_dev *dev);
1418
void mlx5_irq_table_destroy(struct mlx5_core_dev *dev);
15-
int mlx5_irq_get_num_comp(struct mlx5_irq_table *table);
19+
int mlx5_irq_table_get_num_comp(struct mlx5_irq_table *table);
1620
struct mlx5_irq_table *mlx5_irq_table_get(struct mlx5_core_dev *dev);
1721

1822
int mlx5_set_msix_vec_count(struct mlx5_core_dev *dev, int devfn,

0 commit comments

Comments
 (0)