]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
IB/mlx5: Use cache line size to select CQE stride
authorDaniel Jurgens <danielj@mellanox.com>
Thu, 27 Oct 2016 13:36:41 +0000 (16:36 +0300)
committerJiri Slaby <jslaby@suse.cz>
Thu, 24 Nov 2016 15:23:58 +0000 (16:23 +0100)
commit 16b0e0695a73b68d8ca40288c8f9614ef208917b upstream.

When creating kernel CQs use 128B CQE stride if the
cache line size is 128B, 64B otherwise.  This prevents
multiple CQEs from residing in a 128B cache line,
which can cause retries when there are concurrent
read and writes in one cache line.

Tested with IPoIB on PPC64, saw ~5% throughput
improvement.

Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/infiniband/hw/mlx5/cq.c

index 706833ab7e7ea303a18455f964bae0e7172bdb19..e5a6d839f1d1238f28ccec4e9cae7d84fb14a677 100644 (file)
@@ -684,8 +684,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev, int entries,
                if (err)
                        goto err_create;
        } else {
-               /* for now choose 64 bytes till we have a proper interface */
-               cqe_size = 64;
+               cqe_size = cache_line_size() == 128 ? 128 : 64;
                err = create_cq_kernel(dev, cq, entries, cqe_size, &cqb,
                                       &index, &inlen);
                if (err)