[ofa-general] [PATCH] mlx4_core: Support creation of FMRs with pages smaller than 4K
Jack Morgenstein
jackm at dev.mellanox.co.il
Mon May 5 08:20:49 PDT 2008
From: Oren Duer <oren at mellanox.co.il>
mlx4_core: Support creation of FMRs with pages smaller than 4K
Actual smallest page size is given by device capabilities.
Signed-off-by: Oren Duer <oren at mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>
---
Roland,
The device minimum page size should be taken from the device
capabilities, and not hard-coded. This hard-coding has lead
to problems with new mlx4 firmware.
This is for your 2.6.26 git tree.
Jack
diff --git a/drivers/net/mlx4/mr.c b/drivers/net/mlx4/mr.c
index 79b317b..7123463 100644
--- a/drivers/net/mlx4/mr.c
+++ b/drivers/net/mlx4/mr.c
@@ -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 */
More information about the general
mailing list