All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Junxian Huang <huangjunxian6@hisilicon.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org, linuxarm@huawei.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH for-next 9/9] RDMA/hns: Fix different dgids mapping to the same dip_idx
Date: Tue, 10 Sep 2024 16:12:05 +0300	[thread overview]
Message-ID: <20240910131205.GB4026@unreal> (raw)
In-Reply-To: <20240906093444.3571619-10-huangjunxian6@hisilicon.com>

On Fri, Sep 06, 2024 at 05:34:44PM +0800, Junxian Huang wrote:
> From: Feng Fang <fangfeng4@huawei.com>
> 
> DIP algorithm requires a one-to-one mapping between dgid and dip_idx.
> Currently a queue 'spare_idx' is used to store QPN of QPs that use
> DIP algorithm. For a new dgid, use a QPN from spare_idx as dip_idx.
> This method lacks a mechanism for deduplicating QPN, which may result
> in different dgids sharing the same dip_idx and break the one-to-one
> mapping requirement.
> 
> This patch replaces spare_idx with two new bitmaps: qpn_bitmap to record
> QPN that is not being used as dip_idx, and dip_idx_map to record QPN
> that is being used. Besides, introduce a reference count of a dip_idx
> to indicate the number of QPs that using this dip_idx. When creating
> a DIP QP, if it has a new dgid, set the corresponding bit in dip_idx_map,
> otherwise add 1 to the reference count of the reused dip_idx and set bit
> in qpn_bitmap. When destroying a DIP QP, decrement the reference count
> by 1. If it becomes 0, set bit in qpn_bitmap and clear bit in dip_idx_map.
> 
> Fixes: eb653eda1e91 ("RDMA/hns: Bugfix for incorrect association between dip_idx and dgid")
> Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW")
> Signed-off-by: Feng Fang <fangfeng4@huawei.com>
> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_device.h |  6 +--
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c  | 58 ++++++++++++++++++---
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.h  |  1 +
>  drivers/infiniband/hw/hns/hns_roce_qp.c     | 16 ++++--
>  4 files changed, 67 insertions(+), 14 deletions(-)

It is strange implementation, double bitmap and refcount looks like
open-coding of some basic coding patterns. Let's wait with applying it
for now.

Thanks

  reply	other threads:[~2024-09-10 13:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06  9:34 [PATCH for-next 0/9] RDMA/hns: Bugfixes and one improvement Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 1/9] RDMA/hns: Don't modify rq next block addr in HIP09 QPC Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 2/9] RDMA/hns: Fix Use-After-Free of rsv_qp on HIP08 Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 3/9] RDMA/hns: Fix cpu stuck caused by printings during reset Junxian Huang
2024-09-10 13:09   ` Leon Romanovsky
2024-09-11  1:34     ` Junxian Huang
2024-09-11 13:25       ` Leon Romanovsky
2024-09-12  1:04         ` Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 4/9] RDMA/hns: Fix the overflow risk of hem_list_calc_ba_range() Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 5/9] RDMA/hns: Fix spin_unlock_irqrestore() called with IRQs enabled Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 6/9] RDMA/hns: Fix VF triggering PF reset in abnormal interrupt handler Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 7/9] RDMA/hns: Fix 1bit-ECC recovery address in non-4K OS Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 8/9] RDMA/hns: Optimize hem allocation performance Junxian Huang
2024-09-06  9:34 ` [PATCH for-next 9/9] RDMA/hns: Fix different dgids mapping to the same dip_idx Junxian Huang
2024-09-10 13:12   ` Leon Romanovsky [this message]
2024-10-17 13:21     ` Junxian Huang
2024-10-29 12:40       ` Leon Romanovsky
2024-09-10 13:13 ` [PATCH for-next 0/9] RDMA/hns: Bugfixes and one improvement Leon Romanovsky
2024-09-10 13:13 ` (subset) " 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=20240910131205.GB4026@unreal \
    --to=leon@kernel.org \
    --cc=huangjunxian6@hisilicon.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@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.