From: Shiraz Saleem <shiraz.saleem@intel.com>
To: jgg@nvidia.com
Cc: linux-rdma@vger.kernel.org, Nayan Kumar <nayan.kumar@intel.com>,
Shiraz Saleem <shiraz.saleem@intel.com>
Subject: [PATCH for-next 4/7] RDMA/irdma: Make resource distribution algorithm more QP oriented
Date: Tue, 5 Jul 2022 18:08:12 -0500 [thread overview]
Message-ID: <20220705230815.265-5-shiraz.saleem@intel.com> (raw)
In-Reply-To: <20220705230815.265-1-shiraz.saleem@intel.com>
From: Nayan Kumar <nayan.kumar@intel.com>
Adapt the resource distribution algorithm in irdma_cfg_fpm_val to be more
QP oriented. If the configuration is too big for the available memory,
trim the MR and PBLE's first before trimming the QPs. This also avoids
having to double QPs requested as input to algorithm for GEN1 devices.
Signed-off-by: Nayan Kumar <nayan.kumar@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
drivers/infiniband/hw/irdma/ctrl.c | 8 +++++---
drivers/infiniband/hw/irdma/hw.c | 5 +----
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/ctrl.c b/drivers/infiniband/hw/irdma/ctrl.c
index 58c0e18..a41e0d2 100644
--- a/drivers/infiniband/hw/irdma/ctrl.c
+++ b/drivers/infiniband/hw/irdma/ctrl.c
@@ -4872,10 +4872,12 @@ int irdma_cfg_fpm_val(struct irdma_sc_dev *dev, u32 qp_count)
sd_diff = sd_needed - hmc_fpm_misc->max_sds;
if (sd_diff > 128) {
- if (qpwanted > 128 && sd_diff > 144)
+ if (!(loop_count % 2) && qpwanted > 128) {
qpwanted /= 2;
- mrwanted /= 2;
- pblewanted /= 2;
+ } else {
+ mrwanted /= 2;
+ pblewanted /= 2;
+ }
continue;
}
if (dev->cqp->hmc_profile != IRDMA_HMC_PROFILE_FAVOR_VF &&
diff --git a/drivers/infiniband/hw/irdma/hw.c b/drivers/infiniband/hw/irdma/hw.c
index bb60431..8abbd50 100644
--- a/drivers/infiniband/hw/irdma/hw.c
+++ b/drivers/infiniband/hw/irdma/hw.c
@@ -1512,10 +1512,7 @@ static int irdma_hmc_setup(struct irdma_pci_f *rf)
int status;
u32 qpcnt;
- if (rf->rdma_ver == IRDMA_GEN_1)
- qpcnt = rsrc_limits_table[rf->limits_sel].qplimit * 2;
- else
- qpcnt = rsrc_limits_table[rf->limits_sel].qplimit;
+ qpcnt = rsrc_limits_table[rf->limits_sel].qplimit;
rf->sd_type = IRDMA_SD_TYPE_DIRECT;
status = irdma_cfg_fpm_val(&rf->sc_dev, qpcnt);
--
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 ` [PATCH for-next 1/7] RDMA/irdma: Add 2 level PBLE support for FMR Shiraz Saleem
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 ` Shiraz Saleem [this message]
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-5-shiraz.saleem@intel.com \
--to=shiraz.saleem@intel.com \
--cc=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=nayan.kumar@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