From: Shiraz Saleem <shiraz.saleem@intel.com>
To: jgg@nvidia.com
Cc: linux-rdma@vger.kernel.org,
Mustafa Ismail <mustafa.ismail@intel.com>,
Shiraz Saleem <shiraz.saleem@intel.com>
Subject: [PATCH for-next 1/7] RDMA/irdma: Add 2 level PBLE support for FMR
Date: Tue, 5 Jul 2022 18:08:09 -0500 [thread overview]
Message-ID: <20220705230815.265-2-shiraz.saleem@intel.com> (raw)
In-Reply-To: <20220705230815.265-1-shiraz.saleem@intel.com>
From: Mustafa Ismail <mustafa.ismail@intel.com>
Level 2 Physical Buffer List Entry (PBLE) is currently not supported for
Fast MRs which limits memory registrations to 256K pages.
Adapt irdma_set_page and irdma_alloc_mr to allow for 2 level PBLEs.
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
drivers/infiniband/hw/irdma/main.h | 2 +-
drivers/infiniband/hw/irdma/verbs.c | 14 +++++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/main.h b/drivers/infiniband/hw/irdma/main.h
index ef862bc..65e966a 100644
--- a/drivers/infiniband/hw/irdma/main.h
+++ b/drivers/infiniband/hw/irdma/main.h
@@ -85,7 +85,7 @@
#define IRDMA_NO_QSET 0xffff
#define IW_CFG_FPM_QP_COUNT 32768
-#define IRDMA_MAX_PAGES_PER_FMR 512
+#define IRDMA_MAX_PAGES_PER_FMR 262144
#define IRDMA_MIN_PAGES_PER_FMR 1
#define IRDMA_CQP_COMPL_RQ_WQE_FLUSHED 2
#define IRDMA_CQP_COMPL_SQ_WQE_FLUSHED 3
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index c4412ec..0f5856b 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -2605,7 +2605,7 @@ static struct ib_mr *irdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type,
palloc = &iwpbl->pble_alloc;
iwmr->page_cnt = max_num_sg;
err_code = irdma_get_pble(iwdev->rf->pble_rsrc, palloc, iwmr->page_cnt,
- true);
+ false);
if (err_code)
goto err_get_pble;
@@ -2641,8 +2641,16 @@ static int irdma_set_page(struct ib_mr *ibmr, u64 addr)
if (unlikely(iwmr->npages == iwmr->page_cnt))
return -ENOMEM;
- pbl = palloc->level1.addr;
- pbl[iwmr->npages++] = addr;
+ if (palloc->level == PBLE_LEVEL_2) {
+ struct irdma_pble_info *palloc_info =
+ palloc->level2.leaf + (iwmr->npages >> PBLE_512_SHIFT);
+
+ palloc_info->addr[iwmr->npages & (PBLE_PER_PAGE - 1)] = addr;
+ } else {
+ pbl = palloc->level1.addr;
+ pbl[iwmr->npages] = addr;
+ }
+ iwmr->npages++;
return 0;
}
--
1.8.3.1
next prev parent reply other threads:[~2022-07-05 23:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 23:08 [PATCH for-next 0/7] irdma for-next updates 7-5-2022 Shiraz Saleem
2022-07-05 23:08 ` Shiraz Saleem [this message]
2022-07-05 23:08 ` [PATCH for-next 2/7] RDMA/irdma: Add AE source to error log Shiraz Saleem
2022-07-05 23:08 ` [PATCH for-next 3/7] RDMA/irdma: Make CQP invalid state error non-critical Shiraz Saleem
2022-07-05 23:08 ` [PATCH for-next 4/7] RDMA/irdma: Make resource distribution algorithm more QP oriented Shiraz Saleem
2022-07-05 23:08 ` [PATCH for-next 5/7] RDMA/irdma: Fix a window for use-after-free Shiraz Saleem
2022-07-05 23:08 ` [PATCH for-next 6/7] RDMA/irdma: Fix VLAN connection with wildcard address Shiraz Saleem
2022-07-05 23:08 ` [PATCH for-next 7/7] RDMA/irdma: Fix setting of QP context err_rq_idx_valid field Shiraz Saleem
2022-07-18 7:41 ` [PATCH for-next 0/7] irdma for-next updates 7-5-2022 Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220705230815.265-2-shiraz.saleem@intel.com \
--to=shiraz.saleem@intel.com \
--cc=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox