From: Ajaykumar Hotchandani Date: Fri, 5 May 2017 19:08:32 +0000 (-0700) Subject: mlx4: limit max MSIX allocations X-Git-Tag: v4.1.12-102.0.20170529_2200~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dc8aac8d95e5e4a2dbc2781d83ad3a7f89778a10;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 0fd84ed561e75..a64ced2ed8ca5 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);