From: Leon Romanovsky <leonro@mellanox.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Yamin Friedman <yaminf@mellanox.com>,
Sagi Grimberg <sagi@grimberg.me>,
Or Gerlitz <ogerlitz@mellanox.com>,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH V3 2/4] RDMA/core: Introduce shared CQ pool API
Date: Mon, 25 May 2020 19:47:13 +0300 [thread overview]
Message-ID: <20200525164713.GF10591@unreal> (raw)
In-Reply-To: <20200525164215.GA3226@ziepe.ca>
On Mon, May 25, 2020 at 01:42:15PM -0300, Jason Gunthorpe wrote:
> On Tue, May 19, 2020 at 03:43:34PM +0300, Yamin Friedman wrote:
>
> > +void ib_cq_pool_init(struct ib_device *dev)
> > +{
> > + int i;
>
> I generally rather see unsigned types used for unsigned values
>
> > +
> > + spin_lock_init(&dev->cq_pools_lock);
> > + for (i = 0; i < ARRAY_SIZE(dev->cq_pools); i++)
> > + INIT_LIST_HEAD(&dev->cq_pools[i]);
> > +}
> > +
> > +void ib_cq_pool_destroy(struct ib_device *dev)
> > +{
> > + struct ib_cq *cq, *n;
> > + int i;
> > +
> > + for (i = 0; i < ARRAY_SIZE(dev->cq_pools); i++) {
> > + list_for_each_entry_safe(cq, n, &dev->cq_pools[i],
> > + pool_entry) {
> > + cq->shared = false;
> > + ib_free_cq_user(cq, NULL);
>
> WARN_ON cqe_used == 0?
An opposite is better - WARN_ON(cqe_used).
<...>
> > @@ -1418,6 +1418,7 @@ int ib_register_device(struct ib_device *device, const char *name)
> > device->ops.dealloc_driver = dealloc_fn;
> > return ret;
> > }
> > + ib_cq_pool_init(device);
> > ib_device_put(device);
>
> This look like wrong placement, it should be done before enable_device
> as enable_device triggers ULPs t start using the device and they might
> start allocating using this API.
>
> > return 0;
> > @@ -1446,6 +1447,7 @@ static void __ib_unregister_device(struct ib_device *ib_dev)
> > if (!refcount_read(&ib_dev->refcount))
> > goto out;
> >
> > + ib_cq_pool_destroy(ib_dev);
> > disable_device(ib_dev);
>
> similar issue, should be after disable_device as ULPs are still
> running here
Sorry, this were my mistakes. I suggested to Yamin to put it here.
Thanks
next prev parent reply other threads:[~2020-05-25 16:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 12:43 [PATCH V3 0/4] Introducing RDMA shared CQ pool Yamin Friedman
2020-05-19 12:43 ` [PATCH V3 1/4] RDMA/core: Add protection for shared CQs used by ULPs Yamin Friedman
2020-05-19 12:43 ` [PATCH V3 2/4] RDMA/core: Introduce shared CQ pool API Yamin Friedman
2020-05-20 6:19 ` Devesh Sharma
2020-05-20 9:23 ` Yamin Friedman
2020-05-20 9:32 ` Leon Romanovsky
2020-05-20 10:50 ` Devesh Sharma
2020-05-20 12:01 ` Yamin Friedman
2020-05-20 13:48 ` Devesh Sharma
2020-05-25 13:06 ` Yamin Friedman
2020-05-26 7:09 ` Yamin Friedman
2020-05-25 15:14 ` Bart Van Assche
2020-05-25 16:45 ` Jason Gunthorpe
2020-05-26 11:43 ` Yamin Friedman
2020-05-25 16:42 ` Jason Gunthorpe
2020-05-25 16:47 ` Leon Romanovsky [this message]
2020-05-26 11:39 ` Yamin Friedman
2020-05-26 12:09 ` Jason Gunthorpe
2020-05-19 12:43 ` [PATCH V3 3/4] nvme-rdma: use new shared CQ mechanism Yamin Friedman
2020-05-19 12:43 ` [PATCH V3 4/4] nvmet-rdma: " Yamin Friedman
2020-05-20 7:03 ` [PATCH V3 0/4] Introducing RDMA shared CQ pool Sagi Grimberg
2020-05-20 8:15 ` Yamin Friedman
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=20200525164713.GF10591@unreal \
--to=leonro@mellanox.com \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=sagi@grimberg.me \
--cc=yaminf@mellanox.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