lkml.org 
[lkml]   [2021]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.14 142/432] RDMA/hns: Fix query destination qpn
    Date
    From: Wenpeng Liang <liangwenpeng@huawei.com>

    [ Upstream commit e788a3cd5787aca74e0ee00202d4dca64b43f043 ]

    The bit width of dqpn is 24 bits, using u8 will cause truncation error.

    Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC")
    Link: https://lore.kernel.org/r/1629985056-57004-2-git-send-email-liangwenpeng@huawei.com
    Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
    index 21c82f5aff04..bf4d9f6658ff 100644
    --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
    +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
    @@ -5136,7 +5136,7 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,

    qp_attr->rq_psn = hr_reg_read(&context, QPC_RX_REQ_EPSN);
    qp_attr->sq_psn = (u32)hr_reg_read(&context, QPC_SQ_CUR_PSN);
    - qp_attr->dest_qp_num = (u8)hr_reg_read(&context, QPC_DQPN);
    + qp_attr->dest_qp_num = hr_reg_read(&context, QPC_DQPN);
    qp_attr->qp_access_flags =
    ((hr_reg_read(&context, QPC_RRE)) << V2_QP_RRE_S) |
    ((hr_reg_read(&context, QPC_RWE)) << V2_QP_RWE_S) |
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-09-16 19:26    [W:4.035 / U:0.188 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site