All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Yishai Hadas <yishaih@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	Edward Srouji <edwards@nvidia.com>,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next v1 5/8] RDMA/core: Introduce a DMAH object and its alloc/free APIs
Date: Tue, 15 Jul 2025 09:53:11 -0300	[thread overview]
Message-ID: <20250715125311.GL2067380@nvidia.com> (raw)
In-Reply-To: <01b087d1-8710-4111-8ba0-b942f77a8b0e@nvidia.com>

On Tue, Jul 15, 2025 at 11:21:14AM +0300, Yishai Hadas wrote:
> On 14/07/2025 19:39, Jason Gunthorpe wrote:
> > On Sun, Jul 13, 2025 at 09:37:26AM +0300, Leon Romanovsky wrote:
> > > +static int UVERBS_HANDLER(UVERBS_METHOD_DMAH_ALLOC)(
> > > +	struct uverbs_attr_bundle *attrs)
> > > +{
> > > +	struct ib_uobject *uobj =
> > > +		uverbs_attr_get(attrs, UVERBS_ATTR_ALLOC_DMAH_HANDLE)
> > > +			->obj_attr.uobject;
> > > +	struct ib_device *ib_dev = attrs->context->device;
> > > +	struct ib_dmah *dmah;
> > > +	int ret;
> > > +
> > > +	if (!ib_dev->ops.alloc_dmah || !ib_dev->ops.dealloc_dmah)
> > > +		return -EOPNOTSUPP;
> > 
> > This shouldn't be needed, use UAPI_DEF_OBJ_NEEDS_FN() instead.
> 
> We already have UAPI_DEF_OBJ_NEEDS_FN(dealloc_dmah) below, so the check for
> !ib_dev->ops.dealloc_dmah can be dropped.

Fix both

> > > +DECLARE_UVERBS_NAMED_OBJECT(UVERBS_OBJECT_DMAH,
> > > +			    UVERBS_TYPE_ALLOC_IDR(uverbs_free_dmah),
> > > +			    &UVERBS_METHOD(UVERBS_METHOD_DMAH_ALLOC),
> > > +			    &UVERBS_METHOD(UVERBS_METHOD_DMAH_FREE));
> > > +
> > > +const struct uapi_definition uverbs_def_obj_dmah[] = {
> > > +	UAPI_DEF_CHAIN_OBJ_TREE_NAMED(UVERBS_OBJECT_DMAH,
> > > +				      UAPI_DEF_OBJ_NEEDS_FN(dealloc_dmah)),
> > > +	{}
> > 
> > I think it should be on the NAMED_OBJECT in this case, like AH:
> > 
> > 	DECLARE_UVERBS_OBJECT(
> > 		UVERBS_OBJECT_AH,
> > [..]
> > 		UAPI_DEF_OBJ_NEEDS_FN(create_user_ah),
> > 		UAPI_DEF_OBJ_NEEDS_FN(destroy_ah)),
> > 
> 
> The NAMED_OBJECT doesn't support UAPI_DEF_OBJ_NEEDS_FN.

Hmm, really? I don't remember.

Jason

  reply	other threads:[~2025-07-15 12:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-13  6:37 [PATCH rdma-next v1 0/8] RDMA support for DMA handle Leon Romanovsky
2025-07-13  6:37 ` [PATCH rdma-next v1 1/8] PCI/TPH: Expose pcie_tph_get_st_table_size() Leon Romanovsky
2025-07-13  6:37 ` [PATCH mlx5-next v1 2/8] net/mlx5: Expose IFC bits for TPH Leon Romanovsky
2025-07-13  6:37 ` [PATCH mlx5-next v1 3/8] net/mlx5: Add support for device steering tag Leon Romanovsky
2025-07-13  6:37 ` [PATCH rdma-next v1 4/8] IB/core: Add UVERBS_METHOD_REG_MR on the MR object Leon Romanovsky
2025-07-14 16:33   ` Jason Gunthorpe
2025-07-15  7:14     ` Leon Romanovsky
2025-07-13  6:37 ` [PATCH rdma-next v1 5/8] RDMA/core: Introduce a DMAH object and its alloc/free APIs Leon Romanovsky
2025-07-14 16:39   ` Jason Gunthorpe
2025-07-15  8:21     ` Yishai Hadas
2025-07-15 12:53       ` Jason Gunthorpe [this message]
2025-07-15 15:45         ` Yishai Hadas
2025-07-14 16:39   ` Jason Gunthorpe
2025-07-15  8:29     ` Yishai Hadas
2025-07-16  3:58   ` Wathsala Wathawana Vithanage
2025-07-17 11:08     ` Leon Romanovsky
2025-07-13  6:37 ` [PATCH rdma-next v1 6/8] RDMA/mlx5: Add DMAH object support Leon Romanovsky
2025-07-13  6:37 ` [PATCH rdma-next v1 7/8] IB: Extend UVERBS_METHOD_REG_MR to get DMAH Leon Romanovsky
2025-07-13 22:04   ` Zhu Yanjun
2025-07-14  7:17     ` Leon Romanovsky
2025-07-14  1:03   ` Junxian Huang
2025-07-13  6:37 ` [PATCH rdma-next v1 8/8] RDMA/mlx5: Add DMAH support for reg_user_mr/reg_user_dmabuf_mr Leon Romanovsky

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=20250715125311.GL2067380@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=edwards@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=yishaih@nvidia.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.