From: Jason Gunthorpe <jgg@nvidia.com>
To: Michael Margolin <mrgolin@amazon.com>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org, sleybo@amazon.com,
matua@amazon.com, gal.pressman@linux.dev,
Yonatan Nachum <ynachum@amazon.com>
Subject: Re: [PATCH for-next 1/4] RDMA/core: Add Completion Counters support
Date: Tue, 7 Apr 2026 11:17:31 -0300 [thread overview]
Message-ID: <20260407141731.GC3357077@nvidia.com> (raw)
In-Reply-To: <20260407115424.13359-2-mrgolin@amazon.com>
On Tue, Apr 07, 2026 at 11:54:21AM +0000, Michael Margolin wrote:
> +static int UVERBS_HANDLER(UVERBS_METHOD_COMP_CNTR_CREATE)(
> + struct uverbs_attr_bundle *attrs)
> +{
> + struct ib_uobject *uobj = uverbs_attr_get_uobject(
> + attrs, UVERBS_ATTR_CREATE_COMP_CNTR_HANDLE);
> + struct ib_device *ib_dev = attrs->context->device;
> + struct ib_comp_cntr *cc;
> + int ret;
> +
> + if (!ib_dev->ops.create_comp_cntr ||
> + !ib_dev->ops.destroy_comp_cntr ||
> + !ib_dev->ops.qp_attach_comp_cntr)
> + return -EOPNOTSUPP;
> +
> + cc = rdma_zalloc_drv_obj(ib_dev, ib_comp_cntr);
> + if (!cc)
> + return -ENOMEM;
> +
> + cc->device = ib_dev;
> + cc->uobject = uobj;
> +
> + ret = comp_cntr_get_umem(ib_dev, attrs,
> + UVERBS_ATTR_CREATE_COMP_CNTR_BUFFER_VA,
> + UVERBS_ATTR_CREATE_COMP_CNTR_BUFFER_FD,
> + UVERBS_ATTR_CREATE_COMP_CNTR_BUFFER_OFFSET,
> + &cc->comp_umem);
> + if (ret)
> + goto err_free;
> +
> + ret = comp_cntr_get_umem(ib_dev, attrs,
> + UVERBS_ATTR_CREATE_COMP_CNTR_ERR_BUFFER_VA,
> + UVERBS_ATTR_CREATE_COMP_CNTR_ERR_BUFFER_FD,
> + UVERBS_ATTR_CREATE_COMP_CNTR_ERR_BUFFER_OFFSET,
> + &cc->err_umem);
> + if (ret)
> + goto err_comp_umem;
Seems a bit weird to have two things inside the object? Why not have
the counter support all events and if userspace wants two it can just
create two? There is alot of code to support this err/not err split..
Did any spec define the API this way?
Jason
next prev parent reply other threads:[~2026-04-07 14:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 11:54 [PATCH for-next 0/4] Introduce Completion Counters Michael Margolin
2026-04-07 11:54 ` [PATCH for-next 1/4] RDMA/core: Add Completion Counters support Michael Margolin
2026-04-07 14:17 ` Jason Gunthorpe [this message]
2026-04-09 16:00 ` Michael Margolin
2026-04-09 16:13 ` Jason Gunthorpe
2026-04-09 17:29 ` Sean Hefty
2026-04-09 18:55 ` Jason Gunthorpe
2026-04-09 19:15 ` Sean Hefty
2026-04-09 19:44 ` Jason Gunthorpe
2026-04-09 22:23 ` Sean Hefty
2026-04-09 18:36 ` Michael Margolin
2026-04-07 11:54 ` [PATCH for-next 2/4] RDMA/core: Add Completion Counters to resource tracking Michael Margolin
2026-04-07 11:54 ` [PATCH for-next 3/4] RDMA/efa: Update device interface Michael Margolin
2026-04-07 11:54 ` [PATCH for-next 4/4] RDMA/efa: Add Completion Counters support Michael Margolin
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=20260407141731.GC3357077@nvidia.com \
--to=jgg@nvidia.com \
--cc=gal.pressman@linux.dev \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=matua@amazon.com \
--cc=mrgolin@amazon.com \
--cc=sleybo@amazon.com \
--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