Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/bnxt_re: Clean up uverbs CQ creation path

Remove unnecessary checks, user‑visible prints that can flood dmesg,
superfluous assignments, and convoluted goto label.

Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

authored by

Leon Romanovsky and committed by
Leon Romanovsky
2f49e159 e69609c5

+9 -19
+9 -19
drivers/infiniband/hw/bnxt_re/ib_verbs.c
··· 3377 3377 struct bnxt_qplib_chip_ctx *cctx; 3378 3378 struct bnxt_re_cq_resp resp = {}; 3379 3379 struct bnxt_re_cq_req req; 3380 - int cqe = attr->cqe; 3381 3380 int rc; 3382 3381 u32 active_cqs, entries; 3383 3382 ··· 3384 3385 return -EOPNOTSUPP; 3385 3386 3386 3387 /* Validate CQ fields */ 3387 - if (cqe < 1 || cqe > dev_attr->max_cq_wqes) { 3388 - ibdev_err(&rdev->ibdev, "Failed to create CQ -max exceeded"); 3388 + if (attr->cqe > dev_attr->max_cq_wqes) 3389 3389 return -EINVAL; 3390 - } 3391 3390 3392 3391 cq->rdev = rdev; 3393 3392 cctx = rdev->chip_ctx; ··· 3406 3409 ibcq->umem = ib_umem_get(&rdev->ibdev, req.cq_va, 3407 3410 entries * sizeof(struct cq_base), 3408 3411 IB_ACCESS_LOCAL_WRITE); 3409 - if (IS_ERR(ibcq->umem)) { 3410 - rc = PTR_ERR(ibcq->umem); 3411 - goto fail; 3412 - } 3412 + if (IS_ERR(ibcq->umem)) 3413 + return PTR_ERR(ibcq->umem); 3413 3414 } 3414 3415 3415 3416 rc = bnxt_re_setup_sginfo(rdev, ibcq->umem, &cq->qplib_cq.sg_info); 3416 3417 if (rc) 3417 - goto fail; 3418 + return rc; 3418 3419 3419 3420 cq->qplib_cq.dpi = &uctx->dpi; 3420 3421 cq->qplib_cq.max_wqe = entries; ··· 3421 3426 cq->qplib_cq.cnq_hw_ring_id = cq->qplib_cq.nq->ring_id; 3422 3427 3423 3428 rc = bnxt_qplib_create_cq(&rdev->qplib_res, &cq->qplib_cq); 3424 - if (rc) { 3425 - ibdev_err(&rdev->ibdev, "Failed to create HW CQ"); 3426 - goto fail; 3427 - } 3429 + if (rc) 3430 + return rc; 3428 3431 3429 3432 cq->ib_cq.cqe = entries; 3430 3433 cq->cq_period = cq->qplib_cq.period; ··· 3435 3442 hash_add(rdev->cq_hash, &cq->hash_entry, cq->qplib_cq.id); 3436 3443 /* Allocate a page */ 3437 3444 cq->uctx_cq_page = (void *)get_zeroed_page(GFP_KERNEL); 3438 - if (!cq->uctx_cq_page) { 3439 - rc = -ENOMEM; 3440 - goto fail; 3441 - } 3445 + if (!cq->uctx_cq_page) 3446 + return -ENOMEM; 3447 + 3442 3448 resp.comp_mask |= BNXT_RE_CQ_TOGGLE_PAGE_SUPPORT; 3443 3449 } 3444 3450 resp.cqid = cq->qplib_cq.id; 3445 3451 resp.tail = cq->qplib_cq.hwq.cons; 3446 3452 resp.phase = cq->qplib_cq.period; 3447 - resp.rsvd = 0; 3448 3453 rc = ib_respond_udata(udata, resp); 3449 3454 if (rc) { 3450 3455 bnxt_qplib_destroy_cq(&rdev->qplib_res, &cq->qplib_cq); ··· 3453 3462 3454 3463 free_mem: 3455 3464 free_page((unsigned long)cq->uctx_cq_page); 3456 - fail: 3457 3465 return rc; 3458 3466 } 3459 3467