aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunxian Huang <[email protected]>2021-08-25 17:43:11 +0800
committerJason Gunthorpe <[email protected]>2021-08-25 13:55:29 -0300
commit074f315fc54a9ce45559a44ca36d9fa1ee1ea2cd (patch)
treef5ece4cd26fb04cccf1a8e5c74392d6d8534bde8
parent4303e61264c45cb535255c5b76400f5c4ab1305d (diff)
RDMA/hns: Bugfix for the missing assignment for dip_idx
When the dgid-dip_idx mapping relationship exists, dip should be assigned. Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Junxian Huang <[email protected]> Signed-off-by: Wenpeng Liang <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 198a0c6861f5..f3a7ac995ab7 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -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