Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1910724pxb; Thu, 16 Sep 2021 20:00:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLy6OGPceSgzpvaXiIBgmLr50zs0rS6PIBgdD/GdBJpOrp85Biq4GXW1WFJfOTNP/tQKZ5 X-Received: by 2002:a6b:6c17:: with SMTP id a23mr6833847ioh.110.1631847606558; Thu, 16 Sep 2021 20:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631847606; cv=none; d=google.com; s=arc-20160816; b=TkTfAE6TfMvGayWyczHZdcm//RFQmguS9G7UlRDzS93JXkSSXXQaZZw5pikQ98b6zW OQ/NJkwPyY0rbZ9ndLiyQV8KL2fB7+BqE3w0j6L9MhRO+i4vI6Mli9zIC8amRdvA/QdP eDYXFVXT01jA3d9UgR4tO2kwZxenGg8FSXIcWzBBSNMUy0NzjLQ0i4bM5xGwBj1Hzfzn W/e9VWsTEA7galJkPOfbL6NGfzB1W/YQsx/kWp6zHxZx1SAGxAqBrJLCsHnxjR7LKnbM 4cpR2cRHMLzNxfHL+y+nzjNXXuGV7tZgqoBebUWGpM69KV1vZL0sJVYSB32WSJv6vkO1 ilYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GNJ+Fy/nYOIo7BEQ6TOjMr+87Dgpfc+m8jwsuMaSNt4=; b=LFIFIddRSKc+fSOJwbAqxGnbRCaqmc2PWwkZQoxR1A/yQARPfipUIvldO6xq0raevQ lWcVAMyMZO+HHRUfDBjt50mpmPU6ZM91RHNSMxHQ0gDNHfIx/ZgzB8sCcJJU4HEY53Ue F6lLcM3p27ZQAM6iqATbaKX0UcjDUudWjEocyRUHptUstPMYHQw+uvDKP2QnyA9sHyw/ AvtLG3gCWjZfxjcaqYaOqIz648mIUvFxtI3y7o3161O033DVHxHFs30msbcxlbWsMLkC 33PshUwSLwzPPt6powOd1StIe/2Gr9cp1Xu3do+hSZasLFKLkkKr+l8pggnOrmfqpBLN gWHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jn3s30sd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si4332025ior.112.2021.09.16.19.59.54; Thu, 16 Sep 2021 20:00:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jn3s30sd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352619AbhIPRZB (ORCPT + 99 others); Thu, 16 Sep 2021 13:25:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:40900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350816AbhIPRQw (ORCPT ); Thu, 16 Sep 2021 13:16:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2C45361BA7; Thu, 16 Sep 2021 16:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810425; bh=Pl4jT/1pzimdql52fgjmzbZnSvgTJ6qtKEL9aVJzT3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jn3s30sdRhXU3GkWuFJr6dYp4HmfTB26LBmmZ0IW5JQoQq9d7YziPG8UBsCIUMwtn 5XRoIjdL4kISJymm2/5Im7Ok0ssnJNXFEVi/F7YZBseLiFk14RQ8KarbmLXltkVktQ j/5B+mIOEx4gqoieb21uN6Cja1Sf+2+EtvWwxy74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Junxian Huang , Wenpeng Liang , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.14 137/432] RDMA/hns: Bugfix for the missing assignment for dip_idx Date: Thu, 16 Sep 2021 17:58:06 +0200 Message-Id: <20210916155815.405682126@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Junxian Huang [ Upstream commit 074f315fc54a9ce45559a44ca36d9fa1ee1ea2cd ] 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/1629884592-23424-3-git-send-email-liangwenpeng@huawei.com Signed-off-by: Junxian Huang Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 +++- 1 file changed, 3 insertions(+), 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 f4cea6dcec2f..d9e330a383b2 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -4514,8 +4514,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 -- 2.30.2