Skip to content

Commit

Permalink
IB/hfi1: Support ib_alloc_mr verb
Browse files Browse the repository at this point in the history
Ported from upstream qib commit
68c02e232b8a ("qib: Support ib_alloc_mr verb")

Tested-by: Jubin John <jubin.john@intel.com>
Reviewed-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Mike Marciniszyn authored and Doug Ledford committed Aug 30, 2015
1 parent 1302f84 commit d9fe6dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions drivers/staging/rdma/hfi1/mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,16 @@ int hfi1_dereg_mr(struct ib_mr *ibmr)
*
* 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;

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/rdma/hfi1/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion drivers/staging/rdma/hfi1/verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d9fe6dd

Please sign in to comment.