public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	jgg-uk2M96/98Pc@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH for-next 2/6] RDMA/hns: Update the usage of sr_max and rr_max field
Date: Mon, 25 Dec 2017 11:41:12 +0200	[thread overview]
Message-ID: <20171225094112.GA2942@mtr-leonro.local> (raw)
In-Reply-To: <1514017342-91468-3-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3482 bytes --]

On Sat, Dec 23, 2017 at 04:22:18PM +0800, Lijun Ou wrote:
> This patch fixes the usage with sr_max filed and rr_max of qp
> context when modify qp. Its modifications include:
> 1. Adjust location of filling sr_max filed of qpc
> 2. Only assign the number of responder resource if
>    IB_QP_MAX_DEST_RD_ATOMIC bit is set
> 3. Only assign the number of outstanding resource if
>    IB_QP_MAX_QP_RD_ATOMIC
> 4. Fix the assgin algorithms for the field of sr_max
>    and rr_max of qp context
>
> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 33 ++++++++++++++++++++----------
>  1 file changed, 22 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index b17dcfa..092f133 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -2531,11 +2531,17 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
>  		roce_set_bit(qpc_mask->byte_28_at_fl, V2_QPC_BYTE_28_LBI_S, 0);
>  	}
>
> -	roce_set_field(context->byte_140_raq, V2_QPC_BYTE_140_RR_MAX_M,
> -		       V2_QPC_BYTE_140_RR_MAX_S,
> -		       ilog2((unsigned int)attr->max_dest_rd_atomic));
> -	roce_set_field(qpc_mask->byte_140_raq, V2_QPC_BYTE_140_RR_MAX_M,
> -		       V2_QPC_BYTE_140_RR_MAX_S, 0);
> +	if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) {
> +		if (attr->max_dest_rd_atomic) {

if ((attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) && attr->max_dest_rd_atomic) {



> +			roce_set_field(context->byte_140_raq,
> +				       V2_QPC_BYTE_140_RR_MAX_M,
> +				       V2_QPC_BYTE_140_RR_MAX_S,
> +				       fls(attr->max_dest_rd_atomic - 1));
> +			roce_set_field(qpc_mask->byte_140_raq,
> +				       V2_QPC_BYTE_140_RR_MAX_M,
> +				       V2_QPC_BYTE_140_RR_MAX_S, 0);
> +		}
> +	}
>
>  	roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M,
>  		       V2_QPC_BYTE_56_DQPN_S, attr->dest_qp_num);
> @@ -2625,12 +2631,6 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
>  		       V2_QPC_BYTE_168_LP_SGEN_INI_M,
>  		       V2_QPC_BYTE_168_LP_SGEN_INI_S, 0);
>
> -	roce_set_field(context->byte_208_irrl, V2_QPC_BYTE_208_SR_MAX_M,
> -		       V2_QPC_BYTE_208_SR_MAX_S,
> -		       ilog2((unsigned int)attr->max_rd_atomic));
> -	roce_set_field(qpc_mask->byte_208_irrl, V2_QPC_BYTE_208_SR_MAX_M,
> -		       V2_QPC_BYTE_208_SR_MAX_S, 0);
> -
>  	roce_set_field(context->byte_28_at_fl, V2_QPC_BYTE_28_SL_M,
>  		       V2_QPC_BYTE_28_SL_S, rdma_ah_get_sl(&attr->ah_attr));
>  	roce_set_field(qpc_mask->byte_28_at_fl, V2_QPC_BYTE_28_SL_M,
> @@ -2834,6 +2834,17 @@ static int modify_qp_rtr_to_rts(struct ib_qp *ibqp,
>  	roce_set_field(qpc_mask->byte_196_sq_psn, V2_QPC_BYTE_196_SQ_MAX_PSN_M,
>  		       V2_QPC_BYTE_196_SQ_MAX_PSN_S, 0);
>
> +	if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC) {
> +		if (attr->max_rd_atomic) {
> +			roce_set_field(context->byte_208_irrl,
> +				       V2_QPC_BYTE_208_SR_MAX_M,
> +				       V2_QPC_BYTE_208_SR_MAX_S,
> +				       fls(attr->max_rd_atomic - 1));
> +			roce_set_field(qpc_mask->byte_208_irrl,
> +				       V2_QPC_BYTE_208_SR_MAX_M,
> +				       V2_QPC_BYTE_208_SR_MAX_S, 0);
> +		}
> +	}
>  	return 0;
>  }
>
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-12-25  9:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-23  8:22 [PATCH for-next 0/6] Add rq inline and bugfixes for hns Lijun Ou
     [not found] ` <1514017342-91468-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-12-23  8:22   ` [PATCH for-next 1/6] RDMA/hns: Add rq inline data support for hip08 RoCE Lijun Ou
     [not found]     ` <1514017342-91468-2-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-12-25  9:34       ` Leon Romanovsky
     [not found]         ` <20171225093448.GZ2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-26  9:04           ` oulijun
2017-12-23  8:22   ` [PATCH for-next 2/6] RDMA/hns: Update the usage of sr_max and rr_max field Lijun Ou
     [not found]     ` <1514017342-91468-3-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-12-25  9:41       ` Leon Romanovsky [this message]
     [not found]         ` <20171225094112.GA2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-25 10:14           ` oulijun
2017-12-23  8:22   ` [PATCH for-next 3/6] RDMA/hns: Set access flags of hip08 RoCE Lijun Ou
2017-12-23  8:22   ` [PATCH for-next 4/6] RDMA/hns: Filter for zero length of sge in hip08 kernel mode Lijun Ou
     [not found]     ` <1514017342-91468-5-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-12-25  9:00       ` Leon Romanovsky
     [not found]         ` <20171225090028.GY2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-25 10:08           ` oulijun
     [not found]             ` <42e22cc6-f385-b6f4-bd14-1450ae19519a-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-12-25 10:20               ` Leon Romanovsky
     [not found]                 ` <20171225102045.GC2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-26  9:19                   ` oulijun
2017-12-23  8:22   ` [PATCH for-next 5/6] RDMA/hns: Fix QP state judgement before sending work requests Lijun Ou
2017-12-23  8:22   ` [PATCH for-next 6/6] RDMA/hns: Assign dest_qp when deregistering mr Lijun Ou

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=20171225094112.GA2942@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jgg-uk2M96/98Pc@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oulijun-hv44wF8Li93QT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox