Re: [PATCH rdma-next 29/50] RDMA/rxe: Split user and kernel CQ creation paths

From: Leon Romanovsky

Date: Sun Feb 15 2026 - 02:06:27 EST


On Fri, Feb 13, 2026 at 03:22:13PM -0800, yanjun.zhu wrote:
> On 2/13/26 2:58 AM, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@xxxxxxxxxx>
> >
> > Separate the CQ creation logic into distinct kernel and user flows.
> >
> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
> > ---
> > drivers/infiniband/sw/rxe/rxe_verbs.c | 81 ++++++++++++++++++++---------------
> > 1 file changed, 47 insertions(+), 34 deletions(-)

<...>

> > + if (err)
> > + return err;
> > err = rxe_cq_from_init(rxe, cq, attr->cqe, attr->comp_vector, udata,
> > uresp);
>
> Neither rxe_create_user_cq() nor rxe_create_cq() explicitly validates
> attr->comp_vector. Is this guaranteed to be validated by the core before
> reaching the driver, or should rxe still enforce device-specific limits?

We should validate it in IB/core level.
https://github.com/linux-rdma/rdma-core/blob/8b9cdb7c6bd2b6e4e64e08888c10124b0d1873f2/libibverbs/man/ibv_create_cq.3#L32
.I comp_vector
for signaling completion events; it must be at least zero and less than
.I context\fR->num_comp_vectors.

>
> > - if (err) {
> > - rxe_dbg_cq(cq, "create cq failed, err = %d\n", err);
> > + if (err)
> > goto err_cleanup;
>
> The err_cleanup label is only used for this specific error path. It may
> improve readability to inline the cleanup logic at this site and remove the
> label altogether.

Ill delete. Thanks