summaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/main.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-10-09 19:59:16 -0700
committerRoland Dreier <rolandd@cisco.com>2007-10-09 19:59:16 -0700
commit121964ec38d3e17b5ea6183b3c0571df2f4b0eb6 (patch)
tree4146d90919dd8ccc2d363b879f8cdbed618a0abf /drivers/net/mlx4/main.c
parentcf78237d7b0e683d172e40b1e85b26ca49a3cdba (diff)
downloadlinux-121964ec38d3e17b5ea6183b3c0571df2f4b0eb6.tar.bz2
mlx4_core: Fix meaning of dev->caps.reserved_mtts
Everything that uses caps.reserved_mtts expects it to be a count of MTT segments, not MTT entries. So convert the value that the FW gives us to a count of segments. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/main.c')
-rw-r--r--drivers/net/mlx4/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 07c2847a7cc8..ed7e8d76cde0 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -149,7 +149,8 @@ static int __devinit mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev
dev->caps.max_cqes = dev_cap->max_cq_sz - 1;
dev->caps.reserved_cqs = dev_cap->reserved_cqs;
dev->caps.reserved_eqs = dev_cap->reserved_eqs;
- dev->caps.reserved_mtts = dev_cap->reserved_mtts;
+ dev->caps.reserved_mtts = DIV_ROUND_UP(dev_cap->reserved_mtts,
+ MLX4_MTT_ENTRY_PER_SEG);
dev->caps.reserved_mrws = dev_cap->reserved_mrws;
dev->caps.reserved_uars = dev_cap->reserved_uars;
dev->caps.reserved_pds = dev_cap->reserved_pds;