All of lore.kernel.org
 help / color / mirror / Atom feed
From: liweihang <liweihang@huawei.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"leon@kernel.org" <leon@kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	Linuxarm <linuxarm@huawei.com>
Subject: Re: [PATCH for-next] RDMA/hns: Create QP/CQ with selected QPN/CQN for bank load balance
Date: Thu, 12 Nov 2020 11:20:12 +0000	[thread overview]
Message-ID: <4199dbabf478450fa4e2e6aec6b7b776@huawei.com> (raw)
In-Reply-To: 20201110174615.GQ2620339@nvidia.com

On 2020/11/11 1:46, Jason Gunthorpe wrote:
> On Tue, Nov 10, 2020 at 09:19:39AM +0000, liweihang wrote:
>> On 2020/11/6 21:37, Jason Gunthorpe wrote:
>>> On Fri, Nov 06, 2020 at 01:52:57AM +0000, liweihang wrote:
>>>
>>>> There are 8 banks and each of them has a counter which represents
>>>> how many QPs are using this bank. We first find the bank with the
>>>> smallest count, and then try to find a QPN belongs to this bank
>>>> according to the bitmap.  The ida will find an unused ID starting
>>>> from 0, I think it can't meet our needs. If we use ida here, the
>>>> code may looks like:
>>>
>>> I don't understand, why wouldn't the ida give you a free QPN in a bank
>>> directly?
>>>
>>> Jason
>>>
>>
>> Hi Jason,
>>
>> Here is the QPN that belongs to each bank:
>>
>> QPN on bank0:0, 8, 16, 24 ... <lower three bits is 0>
>> QPN on bank1: 1, 9, 17, 25 ... <lower three bits is 1>
>> QPN on bank2: 2, 10, 18, 26 ... <lower three bits is 2>
>> ...
>> QPN on bank6: 6, 14, 22, 30 ... <lower three bits is 6>
>> QPN on bank7: 7, 15, 23, 31 ... <lower three bits is 7>
>>
>> If bank 6 is the one with the lowest load, then we need to find a
>> valid QPN belongs to bank6, that means, the lower 3 bits of QPN is
>> 6 and it hasn't been used.
>> We can't find out a way to use ida in this situation because the
>> QPNs of each bank are discontinuous.
> 
> Each bank has an IDA, you allocate from the IDA then shift left and or
> in the bank number
> 
> Jason
> 

Thanks for your advice, we will achieve it and do some tests.

Weihang

      reply	other threads:[~2020-11-12 11:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09  9:09 [PATCH for-next] RDMA/hns: Create QP/CQ with selected QPN/CQN for bank load balance Weihang Li
2020-09-18 14:25 ` Jason Gunthorpe
2020-09-19  9:25   ` liweihang
2020-11-06  1:52   ` liweihang
2020-11-06 13:37     ` Jason Gunthorpe
2020-11-10  9:19       ` liweihang
2020-11-10 17:46         ` Jason Gunthorpe
2020-11-12 11:20           ` liweihang [this message]

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=4199dbabf478450fa4e2e6aec6b7b776@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@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.