diff mbox series

[rdma-next,2/3] RDMA/mlx5: Add capability for max sge to get optimized performance

Message ID 20191006155955.31445-3-leon@kernel.org
State Not Applicable
Delegated to: David Miller
Headers show
Series Optimize SGL registration | expand

Commit Message

Leon Romanovsky Oct. 6, 2019, 3:59 p.m. UTC
From: Yamin Friedman <yaminf@mellanox.com>

Allows the IB device to provide a value of maximum scatter gather entries
per RDMA READ.

In certain cases it may be preferable for a device to perform UMR memory
registration rather than have many scatter entries in a single RDMA READ.
This provides a significant performance increase in devices capable of
using different memory registration schemes based on the number of scatter
gather entries. This general capability allows each device vendor to fine
tune when it is better to use memory registration.

Signed-off-by: Yamin Friedman <yaminf@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 2 ++
 include/rdma/ib_verbs.h           | 2 ++
 2 files changed, 4 insertions(+)

Comments

Christoph Hellwig Oct. 7, 2019, 7:13 a.m. UTC | #1
On Sun, Oct 06, 2019 at 06:59:54PM +0300, Leon Romanovsky wrote:
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 4f671378dbfc..60fd98a9b7e8 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -445,6 +445,8 @@ struct ib_device_attr {
>  	struct ib_tm_caps	tm_caps;
>  	struct ib_cq_caps       cq_caps;
>  	u64			max_dm_size;
> +	/* Max entries for sgl for optimized performance per READ */
> +	u32			max_sgl_rd;

This either needs to go into what current is patch 3 or an entirely
separate one.
Leon Romanovsky Oct. 7, 2019, 7:54 a.m. UTC | #2
On Mon, Oct 07, 2019 at 12:13:02AM -0700, Christoph Hellwig wrote:
> On Sun, Oct 06, 2019 at 06:59:54PM +0300, Leon Romanovsky wrote:
> > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> > index 4f671378dbfc..60fd98a9b7e8 100644
> > --- a/include/rdma/ib_verbs.h
> > +++ b/include/rdma/ib_verbs.h
> > @@ -445,6 +445,8 @@ struct ib_device_attr {
> >  	struct ib_tm_caps	tm_caps;
> >  	struct ib_cq_caps       cq_caps;
> >  	u64			max_dm_size;
> > +	/* Max entries for sgl for optimized performance per READ */
> > +	u32			max_sgl_rd;
>
> This either needs to go into what current is patch 3 or an entirely
> separate one.

I'll reshuffle.

Thanks
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index fa23c8e7043b..39d54e285ae9 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -1012,6 +1012,8 @@  static int mlx5_ib_query_device(struct ib_device *ibdev,
 		1 << MLX5_CAP_GEN(mdev, log_max_klm_list_size);
 	props->max_pi_fast_reg_page_list_len =
 		props->max_fast_reg_page_list_len / 2;
+	props->max_sgl_rd =
+		MLX5_CAP_GEN(mdev, max_sgl_for_optimized_performance);
 	get_atomic_caps_qp(dev, props);
 	props->masked_atomic_cap   = IB_ATOMIC_NONE;
 	props->max_mcast_grp	   = 1 << MLX5_CAP_GEN(mdev, log_max_mcg);
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 4f671378dbfc..60fd98a9b7e8 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -445,6 +445,8 @@  struct ib_device_attr {
 	struct ib_tm_caps	tm_caps;
 	struct ib_cq_caps       cq_caps;
 	u64			max_dm_size;
+	/* Max entries for sgl for optimized performance per READ */
+	u32			max_sgl_rd;
 };
 
 enum ib_mtu {