diff mbox series

[10/17] RDMA/mlx5: Add attr for max number page list length for PI operation

Message ID 1549560811-8655-11-git-send-email-maxg@mellanox.com (mailing list archive)
State Superseded
Headers show
Series Introduce new API for T10-PI offload | expand

Commit Message

Max Gurtovoy Feb. 7, 2019, 5:33 p.m. UTC
PI offload (protection information) is a feature that each RDMA provider
can implement differently. Thus, introduce new device attribute to define
the maximal length of the page list for PI fast registration operation. For
example, mlx5 driver uses a single internal MR to map both data and
protection SGL's, so it's equal to max_fast_reg_page_list_len / 2.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c | 2 ++
 include/rdma/ib_verbs.h           | 1 +
 2 files changed, 3 insertions(+)

Comments

Sagi Grimberg Feb. 7, 2019, 6:25 p.m. UTC | #1
> PI offload (protection information) is a feature that each RDMA provider
> can implement differently. Thus, introduce new device attribute to define
> the maximal length of the page list for PI fast registration operation. For
> example, mlx5 driver uses a single internal MR to map both data and
> protection SGL's, so it's equal to max_fast_reg_page_list_len / 2.

This is a result of using a single MR, you guys know the use cases
better than I do at this point, is it acceptable? Because you could
have used more than a single MR (although it seems reasonable to me
given the overhead of allocating extra MRs for it...)
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index c4b2d9db5d07..3460c764e341 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -912,6 +912,8 @@  static int mlx5_ib_query_device(struct ib_device *ibdev,
 	props->max_srq_sge	   = max_rq_sg - 1;
 	props->max_fast_reg_page_list_len =
 		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;
 	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 1ec36490bc6f..465009e4837b 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -364,6 +364,7 @@  struct ib_device_attr {
 	int			max_srq_wr;
 	int			max_srq_sge;
 	unsigned int		max_fast_reg_page_list_len;
+	unsigned int		max_pi_fast_reg_page_list_len;
 	u16			max_pkeys;
 	u8			local_ca_ack_delay;
 	int			sig_prot_cap;