From dc8aac8d95e5e4a2dbc2781d83ad3a7f89778a10 Mon Sep 17 00:00:00 2001 From: Ajaykumar Hotchandani Date: Fri, 5 May 2017 12:08:32 -0700 Subject: [PATCH] mlx4: limit max MSIX allocations We get more than 64 MSI-X vectors from CX3 firmware 2.35.5530 onwards. This results in in legacy mode EQ allocs after 64 EQs, which ends up flooding 3 vectors and causing performance degradation. With this patch, we limit max vector allocations MAX_MSIX(64). When Mellanox driver can support more EQs without getting into legacy mode, this patch should go away. Orabug: 25912737 Signed-off-by: Ajaykumar Hotchandani Reviewed-by: Yuval Shaia --- drivers/net/ethernet/mellanox/mlx4/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 0fd84ed561e7..a64ced2ed8ca 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -2721,6 +2721,15 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, nreq); + /* 2.35.5530 firmware is providing more than 64 vectors. + * Limit max MSI-X vector allocation to MAX_MSIX(64) for now. + * Beyond that, it's going in legacy mode and 3 vectors are flooded with interrupts. + * This causes performance inconsistencies. + * We should remove following condition after driver can support beyond 64 vectors + * without getting into legacy mode. + */ + if (nreq > MAX_MSIX) + nreq = MAX_MSIX; if (msi_x > 1) nreq = min_t(int, nreq, msi_x); -- 2.50.1