From: liweihang <liweihang@huawei.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
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 v2 for-next] RDMA/hns: Create QP with selected QPN for bank load balance
Date: Tue, 24 Nov 2020 08:14:50 +0000 [thread overview]
Message-ID: <481c1de575b841aca47a4c5ba97ad0ac@huawei.com> (raw)
In-Reply-To: 20201123161717.GV244516@ziepe.ca
On 2020/11/24 0:17, Jason Gunthorpe wrote:
> On Mon, Nov 23, 2020 at 09:06:48PM +0800, Weihang Li wrote:
>> +static int alloc_qpn_with_bankid(struct hns_roce_bank *bank, u8 bankid,
>> + unsigned long *qpn)
>> +{
>> + int id;
>> +
>> + id = ida_alloc_range(&bank->ida, bank->min, bank->max, GFP_KERNEL);
>> + if (id < 0) {
>> + id = ida_alloc_range(&bank->ida, bank->rsv_bot, bank->min,
>> + GFP_KERNEL);
>
> Shouldn't this one be bank->max not min? That is the usual way to write a
> cyclic allocator over this kind of API. See the logic in __xa_alloc_cyclic()
>
> Jason
>
Thanks for your advice, it's clearer to use bank->max here. We will refer to
how __xa_alloc_cyclic() is implemented.
Weihang
prev parent reply other threads:[~2020-11-24 8:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 13:06 [PATCH v2 for-next] RDMA/hns: Create QP with selected QPN for bank load balance Weihang Li
2020-11-23 16:17 ` Jason Gunthorpe
2020-11-24 8:14 ` 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=481c1de575b841aca47a4c5ba97ad0ac@huawei.com \
--to=liweihang@huawei.com \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox