Re: [PATCH rdma-next v2 4/6] RDMA/irdma: Split CQ setup to umode and kmode
From: David Hu
Date: Thu Oct 15 2026 - 17:19:40 EST
On Thu, Oct 15, 2026 at 2:17 PM Leon Romanovsky <leon@xxxxxxxxxx> wrote:
>
> On Thu, Oct 15, 2026 at 01:19:38AM +0000, David Hu wrote:
> > From: David Hu <xuehaohu@xxxxxxxxxx>
> > @@ -2624,6 +2624,126 @@ static inline int cq_validate_flags(u32 flags, u8 hw_rev)
> > return flags & ~IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION ? -EOPNOTSUPP : 0;
> > }
> >
> > +static int irdma_setup_kmode_cq(struct irdma_device *iwdev,
> > + struct irdma_cq *iwcq,
> > + struct irdma_cq_init_info *info,
> > + const struct ib_cq_init_attr *attr)
> > +{
> > + struct irdma_cq_uk_init_info *ukinfo = &info->cq_uk_init_info;
> > + struct irdma_pci_f *rf = iwdev->rf;
> > + struct irdma_sc_dev *dev = &rf->sc_dev;
> > + int entries = attr->cqe;
> > + bool cqe_64byte_ena;
> > + u8 cqe_size;
> > + int rsize;
> > +
> > + if (entries < 1 || entries > rf->max_cqe)
> > + return -EINVAL;
>
> This if() is impossible.
Hi Leon,
Right. That is impossible following your series in [1]. I'll clean up
the checks.
[1] https://lore.kernel.org/all/20260213-refactor-umem-v1-0-f3be85847922@xxxxxxxxxx/
> > @@ -2689,109 +2806,12 @@ static int irdma_create_cq(struct ib_cq *ibcq,
> > info.type = IRDMA_CQ_TYPE_IWARP;
> > info.vsi = &iwdev->vsi;
> > + if (udata)
> > + err_code = irdma_setup_umode_cq(iwdev, iwcq, &info, udata);
> > + else
> > + err_code = irdma_setup_kmode_cq(iwdev, iwcq, &info, attr);
>
> No, the idea was to actually implement and set ,crate_user_cq() callback
> and clean as much as possible from existing .create_cq() callback.
Thank you Leon for clarifying ! — Will do. I will send out a v3 shortly.
Regards,
David