RDMA/mlx5: Add attr for max number page list length for PI operation
authorMax Gurtovoy <maxg@mellanox.com>
Tue, 11 Jun 2019 15:52:43 +0000 (18:52 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 24 Jun 2019 14:49:26 +0000 (11:49 -0300)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/main.c
include/rdma/ib_verbs.h

index 23fedff9f0806b26ac4d2e10ad6f0eed5668c3bf..bd0322b61362b3eae4c591f71be63e460288dc5b 100644 (file)
@@ -1009,6 +1009,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);
index 995b217a19401f74d0d88c9dd4f571a7e2ae703d..9169e798334f8530c13c97e81be6ce0fd580b09e 100644 (file)
@@ -390,6 +390,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;