diff mbox

[for-next,18/20] IB/hns: Update the rq head when modify qp state

Message ID 1473417051-99560-19-git-send-email-salil.mehta@huawei.com (mailing list archive)
State Superseded
Headers show

Commit Message

Salil Mehta Sept. 9, 2016, 10:30 a.m. UTC
From: Lijun Ou <oulijun@huawei.com>

The rq head in qpc was zero will miss the rq wqes which
have be sent, so here we should take the real value.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Leon Romanovsky Sept. 15, 2016, 10:12 a.m. UTC | #1
On Fri, Sep 09, 2016 at 06:30:49PM +0800, Salil Mehta wrote:
> From: Lijun Ou <oulijun@huawei.com>
>
> The rq head in qpc was zero will miss the rq wqes which
> have be sent, so here we should take the real value.
>
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
> Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> index bdd9453..7a61d7e 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> @@ -2266,7 +2266,8 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
>
>  		roce_set_field(context->qpc_bytes_68,
>  			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
> -			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
> +			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
> +			       hr_qp->rq.head);

Are you sure that it should be list_head and not value?

>  		roce_set_field(context->qpc_bytes_68,
>  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
>  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S, 0);
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Salil Mehta Sept. 20, 2016, 4:56 p.m. UTC | #2
> -----Original Message-----
> From: Leon Romanovsky [mailto:leon@kernel.org]
> Sent: Thursday, September 15, 2016 11:13 AM
> To: Salil Mehta
> Cc: dledford@redhat.com; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> xuwei (O); mehta.salil.lnk@gmail.com; linux-rdma@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm
> Subject: Re: [PATCH for-next 18/20] IB/hns: Update the rq head when
> modify qp state
> 
> On Fri, Sep 09, 2016 at 06:30:49PM +0800, Salil Mehta wrote:
> > From: Lijun Ou <oulijun@huawei.com>
> >
> > The rq head in qpc was zero will miss the rq wqes which
> > have be sent, so here we should take the real value.
> >
> > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > ---
> >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > index bdd9453..7a61d7e 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > @@ -2266,7 +2266,8 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp,
> const struct ib_qp_attr *attr,
> >
> >  		roce_set_field(context->qpc_bytes_68,
> >  			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
> > -			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
> > +			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
> > +			       hr_qp->rq.head);
> 
> Are you sure that it should be list_head and not value?
This is correct. Variable head is not list_head but a u32 value. 
Hope I understood your point correctly.

Best regards
Salil
> 
> >  		roce_set_field(context->qpc_bytes_68,
> >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
> >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S, 0);
> > --
> > 1.7.9.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky Sept. 20, 2016, 5:05 p.m. UTC | #3
On Tue, Sep 20, 2016 at 04:56:35PM +0000, Salil Mehta wrote:
>
>
> > -----Original Message-----
> > From: Leon Romanovsky [mailto:leon@kernel.org]
> > Sent: Thursday, September 15, 2016 11:13 AM
> > To: Salil Mehta
> > Cc: dledford@redhat.com; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> > xuwei (O); mehta.salil.lnk@gmail.com; linux-rdma@vger.kernel.org;
> > linux-kernel@vger.kernel.org; Linuxarm
> > Subject: Re: [PATCH for-next 18/20] IB/hns: Update the rq head when
> > modify qp state
> >
> > On Fri, Sep 09, 2016 at 06:30:49PM +0800, Salil Mehta wrote:
> > > From: Lijun Ou <oulijun@huawei.com>
> > >
> > > The rq head in qpc was zero will miss the rq wqes which
> > > have be sent, so here we should take the real value.
> > >
> > > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > > Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > > ---
> > >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > index bdd9453..7a61d7e 100644
> > > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > @@ -2266,7 +2266,8 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp,
> > const struct ib_qp_attr *attr,
> > >
> > >  		roce_set_field(context->qpc_bytes_68,
> > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
> > > -			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
> > > +			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
> > > +			       hr_qp->rq.head);
> >
> > Are you sure that it should be list_head and not value?
> This is correct. Variable head is not list_head but a u32 value.
> Hope I understood your point correctly.

Thanks, you understood me right.
The name "head" mislead me.
Sorry for that.

>
> Best regards
> Salil
> >
> > >  		roce_set_field(context->qpc_bytes_68,
> > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
> > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S, 0);
> > > --
> > > 1.7.9.5
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> > in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
Salil Mehta Sept. 20, 2016, 5:49 p.m. UTC | #4
> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
> owner@vger.kernel.org] On Behalf Of Leon Romanovsky
> Sent: Tuesday, September 20, 2016 6:06 PM
> To: Salil Mehta
> Cc: dledford@redhat.com; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> xuwei (O); mehta.salil.lnk@gmail.com; linux-rdma@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm
> Subject: Re: [PATCH for-next 18/20] IB/hns: Update the rq head when
> modify qp state
> 
> On Tue, Sep 20, 2016 at 04:56:35PM +0000, Salil Mehta wrote:
> >
> >
> > > -----Original Message-----
> > > From: Leon Romanovsky [mailto:leon@kernel.org]
> > > Sent: Thursday, September 15, 2016 11:13 AM
> > > To: Salil Mehta
> > > Cc: dledford@redhat.com; Huwei (Xavier); oulijun; Zhuangyuzeng
> (Yisen);
> > > xuwei (O); mehta.salil.lnk@gmail.com; linux-rdma@vger.kernel.org;
> > > linux-kernel@vger.kernel.org; Linuxarm
> > > Subject: Re: [PATCH for-next 18/20] IB/hns: Update the rq head when
> > > modify qp state
> > >
> > > On Fri, Sep 09, 2016 at 06:30:49PM +0800, Salil Mehta wrote:
> > > > From: Lijun Ou <oulijun@huawei.com>
> > > >
> > > > The rq head in qpc was zero will miss the rq wqes which
> > > > have be sent, so here we should take the real value.
> > > >
> > > > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > > > Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > > > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > > > ---
> > > >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > > index bdd9453..7a61d7e 100644
> > > > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > > @@ -2266,7 +2266,8 @@ static int hns_roce_v1_m_qp(struct ib_qp
> *ibqp,
> > > const struct ib_qp_attr *attr,
> > > >
> > > >  		roce_set_field(context->qpc_bytes_68,
> > > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
> > > > -			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
> > > > +			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
> > > > +			       hr_qp->rq.head);
> > >
> > > Are you sure that it should be list_head and not value?
> > This is correct. Variable head is not list_head but a u32 value.
> > Hope I understood your point correctly.
> 
> Thanks, you understood me right.
> The name "head" mislead me.
> Sorry for that.
No worries at all :)

Thanks
Salil
> 
> >
> > Best regards
> > Salil
> > >
> > > >  		roce_set_field(context->qpc_bytes_68,
> > > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
> > > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S,
> 0);
> > > > --
> > > > 1.7.9.5
> > > >
> > > > --
> > > > To unsubscribe from this list: send the line "unsubscribe linux-
> rdma"
> > > in
> > > > the body of a message to majordomo@vger.kernel.org
> > > > More majordomo info at  http://vger.kernel.org/majordomo-
> info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index bdd9453..7a61d7e 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -2266,7 +2266,8 @@  static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
 
 		roce_set_field(context->qpc_bytes_68,
 			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
-			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
+			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
+			       hr_qp->rq.head);
 		roce_set_field(context->qpc_bytes_68,
 			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
 			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S, 0);