diff mbox series

[for-next,5/5] RDMA/hns: Configure capacity of hns device

Message ID 1549181587-47539-6-git-send-email-oulijun@huawei.com (mailing list archive)
State Mainlined
Commit dad1f9802ecee3a21143293b2505e1b57b1ae525
Delegated to: Jason Gunthorpe
Headers show
Series hns misc updates | expand

Commit Message

Lijun Ou Feb. 3, 2019, 8:13 a.m. UTC
This patch adds new device capability for IB_DEVICE_MEM_MGT_EXTENSIONS
to indicate device support for the following features:
1. Fast register memory region.
2. send with remote invalidate by frmr
3. local invalidate memory regsion

As well as adds the max depth of frmr page list len.

Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_main.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index 67a8c43..ccd1c7e 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -226,6 +226,11 @@  static int hns_roce_query_device(struct ib_device *ib_dev,
 		props->max_srq_sge = hr_dev->caps.max_srq_sges;
 	}
 
+	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_FRMR) {
+		props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
+		props->max_fast_reg_page_list_len = HNS_ROCE_FRMR_MAX_PA;
+	}
+
 	return 0;
 }