Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21923
b: refs/heads/master
c: d36f34a
h: refs/heads/master
i:
  21921: a68019c
  21919: 51358f9
v: v3
  • Loading branch information
Or Gerlitz authored and Roland Dreier committed Mar 20, 2006
1 parent 293e046 commit 2cdf70a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6dfc3901b04d1b79fa982d6de6d5af3b50c6cea8
refs/heads/master: d36f34aadf184d8cc4c240de2b6319ccea8334bb
6 changes: 3 additions & 3 deletions trunk/drivers/infiniband/core/fmr_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
{
struct ib_pool_fmr *fmr;
struct ib_fmr_attr attr = {
.max_pages = params->max_pages_per_fmr,
.max_maps = IB_FMR_MAX_REMAPS,
.page_size = PAGE_SHIFT
.max_pages = params->max_pages_per_fmr,
.max_maps = IB_FMR_MAX_REMAPS,
.page_shift = params->page_shift
};

for (i = 0; i < params->pool_size; ++i) {
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/infiniband/hw/mthca/mthca_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ int mthca_fmr_alloc(struct mthca_dev *dev, u32 pd,
int err = -ENOMEM;
int i;

if (mr->attr.page_size < 12 || mr->attr.page_size >= 32)
if (mr->attr.page_shift < 12 || mr->attr.page_shift >= 32)
return -EINVAL;

/* For Arbel, all MTTs must fit in the same page. */
Expand Down Expand Up @@ -543,7 +543,7 @@ int mthca_fmr_alloc(struct mthca_dev *dev, u32 pd,
MTHCA_MPT_FLAG_REGION |
access);

mpt_entry->page_size = cpu_to_be32(mr->attr.page_size - 12);
mpt_entry->page_size = cpu_to_be32(mr->attr.page_shift - 12);
mpt_entry->key = cpu_to_be32(key);
mpt_entry->pd = cpu_to_be32(pd);
memset(&mpt_entry->start, 0,
Expand Down Expand Up @@ -611,7 +611,7 @@ static inline int mthca_check_fmr(struct mthca_fmr *fmr, u64 *page_list,
if (list_len > fmr->attr.max_pages)
return -EINVAL;

page_mask = (1 << fmr->attr.page_size) - 1;
page_mask = (1 << fmr->attr.page_shift) - 1;

/* We are getting page lists, so va must be page aligned. */
if (iova & page_mask)
Expand Down Expand Up @@ -659,7 +659,7 @@ int mthca_tavor_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list,
}

mpt_entry.lkey = cpu_to_be32(key);
mpt_entry.length = cpu_to_be64(list_len * (1ull << fmr->attr.page_size));
mpt_entry.length = cpu_to_be64(list_len * (1ull << fmr->attr.page_shift));
mpt_entry.start = cpu_to_be64(iova);

__raw_writel((__force u32) mpt_entry.lkey, &fmr->mem.tavor.mpt->key);
Expand Down Expand Up @@ -700,7 +700,7 @@ int mthca_arbel_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list,

fmr->mem.arbel.mpt->key = cpu_to_be32(key);
fmr->mem.arbel.mpt->lkey = cpu_to_be32(key);
fmr->mem.arbel.mpt->length = cpu_to_be64(list_len * (1ull << fmr->attr.page_size));
fmr->mem.arbel.mpt->length = cpu_to_be64(list_len * (1ull << fmr->attr.page_shift));
fmr->mem.arbel.mpt->start = cpu_to_be64(iova);

wmb();
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/rdma/ib_fmr_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct ib_fmr_pool;
/**
* struct ib_fmr_pool_param - Parameters for creating FMR pool
* @max_pages_per_fmr:Maximum number of pages per map request.
* @page_shift: Log2 of sizeof "pages" mapped by this fmr
* @access:Access flags for FMRs in pool.
* @pool_size:Number of FMRs to allocate for pool.
* @dirty_watermark:Flush is triggered when @dirty_watermark dirty
Expand All @@ -55,6 +56,7 @@ struct ib_fmr_pool;
*/
struct ib_fmr_pool_param {
int max_pages_per_fmr;
int page_shift;
enum ib_access_flags access;
int pool_size;
int dirty_watermark;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ struct ib_mw_bind {
struct ib_fmr_attr {
int max_pages;
int max_maps;
u8 page_size;
u8 page_shift;
};

struct ib_ucontext {
Expand Down

0 comments on commit 2cdf70a

Please sign in to comment.