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,
	jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH rdma-core 2/3] libhns: Modify the usage of cmd_sn in hip08 RoCE userspace
Date: Wed, 1 Nov 2017 12:06:56 +0200	[thread overview]
Message-ID: <20171101100656.GR16127@mtr-leonro.local> (raw)
In-Reply-To: <1509530440-164400-3-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

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

On Wed, Nov 01, 2017 at 06:00:39PM +0800, Lijun Ou wrote:
> The cmd_sn field of CQ doorbell should be 1 for the first
> db rung. It inits for 0. It should be increment on each
> first db rung after a complemention Event.
>
> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
>  providers/hns/hns_roce_u_hw_v2.c | 4 +++-
>  providers/hns/hns_roce_u_hw_v2.h | 2 ++
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c
> index 900387c..7777e75 100644
> --- a/providers/hns/hns_roce_u_hw_v2.c
> +++ b/providers/hns/hns_roce_u_hw_v2.c
> @@ -444,11 +444,13 @@ static int hns_roce_u_v2_poll_cq(struct ibv_cq *ibvcq, int ne,
>  static int hns_roce_u_v2_arm_cq(struct ibv_cq *ibvcq, int solicited)
>  {
>  	uint32_t ci;
> +	uint32_t cmd_sn;
>  	uint32_t solicited_flag;
>  	struct hns_roce_v2_cq_db cq_db;
>  	struct hns_roce_cq *cq = to_hr_cq(ibvcq);
>
>  	ci  = cq->cons_index & ((cq->cq_depth << 1) - 1);
> +	cmd_sn = cq->arm_sn & HNS_ROCE_CMDSN_MASK;

I didn't understand it from you commit message, so I'll ask it here.
cmd_en will be 1,2 and 3 now, is it ok?

Thanks

>  	solicited_flag = solicited ? HNS_ROCE_V2_CQ_DB_REQ_SOL :
>  				     HNS_ROCE_V2_CQ_DB_REQ_NEXT;
>
> @@ -462,7 +464,7 @@ static int hns_roce_u_v2_arm_cq(struct ibv_cq *ibvcq, int solicited)
>  		       CQ_DB_PARAMETER_CQ_CONSUMER_IDX_S, ci);
>
>  	roce_set_field(cq_db.parameter, CQ_DB_PARAMETER_CMD_SN_M,
> -		       CQ_DB_PARAMETER_CMD_SN_S, 1);
> +		       CQ_DB_PARAMETER_CMD_SN_S, cmd_sn);
>  	roce_set_bit(cq_db.parameter, CQ_DB_PARAMETER_NOTIFY_S, solicited_flag);
>
>  	hns_roce_write64((uint32_t *)&cq_db, to_hr_ctx(ibvcq->context),
> diff --git a/providers/hns/hns_roce_u_hw_v2.h b/providers/hns/hns_roce_u_hw_v2.h
> index 28aab60..196ba4e 100644
> --- a/providers/hns/hns_roce_u_hw_v2.h
> +++ b/providers/hns/hns_roce_u_hw_v2.h
> @@ -38,6 +38,8 @@
>  #define HNS_ROCE_V2_CQ_DB_REQ_SOL		1
>  #define HNS_ROCE_V2_CQ_DB_REQ_NEXT		0
>
> +#define HNS_ROCE_CMDSN_MASK			0x3
> +
>  /* V2 REG DEFINITION */
>  #define ROCEE_VF_DB_CFG0_OFFSET			0x0230
>
> --
> 1.9.1
>

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

  parent reply	other threads:[~2017-11-01 10:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 10:00 [PATCH rdma-core 0/3] Bugfixes for hip08 libhns Lijun Ou
     [not found] ` <1509530440-164400-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-01 10:00   ` [PATCH rdma-core 1/3] libhns: Set owner bit of SQWQE in user mode Lijun Ou
2017-11-01 10:00   ` [PATCH rdma-core 2/3] libhns: Modify the usage of cmd_sn in hip08 RoCE userspace Lijun Ou
     [not found]     ` <1509530440-164400-3-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-01 10:06       ` Leon Romanovsky [this message]
     [not found]         ` <20171101100656.GR16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-01 11:16           ` oulijun
2017-11-01 10:00   ` [PATCH rdma-core 3/3] libhns: Fix endian format of payload and immediate Lijun Ou
     [not found]     ` <1509530440-164400-4-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-01 16:13       ` Jason Gunthorpe
     [not found]         ` <20171101161328.GB7815-uk2M96/98Pc@public.gmane.org>
2017-11-02  3:31           ` oulijun
     [not found]             ` <774e90ab-cab5-2798-42ae-3488623f4b92-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-02  4:40               ` Jason Gunthorpe
2017-11-02  6:03           ` oulijun
     [not found]             ` <8dbc8305-f154-3b8c-795a-b5f1a6b53c73-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-02 15:06               ` Jason Gunthorpe
     [not found]                 ` <20171102150655.GD18874-uk2M96/98Pc@public.gmane.org>
2017-11-08  2:05                   ` oulijun
     [not found]                     ` <b2e9430c-a801-bef1-a491-8f983a525cab-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-10 21:18                       ` Jason Gunthorpe
     [not found]                         ` <20171110211818.GH17451-uk2M96/98Pc@public.gmane.org>
2017-11-15 10:02                           ` oulijun
     [not found]                             ` <ef20c38b-201c-a039-c7c4-c5878fd0ee1c-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-15 15:34                               ` Jason Gunthorpe
     [not found]                                 ` <20171115153436.GO25894-uk2M96/98Pc@public.gmane.org>
2017-11-16  5:52                                   ` oulijun
     [not found]                                     ` <2ff6455b-0ac4-3ca7-b780-8224bf00bc35-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-16 18:12                                       ` Jason Gunthorpe
2017-11-04 10:08           ` Leon Romanovsky
     [not found]             ` <20171104100846.GA1636-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-06  1:43               ` oulijun
     [not found]                 ` <7dba9ad9-5a71-c4fe-b2b9-ccc35c188f8c-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-06  2:09                   ` Jason Gunthorpe
     [not found]                     ` <20171106020945.GA26011-uk2M96/98Pc@public.gmane.org>
2017-11-07 10:59                       ` oulijun
     [not found]                         ` <2622b4b1-5bc4-ec04-c9a4-d78d5a727f4c-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-07 11:27                           ` Leon Romanovsky
2017-11-07 15:41                           ` Jason Gunthorpe

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=20171101100656.GR16127@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@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