Skip to content

Commit

Permalink
IB/core: Drop ib_alloc_fast_reg_mr
Browse files Browse the repository at this point in the history
Fully replaced by a more generic and suitable
ib_alloc_mr.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Sagi Grimberg authored and Doug Ledford committed Aug 30, 2015
1 parent d9fe6dd commit d9f272c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 40 deletions.
32 changes: 3 additions & 29 deletions drivers/infiniband/core/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,36 +1253,10 @@ struct ib_mr *ib_alloc_mr(struct ib_pd *pd,
{
struct ib_mr *mr;

if (pd->device->alloc_mr) {
mr = pd->device->alloc_mr(pd, mr_type, max_num_sg);
} else {
if (mr_type != IB_MR_TYPE_MEM_REG ||
!pd->device->alloc_fast_reg_mr)
return ERR_PTR(-ENOSYS);
mr = pd->device->alloc_fast_reg_mr(pd, max_num_sg);
}

if (!IS_ERR(mr)) {
mr->device = pd->device;
mr->pd = pd;
mr->uobject = NULL;
atomic_inc(&pd->usecnt);
atomic_set(&mr->usecnt, 0);
}

return mr;
}
EXPORT_SYMBOL(ib_alloc_mr);

struct ib_mr *ib_alloc_fast_reg_mr(struct ib_pd *pd, int max_page_list_len)
{
struct ib_mr *mr;

if (!pd->device->alloc_fast_reg_mr)
if (!pd->device->alloc_mr)
return ERR_PTR(-ENOSYS);

mr = pd->device->alloc_fast_reg_mr(pd, max_page_list_len);

mr = pd->device->alloc_mr(pd, mr_type, max_num_sg);
if (!IS_ERR(mr)) {
mr->device = pd->device;
mr->pd = pd;
Expand All @@ -1293,7 +1267,7 @@ struct ib_mr *ib_alloc_fast_reg_mr(struct ib_pd *pd, int max_page_list_len)

return mr;
}
EXPORT_SYMBOL(ib_alloc_fast_reg_mr);
EXPORT_SYMBOL(ib_alloc_mr);

struct ib_fast_reg_page_list *ib_alloc_fast_reg_page_list(struct ib_device *device,
int max_page_list_len)
Expand Down
11 changes: 0 additions & 11 deletions include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1672,8 +1672,6 @@ struct ib_device {
struct ib_mr * (*alloc_mr)(struct ib_pd *pd,
enum ib_mr_type mr_type,
u32 max_num_sg);
struct ib_mr * (*alloc_fast_reg_mr)(struct ib_pd *pd,
int max_page_list_len);
struct ib_fast_reg_page_list * (*alloc_fast_reg_page_list)(struct ib_device *device,
int page_list_len);
void (*free_fast_reg_page_list)(struct ib_fast_reg_page_list *page_list);
Expand Down Expand Up @@ -2820,15 +2818,6 @@ struct ib_mr *ib_alloc_mr(struct ib_pd *pd,
enum ib_mr_type mr_type,
u32 max_num_sg);

/**
* ib_alloc_fast_reg_mr - Allocates memory region usable with the
* IB_WR_FAST_REG_MR send work request.
* @pd: The protection domain associated with the region.
* @max_page_list_len: requested max physical buffer list length to be
* used with fast register work requests for this MR.
*/
struct ib_mr *ib_alloc_fast_reg_mr(struct ib_pd *pd, int max_page_list_len);

/**
* ib_alloc_fast_reg_page_list - Allocates a page list array
* @device - ib device pointer.
Expand Down

0 comments on commit d9f272c

Please sign in to comment.