From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Hariprasad Shenai
<hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH for-next] iw_cxgb4: Max fastreg depth depends on DSGL support
Date: Thu, 18 Feb 2016 12:32:08 -0500 [thread overview]
Message-ID: <56C60018.4050800@redhat.com> (raw)
In-Reply-To: <1455273635-30410-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3844 bytes --]
On 2/12/2016 5:40 AM, Hariprasad Shenai wrote:
> The max depth of a fastreg mr depends on whether the device supports
> DSGL or not. So compute it dynamically based on the device support and
> the module use_dsgl option.
>
> Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> Signed-off-by: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Thanks, applied.
> ---
> drivers/infiniband/hw/cxgb4/mem.c | 8 +++++---
> drivers/infiniband/hw/cxgb4/provider.c | 3 ++-
> drivers/infiniband/hw/cxgb4/qp.c | 10 ++++------
> 3 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
> index 7849890c4781..9274c909cd19 100644
> --- a/drivers/infiniband/hw/cxgb4/mem.c
> +++ b/drivers/infiniband/hw/cxgb4/mem.c
> @@ -617,12 +617,14 @@ struct ib_mr *c4iw_alloc_mr(struct ib_pd *pd,
> int ret = 0;
> int length = roundup(max_num_sg * sizeof(u64), 32);
>
> + php = to_c4iw_pd(pd);
> + rhp = php->rhp;
> +
> if (mr_type != IB_MR_TYPE_MEM_REG ||
> - max_num_sg > t4_max_fr_depth(use_dsgl))
> + max_num_sg > t4_max_fr_depth(&rhp->rdev.lldi.ulptx_memwrite_dsgl &&
> + use_dsgl))
> return ERR_PTR(-EINVAL);
>
> - php = to_c4iw_pd(pd);
> - rhp = php->rhp;
> mhp = kzalloc(sizeof(*mhp), GFP_KERNEL);
> if (!mhp) {
> ret = -ENOMEM;
> diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
> index ec04272fbdc2..8669f48ebd8e 100644
> --- a/drivers/infiniband/hw/cxgb4/provider.c
> +++ b/drivers/infiniband/hw/cxgb4/provider.c
> @@ -339,7 +339,8 @@ static int c4iw_query_device(struct ib_device *ibdev, struct ib_device_attr *pro
> props->max_mr = c4iw_num_stags(&dev->rdev);
> props->max_pd = T4_MAX_NUM_PD;
> props->local_ca_ack_delay = 0;
> - props->max_fast_reg_page_list_len = t4_max_fr_depth(use_dsgl);
> + props->max_fast_reg_page_list_len =
> + t4_max_fr_depth(dev->rdev.lldi.ulptx_memwrite_dsgl && use_dsgl);
>
> return 0;
> }
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index dadf5f1855b3..d7293132ee86 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -606,7 +606,7 @@ static int build_rdma_recv(struct c4iw_qp *qhp, union t4_recv_wr *wqe,
> }
>
> static int build_memreg(struct t4_sq *sq, union t4_wr *wqe,
> - struct ib_reg_wr *wr, u8 *len16, u8 t5dev)
> + struct ib_reg_wr *wr, u8 *len16, bool dsgl_supported)
> {
> struct c4iw_mr *mhp = to_c4iw_mr(wr->mr);
> struct fw_ri_immd *imdp;
> @@ -615,7 +615,7 @@ static int build_memreg(struct t4_sq *sq, union t4_wr *wqe,
> int pbllen = roundup(mhp->mpl_len * sizeof(u64), 32);
> int rem;
>
> - if (mhp->mpl_len > t4_max_fr_depth(use_dsgl))
> + if (mhp->mpl_len > t4_max_fr_depth(dsgl_supported && use_dsgl))
> return -EINVAL;
>
> wqe->fr.qpbinde_to_dcacpu = 0;
> @@ -629,7 +629,7 @@ static int build_memreg(struct t4_sq *sq, union t4_wr *wqe,
> wqe->fr.va_lo_fbo = cpu_to_be32(mhp->ibmr.iova &
> 0xffffffff);
>
> - if (t5dev && use_dsgl && (pbllen > max_fr_immd)) {
> + if (dsgl_supported && use_dsgl && (pbllen > max_fr_immd)) {
> struct fw_ri_dsgl *sglp;
>
> for (i = 0; i < mhp->mpl_len; i++)
> @@ -808,9 +808,7 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
> fw_opcode = FW_RI_FR_NSMR_WR;
> swsqe->opcode = FW_RI_FAST_REGISTER;
> err = build_memreg(&qhp->wq.sq, wqe, reg_wr(wr), &len16,
> - is_t5(
> - qhp->rhp->rdev.lldi.adapter_type) ?
> - 1 : 0);
> + qhp->rhp->rdev.lldi.ulptx_memwrite_dsgl);
> break;
> case IB_WR_LOCAL_INV:
> if (wr->send_flags & IB_SEND_FENCE)
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
prev parent reply other threads:[~2016-02-18 17:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 10:40 [PATCH for-next] iw_cxgb4: Max fastreg depth depends on DSGL support Hariprasad Shenai
[not found] ` <1455273635-30410-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-18 17:32 ` Doug Ledford [this message]
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=56C60018.4050800@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.