All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Weihang Li <liweihang@huawei.com>
Cc: dledford@redhat.com, leon@kernel.org, linux-rdma@vger.kernel.org,
	linuxarm@huawei.com
Subject: Re: [PATCH v2 for-next] RDMA/hns: Create QP with selected QPN for bank load balance
Date: Mon, 23 Nov 2020 12:17:17 -0400	[thread overview]
Message-ID: <20201123161717.GV244516@ziepe.ca> (raw)
In-Reply-To: <1606136808-32136-1-git-send-email-liweihang@huawei.com>

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

  reply	other threads:[~2020-11-23 16:17 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 [this message]
2020-11-24  8:14   ` 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=20201123161717.GV244516@ziepe.ca \
    --to=jgg@ziepe.ca \
    --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 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.