From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Junxian Huang <huangjunxian6@hisilicon.com>,
jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org, linuxarm@huawei.com,
tangchengchang@huawei.com
Subject: Re: [PATCH for-next] RDMA/hns: Fix querying wrong SCC context for DIP algorithm
Date: Tue, 29 Jul 2025 09:26:14 -0700 [thread overview]
Message-ID: <fd203f1c-c18d-458f-b1b0-924b8762fe4c@linux.dev> (raw)
In-Reply-To: <20250726075345.846957-1-huangjunxian6@hisilicon.com>
在 2025/7/26 0:53, Junxian Huang 写道:
> From: wenglianfa <wenglianfa@huawei.com>
>
> When using DIP algorithm, all QPs establishing connections with
> the same destination IP share the same SCC, which is indexed by
> dip_idx, but dip_idx isn't necessarily equal to qpn. Therefore,
> dip_idx should be used to query SCC context instead of qpn.
>
> Fixes: 124a9fbe43aa ("RDMA/hns: Append SCC context to the raw dump of QPC")
> Signed-off-by: wenglianfa <wenglianfa@huawei.com>
> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Replace qpn with sccn.
The term DIP algorithm typically refers to Deterministic IP, a selection
algorithm used to pick a destination GID (Global Identifier) when
multiple IP addresses are available.
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Zhu Yanjun
> ---
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++--
> drivers/infiniband/hw/hns/hns_roce_restrack.c | 9 ++++++++-
> 2 files changed, 10 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 64bca08f3f1a..244a4780d3a6 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -5476,7 +5476,7 @@ static int hns_roce_v2_query_srqc(struct hns_roce_dev *hr_dev, u32 srqn,
> return ret;
> }
>
> -static int hns_roce_v2_query_sccc(struct hns_roce_dev *hr_dev, u32 qpn,
> +static int hns_roce_v2_query_sccc(struct hns_roce_dev *hr_dev, u32 sccn,
> void *buffer)
> {
> struct hns_roce_v2_scc_context *context;
> @@ -5488,7 +5488,7 @@ static int hns_roce_v2_query_sccc(struct hns_roce_dev *hr_dev, u32 qpn,
> return PTR_ERR(mailbox);
>
> ret = hns_roce_cmd_mbox(hr_dev, 0, mailbox->dma, HNS_ROCE_CMD_QUERY_SCCC,
> - qpn);
> + sccn);
> if (ret)
> goto out;
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_restrack.c b/drivers/infiniband/hw/hns/hns_roce_restrack.c
> index f637b73b946e..230187dda6a0 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_restrack.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_restrack.c
> @@ -100,6 +100,7 @@ int hns_roce_fill_res_qp_entry_raw(struct sk_buff *msg, struct ib_qp *ib_qp)
> struct hns_roce_v2_qp_context qpc;
> struct hns_roce_v2_scc_context sccc;
> } context = {};
> + u32 sccn = hr_qp->qpn;
> int ret;
>
> if (!hr_dev->hw->query_qpc)
> @@ -116,7 +117,13 @@ int hns_roce_fill_res_qp_entry_raw(struct sk_buff *msg, struct ib_qp *ib_qp)
> !hr_dev->hw->query_sccc)
> goto out;
>
> - ret = hr_dev->hw->query_sccc(hr_dev, hr_qp->qpn, &context.sccc);
> + if (hr_qp->cong_type == CONG_TYPE_DIP) {
> + if (!hr_qp->dip)
> + goto out;
> + sccn = hr_qp->dip->dip_idx;
> + }
> +
> + ret = hr_dev->hw->query_sccc(hr_dev, sccn, &context.sccc);
> if (ret)
> ibdev_warn_ratelimited(&hr_dev->ib_dev,
> "failed to query SCCC, ret = %d.\n",
next prev parent reply other threads:[~2025-07-29 16:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-26 7:53 [PATCH for-next] RDMA/hns: Fix querying wrong SCC context for DIP algorithm Junxian Huang
2025-07-29 16:26 ` Zhu Yanjun [this message]
2025-08-13 10:34 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fd203f1c-c18d-458f-b1b0-924b8762fe4c@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=huangjunxian6@hisilicon.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=tangchengchang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.