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: Remove unnecessary checks in kernel CQ creation path

bnxt_re_create_cq() is a kernel verb, which means udata will always be
NULL and attr->cqe is valid. Remove the code handling this unreachable
case.

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
345f8427 2b2f0782

+2 -12
+2 -12
drivers/infiniband/hw/bnxt_re/ib_verbs.c
··· 3471 3471 { 3472 3472 struct bnxt_re_cq *cq = container_of(ibcq, struct bnxt_re_cq, ib_cq); 3473 3473 struct bnxt_re_dev *rdev = to_bnxt_re_dev(ibcq->device, ibdev); 3474 - struct ib_udata *udata = &attrs->driver_udata; 3475 - struct bnxt_re_ucontext *uctx = 3476 - rdma_udata_to_drv_context(udata, struct bnxt_re_ucontext, ib_uctx); 3477 3474 struct bnxt_qplib_dev_attr *dev_attr = rdev->dev_attr; 3478 - int cqe = attr->cqe; 3479 3475 int rc; 3480 3476 u32 active_cqs; 3481 - 3482 - if (udata) 3483 - return bnxt_re_create_user_cq(ibcq, attr, attrs); 3484 3477 3485 3478 if (attr->flags) 3486 3479 return -EOPNOTSUPP; 3487 3480 3488 3481 /* Validate CQ fields */ 3489 - if (cqe < 1 || cqe > dev_attr->max_cq_wqes) { 3490 - ibdev_err(&rdev->ibdev, "Failed to create CQ -max exceeded"); 3482 + if (attr->cqe > dev_attr->max_cq_wqes) 3491 3483 return -EINVAL; 3492 - } 3493 3484 3494 3485 cq->rdev = rdev; 3495 3486 cq->qplib_cq.cq_handle = (u64)(unsigned long)(&cq->qplib_cq); 3496 3487 3497 - cq->max_cql = bnxt_re_init_depth(attr->cqe + 1, 3498 - dev_attr->max_cq_wqes + 1, uctx); 3488 + cq->max_cql = attr->cqe + 1; 3499 3489 cq->cql = kcalloc(cq->max_cql, sizeof(struct bnxt_qplib_cqe), 3500 3490 GFP_KERNEL); 3501 3491 if (!cq->cql)