public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Shiraz Saleem <shiraz.saleem@intel.com>
Cc: jgg@nvidia.com, linux-rdma@vger.kernel.org,
	Sindhu Devale <sindhu.devale@intel.com>
Subject: Re: [PATCH for-next 1/2] RDMA/irdma: Allow accurate reporting on QP max send/recv WR
Date: Sun, 30 Jul 2023 15:42:22 +0300	[thread overview]
Message-ID: <20230730124222.GD94048@unreal> (raw)
In-Reply-To: <20230725155525.1081-2-shiraz.saleem@intel.com>

On Tue, Jul 25, 2023 at 10:55:24AM -0500, Shiraz Saleem wrote:
> From: Sindhu Devale <sindhu.devale@intel.com>
> 
> Currently the attribute cap.max_send_wr and cap.max_recv_wr
> sent from user-space during create QP are the provider computed
> SQ/RQ depth as opposed to raw values passed from application.
> This inhibits computation of an accurate value for max_send_wr
> and max_recv_wr for this QP in the kernel which matches the value
> returned in user create QP. Also these capabilities needs to be
> reported from the driver in query QP.
> 
> Add support by extending the ABI to allow the raw cap.max_send_wr and
> cap.max_recv_wr to be passed from user-space, while keeping compatibility
> for the older scheme.
> 
> The internal HW depth and shift needed for the WQs needs to be computed
> now for both kernel and user-mode QPs. Add new helpers to assist with this:
> irdma_uk_calc_depth_shift_sq, irdma_uk_calc_depth_shift_rq and
> irdma_uk_calc_depth_shift_wq.
> 
> Consolidate all the user mode QP setup into a new function
> irdma_setup_umode_qp which keeps it with its counterpart
> irdma_setup_kmode_qp.
> 
> Signed-off-by: Youvaraj Sagar <youvaraj.sagar@intel.com>
> Signed-off-by: Sindhu Devale <sindhu.devale@intel.com>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
>  drivers/infiniband/hw/irdma/uk.c    |  89 +++++++++++++++---
>  drivers/infiniband/hw/irdma/user.h  |  10 ++
>  drivers/infiniband/hw/irdma/verbs.c | 182 ++++++++++++++++++++++--------------
>  drivers/infiniband/hw/irdma/verbs.h |   3 +-
>  include/uapi/rdma/irdma-abi.h       |   6 ++
>  5 files changed, 203 insertions(+), 87 deletions(-)

Fixed and applied.

diff --git a/drivers/infiniband/hw/irdma/uk.c b/drivers/infiniband/hw/irdma/uk.c
index 2986aee3a429..ac650a784245 100644
--- a/drivers/infiniband/hw/irdma/uk.c
+++ b/drivers/infiniband/hw/irdma/uk.c
@@ -1427,7 +1427,7 @@ static void irdma_setup_connection_wqes(struct irdma_qp_uk *qp,
 void irdma_uk_calc_shift_wq(struct irdma_qp_uk_init_info *ukinfo, u8 *sq_shift,
                            u8 *rq_shift)
 {
-       bool imm_support = ukinfo->uk_attrs->hw_rev >= IRDMA_GEN_2 ? true : false;
+       bool imm_support = ukinfo->uk_attrs->hw_rev >= IRDMA_GEN_2;
 
        irdma_get_wqe_shift(ukinfo->uk_attrs,
                            imm_support ? ukinfo->max_sq_frag_cnt + 1 :
@@ -1452,7 +1452,7 @@ void irdma_uk_calc_shift_wq(struct irdma_qp_uk_init_info *ukinfo, u8 *sq_shift,
 int irdma_uk_calc_depth_shift_sq(struct irdma_qp_uk_init_info *ukinfo,
                                 u32 *sq_depth, u8 *sq_shift)
 {
-       bool imm_support = ukinfo->uk_attrs->hw_rev >= IRDMA_GEN_2 ? true : false;
+       bool imm_support = ukinfo->uk_attrs->hw_rev >= IRDMA_GEN_2;
        int status;
 
        irdma_get_wqe_shift(ukinfo->uk_attrs,
diff --git a/drivers/infiniband/hw/irdma/verbs.h b/drivers/infiniband/hw/irdma/verbs.h
index ebe8bdce2557..5d7b983f47a2 100644
--- a/drivers/infiniband/hw/irdma/verbs.h
+++ b/drivers/infiniband/hw/irdma/verbs.h
@@ -18,8 +18,8 @@ struct irdma_ucontext {
        struct list_head qp_reg_mem_list;
        spinlock_t qp_reg_mem_list_lock; /* protect QP memory list */
        int abi_ver;
-       bool legacy_mode:1;
-       bool use_raw_attrs:1;
+       u8 legacy_mode : 1;
+       u8 use_raw_attrs : 1;
 };
 
 struct irdma_pd {


  reply	other threads:[~2023-07-30 12:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 15:55 [PATCH for-next 0/2] RDMA/irdma: Use coherent user/kernel queue size Shiraz Saleem
2023-07-25 15:55 ` [PATCH for-next 1/2] RDMA/irdma: Allow accurate reporting on QP max send/recv WR Shiraz Saleem
2023-07-30 12:42   ` Leon Romanovsky [this message]
2023-07-25 15:55 ` [PATCH for-next 2/2] RDMA/irdma: Use HW specific minimum WQ size Shiraz Saleem
2023-07-27 23:13 ` [PATCH for-next 0/2] RDMA/irdma: Use coherent user/kernel queue size Saleem, Shiraz
2023-07-30 12:44 ` 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=20230730124222.GD94048@unreal \
    --to=leon@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=shiraz.saleem@intel.com \
    --cc=sindhu.devale@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