On Fri, Feb 13, 2026 at 05:56:32PM +0100, Bernard Metzler wrote:
> On 13.02.2026 11:58, Leon Romanovsky wrote:
> > From: Leon Romanovsky <[email protected]>
> > 
> > Separate the CQ creation logic into distinct kernel and user flows.
> > 
> > Signed-off-by: Leon Romanovsky <[email protected]>
> > ---
> >   drivers/infiniband/sw/siw/siw_main.c  |   1 +
> >   drivers/infiniband/sw/siw/siw_verbs.c | 111 
> > +++++++++++++++++++++++-----------
> >   drivers/infiniband/sw/siw/siw_verbs.h |   2 +
> >   3 files changed, 80 insertions(+), 34 deletions(-)

<...>

> > +int siw_create_cq(struct ib_cq *base_cq, const struct ib_cq_init_attr 
> > *attr,
> > +             struct uverbs_attr_bundle *attrs)
> > +{
> > +   struct siw_device *sdev = to_siw_dev(base_cq->device);
> > +   struct siw_cq *cq = to_siw_cq(base_cq);
> > +   int rv, size = attr->cqe;
> > +
> > +   if (attr->flags)
> > +           return -EOPNOTSUPP;
> > +
> > +   if (atomic_inc_return(&sdev->num_cq) > SIW_MAX_CQ) {
> > +           siw_dbg(base_cq->device, "too many CQ's\n");
> > +           rv = -ENOMEM;
> > +           goto err_out;
> > +   }
> > +   if (size < 1 || size > sdev->attrs.max_cqe) {
> 
> isn't there now also a check for zero sized CQ in
> __ib_alloc_cq(), which obsoletes that < 1 check?

Thanks, this line needs to be changed to be if "(attr.cqe > 
sdev->attrs.max_cqe)"

> 
> Everything looks right otherwise.
> 
> Thanks,
> Bernard.

Thanks

Reply via email to