Skip to content

Commit

Permalink
RDMA/hns: Bugfix for the missing assignment for dip_idx
Browse files Browse the repository at this point in the history
When the dgid-dip_idx mapping relationship exists, dip should be assigned.

Fixes: f91696f ("RDMA/hns: Support congestion control type selection according to the FW")
Link: https://lore.kernel.org/r/1629884592-23424-3-git-send-email-liangwenpeng@huawei.com
Signed-off-by: Junxian Huang <huangjunxian4@hisilicon.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Junxian Huang authored and Jason Gunthorpe committed Aug 25, 2021
1 parent 4303e61 commit 074f315
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/infiniband/hw/hns/hns_roce_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4508,8 +4508,10 @@ static int get_dip_ctx_idx(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
spin_lock_irqsave(&hr_dev->dip_list_lock, flags);

list_for_each_entry(hr_dip, &hr_dev->dip_list, node) {
if (!memcmp(grh->dgid.raw, hr_dip->dgid, 16))
if (!memcmp(grh->dgid.raw, hr_dip->dgid, 16)) {
*dip_idx = hr_dip->dip_idx;
goto out;
}
}

/* If no dgid is found, a new dip and a mapping between dgid and
Expand Down

0 comments on commit 074f315

Please sign in to comment.