From: Jason Gunthorpe <jgg@nvidia.com>
To: liweihang <liweihang@huawei.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: Tue, 10 Nov 2020 13:46:15 -0400 [thread overview]
Message-ID: <20201110174615.GQ2620339@nvidia.com> (raw)
In-Reply-To: <c33b1adfea354db5b7332e8d23bd8880@huawei.com>
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
next prev parent reply other threads:[~2020-11-10 17:46 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 [this message]
2020-11-12 11:20 ` liweihang
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=20201110174615.GQ2620339@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=liweihang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).