Re: [for-next v3 2/3] RDMA/ionic: Accept CQ ring buffers as ioctl umem attributes

From: Jason Gunthorpe

Date: Tue Dec 01 2026 - 14:36:25 EST


On Fri, Nov 27, 2026 at 09:38:31AM +0530, Abhijit Gangurde wrote:
> +static int ionic_cq_get_user_umem(struct ionic_ibdev *dev, struct ionic_cq *cq,
> + const struct ionic_qdesc *req_cq,
> + const struct uverbs_attr_bundle *attrs,
> + int udma_idx)
> +{
> + struct ib_umem_dmabuf *umem_dmabuf;
> + struct ib_uverbs_buffer_desc desc;
> + struct ib_umem *umem;
> + u16 attr_id;
> + int rc;
> +
> + if (udma_idx < 0 || udma_idx >= ARRAY_SIZE(ionic_cq_buf_attrs))
> + return -EINVAL;
> +
> + attr_id = ionic_cq_buf_attrs[udma_idx];
> + if (attrs && uverbs_attr_is_valid(attrs, attr_id)) {
> + rc = uverbs_get_buffer_desc(attrs, attr_id, &desc);
> + if (rc)
> + return rc;
> +
> + if (desc.length < req_cq->size)
> + return -EINVAL;
> +
> + if (desc.type == IB_UVERBS_BUFFER_TYPE_DMABUF) {

No other driver is touching this IB_UVERBS_BUFFER_TYPE_DMABUF and yet
they support DMABUF, why is this touching internal info?

It was supposed to be generic, you get a desc and then you map
it. Driver doesn't care what is in the desc.

Jason