linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Weihang Li <liweihang@huawei.com>
Cc: dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	linuxarm@huawei.com
Subject: Re: [PATCH for-next] RDMA/hns: Optimize eqe buffer allocation flow
Date: Mon, 10 Feb 2020 12:21:20 +0200	[thread overview]
Message-ID: <20200210102120.GC495280@unreal> (raw)
In-Reply-To: <512fa0f9-2bef-b3d8-fb3d-144984ee468c@huawei.com>

On Mon, Feb 10, 2020 at 05:48:05PM +0800, Weihang Li wrote:
>
>
> On 2020/2/10 17:25, Leon Romanovsky wrote:
> >>>> -		if (!eq->bt_l0)
> >>>> -			return -ENOMEM;
> >>>> -
> >>>> -		eq->cur_eqe_ba = eq->l0_dma;
> >>>> -		eq->nxt_eqe_ba = 0;
> >>>> +	/* alloc a tmp list for storing eq buf address */
> >>>> +	ret = hns_roce_alloc_buf_list(&region, &buf_list, 1);
> >>>> +	if (ret) {
> >>>> +		dev_err(hr_dev->dev, "alloc eq buf_list error\n");
> >>> The same comment like we gave for bnxt driver, no dev_* prints inside
> >>> driver, use ibdev_*.
> >>>
> >>> Thanks
> >>>
> >> Hi Leon,
> >>
> >> map_eq_buf() is called before ib_register_device(), so we can't use
> >> ibdev_* here.
> > As long as map_eq_buf() is called after ib_alloc_device(), you will be fine.
> >
> > Thanks
>
> Hi Leon,
>
> eq is used to queue hardware event, it should be ready before hardware is initialized.
> So we can't call map_eq_buf() after ib_alloc_device().

How can it be that your newly added function has hns_roce_dev in the
signature and you didn't call to ib_alloc_device()?

 +static int map_eq_buf(struct hns_roce_dev *hr_dev, struct hns_roce_eq *eq,
 +                u32 page_shift)

Thanks

>
> Thanks
> Weihang
>
> >
> >> Thanks for your reminder, another patch that replace other dev_* in
> >> hns driver with ibdev_* is on preparing.
> >>
> >> Weihang
> >>
> >>> .
> >>>
> > .
> >
>

  reply	other threads:[~2020-02-10 10:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-26 14:58 [PATCH for-next] RDMA/hns: Optimize eqe buffer allocation flow Weihang Li
2020-01-27  5:52 ` Leon Romanovsky
2020-01-27  7:47   ` Weihang Li
2020-02-05  6:04   ` Weihang Li
2020-02-10  9:25     ` Leon Romanovsky
2020-02-10  9:48       ` Weihang Li
2020-02-10 10:21         ` Leon Romanovsky [this message]
2020-02-10 11:26           ` Weihang Li
2020-02-12  8:18             ` Leon Romanovsky
2020-02-13  2:16               ` Weihang Li
2020-02-11 18:27 ` Jason Gunthorpe

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=20200210102120.GC495280@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --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).