]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/mlx4_core: Use round robin scheme to avoid stale caches
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>
Thu, 11 May 2017 21:41:21 +0000 (14:41 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 18 Jun 2017 19:36:55 +0000 (12:36 -0700)
The mlx4 driver in uek4 has a bug where frequent re-use of CQs, MPTs,
or SRQs leads to memory corruption and subsequent crash of lwipc.

The issue has not been root-caused, but by partly reverting the
upstream commit 7c6d74d23a33 ("mlx4_core: Roll back round robin bitmap
allocation commit for CQs, SRQs, and MPTs") by re-introducing
round-robin (RR) allocation of said structures, we have a mitigation,
and the bug does not reproduce.

The root-cause of bug 25730857 is tracked by bug 26266051.

The commit message of the upstream commit states a performance concern
related to the use of RR. Simple testing using this commit reveals up
to 20% performance regression running simple OF-UV tests in loop, but
these tests are not deemed close to any real use-cases.

The same RR is in uek2 and performance issues are not reported related
to the concern.

The plan is therefore to merge this commit, to buy some time to
root-cause the issue. When the issue is root-caused, this commit
should be reverted.

Orabug: 25730857

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
drivers/net/ethernet/mellanox/mlx4/cq.c
drivers/net/ethernet/mellanox/mlx4/mr.c
drivers/net/ethernet/mellanox/mlx4/srq.c

index e71f31387ac6c73b843fef3f023cf6150327fe09..c86142e763ac0e8e5fda4944f6ac2094a861fbc1 100644 (file)
@@ -231,7 +231,7 @@ err_put:
        mlx4_table_put(dev, &cq_table->table, *cqn);
 
 err_out:
-       mlx4_bitmap_free(&cq_table->bitmap, *cqn, MLX4_NO_RR);
+       mlx4_bitmap_free(&cq_table->bitmap, *cqn, MLX4_USE_RR);
        return err;
 }
 
@@ -261,7 +261,7 @@ void __mlx4_cq_free_icm(struct mlx4_dev *dev, int cqn)
 
        mlx4_table_put(dev, &cq_table->cmpt_table, cqn);
        mlx4_table_put(dev, &cq_table->table, cqn);
-       mlx4_bitmap_free(&cq_table->bitmap, cqn, MLX4_NO_RR);
+       mlx4_bitmap_free(&cq_table->bitmap, cqn, MLX4_USE_RR);
 }
 
 static void mlx4_cq_free_icm(struct mlx4_dev *dev, int cqn)
index 271c158b70203ea3d0b01d70c2df86b47fa7caba..f17f51e288690d58b97d58322ec00953d3e728e3 100644 (file)
@@ -479,7 +479,7 @@ void __mlx4_mpt_release(struct mlx4_dev *dev, u32 index)
 {
        struct mlx4_priv *priv = mlx4_priv(dev);
 
-       mlx4_bitmap_free(&priv->mr_table.mpt_bitmap, index, MLX4_NO_RR);
+       mlx4_bitmap_free(&priv->mr_table.mpt_bitmap, index, MLX4_USE_RR);
 }
 
 static void mlx4_mpt_release(struct mlx4_dev *dev, u32 index)
index 67146624eb58b7946665026ee29ce57a84316888..1e94949460d88b9a3706ef6911604a0de2112ff1 100644 (file)
@@ -116,7 +116,7 @@ err_put:
        mlx4_table_put(dev, &srq_table->table, *srqn);
 
 err_out:
-       mlx4_bitmap_free(&srq_table->bitmap, *srqn, MLX4_NO_RR);
+       mlx4_bitmap_free(&srq_table->bitmap, *srqn, MLX4_USE_RR);
        return err;
 }
 
@@ -144,7 +144,7 @@ void __mlx4_srq_free_icm(struct mlx4_dev *dev, int srqn)
 
        mlx4_table_put(dev, &srq_table->cmpt_table, srqn);
        mlx4_table_put(dev, &srq_table->table, srqn);
-       mlx4_bitmap_free(&srq_table->bitmap, srqn, MLX4_NO_RR);
+       mlx4_bitmap_free(&srq_table->bitmap, srqn, MLX4_USE_RR);
 }
 
 static void mlx4_srq_free_icm(struct mlx4_dev *dev, int srqn)