]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mlx4: limit max MSIX allocations
authorAjaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Fri, 5 May 2017 19:08:32 +0000 (12:08 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Tue, 30 May 2017 06:33:58 +0000 (23:33 -0700)
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 <ajaykumar.hotchandani@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
drivers/net/ethernet/mellanox/mlx4/main.c

index 0fd84ed561e7514939c91397776aeb27256b5abf..a64ced2ed8ca5026cd226a1f4dbc2af8057f29d8 100644 (file)
@@ -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);