Skip to content

Commit

Permalink
mlx4_core: Support creation of FMRs with pages smaller than 4K
Browse files Browse the repository at this point in the history
Don't hard code a test against a minimum page shift of 12, since the
device may support smaller pages.  Test against the actual smallest
page size from the device capabilities.

Signed-off-by: Oren Duer <oren@mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Oren Duer authored and Roland Dreier committed May 5, 2008
1 parent cf04690 commit c5057dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/mlx4/mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,
u64 mtt_seg;
int err = -ENOMEM;

if (page_shift < 12 || page_shift >= 32)
if (page_shift < (ffs(dev->caps.page_size_cap) - 1) || page_shift >= 32)
return -EINVAL;

/* All MTTs must fit in the same page */
Expand Down

0 comments on commit c5057dd

Please sign in to comment.