IB/hfi1: Support ib_alloc_mr verb
Subsystems (2)
PATCH 1/1 IB/hfi1: Support ib_alloc_mr verb
Ported from upstream qib commit68c02e232b8a ("qib: Support ib_alloc_mr verb")
Tested-by Jubin John <[email protected]>
Reviewed-by Jubin John <[email protected]>
Signed-off-by Mike Marciniszyn <[email protected]>
--- drivers/staging/hfi1/mr.c | 9 +++++++-- drivers/staging/hfi1/verbs.c | 1 + drivers/staging/hfi1/verbs.h | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/staging/hfi1/mr.c +7 -2
@@ -348,11 +348,16 @@ out:* * Return the memory region on success, otherwise return an errno. */ -struct ib_mr *hfi1_alloc_fast_reg_mr (struct ib_pd *pd,int max_page_list_len) +struct ib_mr *hfi1_alloc_mr (struct ib_pd *pd, +enum ib_mr_type mr_type, +u32 max_num_sg) {struct hfi1_mr *mr; - mr =alloc_mr (max_page_list_len, pd); +if (mr_type !=IB_MR_TYPE_MEM_REG ) +return ERR_PTR (-EINVAL ); + + mr =alloc_mr (max_num_sg, pd);if (IS_ERR (mr))return (struct ib_mr *)mr;
drivers/staging/hfi1/verbs.c +1 -0
@@ -2045,6 +2045,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ibdev->reg_phys_mr = hfi1_reg_phys_mr; ibdev->reg_user_mr = hfi1_reg_user_mr; ibdev->dereg_mr = hfi1_dereg_mr; + ibdev->alloc_mr = hfi1_alloc_mr; ibdev->alloc_fast_reg_page_list = hfi1_alloc_fast_reg_page_list; ibdev->free_fast_reg_page_list = hfi1_free_fast_reg_page_list; ibdev->alloc_fmr = hfi1_alloc_fmr;
drivers/staging/hfi1/verbs.h +3 -1
@@ -1016,7 +1016,9 @@ struct ib_mr *hfi1_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,int hfi1_dereg_mr (struct ib_mr *ibmr); -struct ib_mr *hfi1_alloc_fast_reg_mr (struct ib_pd *pd,int max_page_list_len); +struct ib_mr *hfi1_alloc_mr (struct ib_pd *pd, +enum ib_mr_type mr_type, +u32 max_entries);struct ib_fast_reg_page_list *hfi1_alloc_fast_reg_page_list (struct ib_device *ibdev,int page_list_len);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20150807145125.27568.22379.stgit-K+u1se/DcYrLESAwzcoQNrvm/[email protected]
Quoted 6 lines · Mike Marciniszyn
Ported from upstream qib commit
68c02e232b8a("qib: Supportib_alloc_mrverb")Tested-by Jubin John <[email protected]>Reviewed-by Jubin John <[email protected]>Signed-off-by Mike Marciniszyn <[email protected]>
Added to the hfi1 branch.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD