From a0513956ba6af07ae642ff85953ea919266573d4 Mon Sep 17 00:00:00 2001 From: sleybo Date: Wed, 13 Dec 2006 07:50:04 +0000 Subject: [PATCH] [MTHCA] return a real max_map_per_fmr git-svn-id: svn://openib.tc.cornell.edu/gen1@557 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/hw/mthca/kernel/mthca_provider.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/trunk/hw/mthca/kernel/mthca_provider.c b/trunk/hw/mthca/kernel/mthca_provider.c index 81f811e7..6618cec5 100644 --- a/trunk/hw/mthca/kernel/mthca_provider.c +++ b/trunk/hw/mthca/kernel/mthca_provider.c @@ -128,6 +128,17 @@ int mthca_query_device(struct ib_device *ibdev, props->max_total_mcast_qp_attach = props->max_mcast_qp_attach * props->max_mcast_grp; + /* + * If Sinai memory key optimization is being used, then only + * the 8-bit key portion will change. For other HCAs, the + * unused index bits will also be used for FMR remapping. + */ + if (mdev->mthca_flags & MTHCA_FLAG_SINAI_OPT) + props->max_map_per_fmr = 255; + else + props->max_map_per_fmr = + (1 << (32 - long_log2(mdev->limits.num_mpts))) - 1; + err = 0; out: kfree(in_mad); -- 2.41.0