From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jiri Pirko <jiri@resnulli.us>,
linux-rdma@vger.kernel.org, mrgolin@amazon.com,
gal.pressman@linux.dev, sleybo@amazon.com, parav@nvidia.com,
mbloch@nvidia.com, yanjun.zhu@linux.dev,
marco.crivellari@suse.com, roman.gushchin@linux.dev,
phaddad@nvidia.com, lirongqing@baidu.com, ynachum@amazon.com,
huangjunxian6@hisilicon.com, kalesh-anakkur.purayil@broadcom.com,
ohartoov@nvidia.com, michaelgur@nvidia.com, shayd@nvidia.com,
edwards@nvidia.com, sriharsha.basavapatna@broadcom.com,
andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com
Subject: Re: [PATCH rdma-next 01/10] RDMA/umem: Add reference counting to ib_umem
Date: Wed, 4 Feb 2026 19:54:11 +0200 [thread overview]
Message-ID: <20260204175411.GB12824@unreal> (raw)
In-Reply-To: <20260204174615.GI2328995@ziepe.ca>
On Wed, Feb 04, 2026 at 01:46:15PM -0400, Jason Gunthorpe wrote:
> On Wed, Feb 04, 2026 at 04:38:22PM +0100, Jiri Pirko wrote:
>
> > >Generally I would not assign to the driver's umem storage until the
> > >creation is completed to avoid this. ie it stays null until committed.
> > >
> > >But looking at mlx5 that looks like quite a maze there.. Yikes..
> > >
> > >So maybe mlx5 adds some NULL assignments on its error paths and less
> > >convoluted drivers can use a simpler option?
> >
> > How about we have:
> > int (*create_cq_umem)(struct ib_cq *cq,
> > const struct ib_cq_init_attr *attr,
> > struct ib_umem **umem,
> > ^^
> >
> > struct uverbs_attr_bundle *attrs);
> >
> > And instead of taking ref in the callee we just do *umem = NULL? :S
> >
> > This would help to cover the error path vs destroy path differences,
> > Tt could also be used to make sure the op consumed all umems; all
> > should be NULLed on success.
> >
> > Makes sense?
>
> I'm ok with that, though never seen the pattern before. If the core
> code fails on !NULL it would be pretty hard to use it wrong.
I'm less excited to see unique coding patterns. We should rather invest
time in effort to layer everything correctly.
Thanks
>
> Jason
>
next prev parent reply other threads:[~2026-02-04 17:54 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 8:49 [PATCH rdma-next 00/10] RDMA: Extend uverbs umem support for QP buffers and doorbell records Jiri Pirko
2026-02-03 8:49 ` [PATCH rdma-next 01/10] RDMA/umem: Add reference counting to ib_umem Jiri Pirko
2026-02-03 10:03 ` Leon Romanovsky
2026-02-03 10:11 ` Jiri Pirko
2026-02-03 12:26 ` Leon Romanovsky
2026-02-03 12:46 ` Jiri Pirko
2026-02-03 13:03 ` Leon Romanovsky
2026-02-03 13:20 ` Jiri Pirko
2026-02-03 13:32 ` Leon Romanovsky
2026-02-03 14:31 ` Jiri Pirko
2026-02-03 13:49 ` Sriharsha Basavapatna
2026-02-03 14:29 ` Jiri Pirko
2026-02-03 14:49 ` Sriharsha Basavapatna
2026-02-03 14:51 ` Jason Gunthorpe
2026-02-03 15:39 ` Jiri Pirko
2026-02-03 16:59 ` Jason Gunthorpe
2026-02-04 7:01 ` Jiri Pirko
2026-02-04 15:38 ` Jiri Pirko
2026-02-04 17:46 ` Jason Gunthorpe
2026-02-04 17:54 ` Leon Romanovsky [this message]
2026-02-04 17:56 ` Jiri Pirko
2026-02-03 16:56 ` Leon Romanovsky
2026-02-03 17:01 ` Jason Gunthorpe
2026-02-03 8:49 ` [PATCH rdma-next 02/10] RDMA/uverbs: Use umem refcounting for CQ creation with external buffer Jiri Pirko
2026-02-03 8:49 ` [PATCH rdma-next 03/10] RDMA/mlx5: Add support for CQ creation with external umem buffer Jiri Pirko
2026-02-03 8:49 ` [PATCH rdma-next 04/10] RDMA/uverbs: Factor out common buffer umem parsing into helper Jiri Pirko
2026-02-03 8:49 ` [PATCH rdma-next 05/10] RDMA/core: Add support for QP buffer umem in QP creation Jiri Pirko
2026-02-03 8:49 ` [PATCH rdma-next 06/10] RDMA/mlx5: Add support for QP creation with external umem buffers Jiri Pirko
2026-02-03 8:49 ` [PATCH rdma-next 07/10] RDMA/uverbs: Add doorbell record umem support to CQ creation Jiri Pirko
2026-02-03 8:50 ` [PATCH rdma-next 08/10] RDMA/mlx5: Add external doorbell record umem support for CQ Jiri Pirko
2026-02-03 8:50 ` [PATCH rdma-next 09/10] RDMA/uverbs: Add doorbell record umem support to QP creation Jiri Pirko
2026-02-03 8:50 ` [PATCH rdma-next 10/10] RDMA/mlx5: Add external doorbell record umem support for QP Jiri Pirko
2026-02-03 9:59 ` [PATCH rdma-next 00/10] RDMA: Extend uverbs umem support for QP buffers and doorbell records Leon Romanovsky
2026-02-03 10:13 ` Jiri Pirko
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=20260204175411.GB12824@unreal \
--to=leon@kernel.org \
--cc=andrew.gospodarek@broadcom.com \
--cc=edwards@nvidia.com \
--cc=gal.pressman@linux.dev \
--cc=huangjunxian6@hisilicon.com \
--cc=jgg@ziepe.ca \
--cc=jiri@resnulli.us \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=linux-rdma@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=marco.crivellari@suse.com \
--cc=mbloch@nvidia.com \
--cc=michaelgur@nvidia.com \
--cc=mrgolin@amazon.com \
--cc=ohartoov@nvidia.com \
--cc=parav@nvidia.com \
--cc=phaddad@nvidia.com \
--cc=roman.gushchin@linux.dev \
--cc=selvin.xavier@broadcom.com \
--cc=shayd@nvidia.com \
--cc=sleybo@amazon.com \
--cc=sriharsha.basavapatna@broadcom.com \
--cc=yanjun.zhu@linux.dev \
--cc=ynachum@amazon.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