lkml.org 
[lkml]   [2019]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 255/321] RDMA/hns: Fix the bug with updating rq head pointer when flush cqe
    Date
    From: Lijun Ou <oulijun@huawei.com>

    [ Upstream commit 9c6ccc035c209dda07685e8dba829a203ba17499 ]

    When flush cqe with srq, the driver disable to update the rq head pointer
    into the hardware.

    Signed-off-by: Lijun Ou <oulijun@huawei.com>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 10 +++++++---
    1 file changed, 7 insertions(+), 3 deletions(-)

    diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
    index 9e7923cf85773..1eda8a22a4252 100644
    --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
    +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
    @@ -3503,13 +3503,16 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp,
    roce_set_field(qpc_mask->byte_160_sq_ci_pi,
    V2_QPC_BYTE_160_SQ_PRODUCER_IDX_M,
    V2_QPC_BYTE_160_SQ_PRODUCER_IDX_S, 0);
    - roce_set_field(context->byte_84_rq_ci_pi,
    +
    + if (!ibqp->srq) {
    + roce_set_field(context->byte_84_rq_ci_pi,
    V2_QPC_BYTE_84_RQ_PRODUCER_IDX_M,
    V2_QPC_BYTE_84_RQ_PRODUCER_IDX_S,
    hr_qp->rq.head);
    - roce_set_field(qpc_mask->byte_84_rq_ci_pi,
    + roce_set_field(qpc_mask->byte_84_rq_ci_pi,
    V2_QPC_BYTE_84_RQ_PRODUCER_IDX_M,
    V2_QPC_BYTE_84_RQ_PRODUCER_IDX_S, 0);
    + }
    }

    if (attr_mask & IB_QP_AV) {
    @@ -3971,7 +3974,8 @@ static void hns_roce_set_qps_to_err(struct hns_roce_dev *hr_dev, u32 qpn)
    if (hr_qp->ibqp.uobject) {
    if (hr_qp->sdb_en == 1) {
    hr_qp->sq.head = *(int *)(hr_qp->sdb.virt_addr);
    - hr_qp->rq.head = *(int *)(hr_qp->rdb.virt_addr);
    + if (hr_qp->rdb_en == 1)
    + hr_qp->rq.head = *(int *)(hr_qp->rdb.virt_addr);
    } else {
    dev_warn(hr_dev->dev, "flush cqe is unsupported in userspace!\n");
    return;
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-12-03 23:57    [W:4.063 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site