]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
RDMA/cxgb3: Delete and properly mark unimplemented resize CQ function
authorLeon Romanovsky <leonro@mellanox.com>
Mon, 20 May 2019 06:54:30 +0000 (09:54 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 27 May 2019 17:24:04 +0000 (14:24 -0300)
Resize CQ implementation was guarded by undeclared "notyet" define while
cxgb3 was added to the kernel. Twelve years later, this call is still
unimplemented, so safely delete it and fix improper return error code when
.resize_cq() is not implemented.

Fixes: b038ced7b370 ("RDMA/cxgb3: Add driver for Chelsio T3 RNIC")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/cxgb3/cxio_hal.c
drivers/infiniband/hw/cxgb3/cxio_hal.h
drivers/infiniband/hw/cxgb3/iwch_provider.c

index 73bc6b8f2a0cc6876b5b2a964c8d9ab00591c4d2..d9c741fea0e95352a94df4f9f42a21726de84f1a 100644 (file)
@@ -187,20 +187,6 @@ int cxio_create_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq, int kernel)
        return (rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_CQ_SETUP, &setup));
 }
 
-#ifdef notyet
-int cxio_resize_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq)
-{
-       struct rdma_cq_setup setup;
-       setup.id = cq->cqid;
-       setup.base_addr = (u64) (cq->dma_addr);
-       setup.size = 1UL << cq->size_log2;
-       setup.credits = setup.size;
-       setup.credit_thres = setup.size;        /* TBD: overflow recovery */
-       setup.ovfl_mode = 1;
-       return (rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_CQ_SETUP, &setup));
-}
-#endif
-
 static u32 get_qpid(struct cxio_rdev *rdev_p, struct cxio_ucontext *uctx)
 {
        struct cxio_qpid_list *entry;
index c64e50b5a548546a2ebadfd8a98bb52cf73685ad..5fc26a4648d3e1636e06e20b9183db6c9632117c 100644 (file)
@@ -159,7 +159,6 @@ int cxio_hal_cq_op(struct cxio_rdev *rdev, struct t3_cq *cq,
                   enum t3_cq_opcode op, u32 credit);
 int cxio_create_cq(struct cxio_rdev *rdev, struct t3_cq *cq, int kernel);
 int cxio_destroy_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
-int cxio_resize_cq(struct cxio_rdev *rdev, struct t3_cq *cq);
 void cxio_release_ucontext(struct cxio_rdev *rdev, struct cxio_ucontext *uctx);
 void cxio_init_ucontext(struct cxio_rdev *rdev, struct cxio_ucontext *uctx);
 int cxio_create_qp(struct cxio_rdev *rdev, u32 kernel_domain, struct t3_wq *wq,
index 7e6adf01d1d68031b5b6ce16836817df12ab6d80..4bfab739ec0dbce7be836b334a0c4251a66aeb92 100644 (file)
@@ -211,73 +211,6 @@ static struct ib_cq *iwch_create_cq(struct ib_device *ibdev,
        return &chp->ibcq;
 }
 
-static int iwch_resize_cq(struct ib_cq *cq, int cqe, struct ib_udata *udata)
-{
-#ifdef notyet
-       struct iwch_cq *chp = to_iwch_cq(cq);
-       struct t3_cq oldcq, newcq;
-       int ret;
-
-       pr_debug("%s ib_cq %p cqe %d\n", __func__, cq, cqe);
-
-       /* We don't downsize... */
-       if (cqe <= cq->cqe)
-               return 0;
-
-       /* create new t3_cq with new size */
-       cqe = roundup_pow_of_two(cqe+1);
-       newcq.size_log2 = ilog2(cqe);
-
-       /* Dont allow resize to less than the current wce count */
-       if (cqe < Q_COUNT(chp->cq.rptr, chp->cq.wptr)) {
-               return -ENOMEM;
-       }
-
-       /* Quiesce all QPs using this CQ */
-       ret = iwch_quiesce_qps(chp);
-       if (ret) {
-               return ret;
-       }
-
-       ret = cxio_create_cq(&chp->rhp->rdev, &newcq);
-       if (ret) {
-               return ret;
-       }
-
-       /* copy CQEs */
-       memcpy(newcq.queue, chp->cq.queue, (1 << chp->cq.size_log2) *
-                                       sizeof(struct t3_cqe));
-
-       /* old iwch_qp gets new t3_cq but keeps old cqid */
-       oldcq = chp->cq;
-       chp->cq = newcq;
-       chp->cq.cqid = oldcq.cqid;
-
-       /* resize new t3_cq to update the HW context */
-       ret = cxio_resize_cq(&chp->rhp->rdev, &chp->cq);
-       if (ret) {
-               chp->cq = oldcq;
-               return ret;
-       }
-       chp->ibcq.cqe = (1<<chp->cq.size_log2) - 1;
-
-       /* destroy old t3_cq */
-       oldcq.cqid = newcq.cqid;
-       ret = cxio_destroy_cq(&chp->rhp->rdev, &oldcq);
-       if (ret) {
-               pr_err("%s - cxio_destroy_cq failed %d\n", __func__, ret);
-       }
-
-       /* add user hooks here */
-
-       /* resume qps */
-       ret = iwch_resume_qps(chp);
-       return ret;
-#else
-       return -ENOSYS;
-#endif
-}
-
 static int iwch_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
 {
        struct iwch_dev *rhp;
@@ -1340,7 +1273,6 @@ static const struct ib_device_ops iwch_dev_ops = {
        .query_port = iwch_query_port,
        .reg_user_mr = iwch_reg_user_mr,
        .req_notify_cq = iwch_arm_cq,
-       .resize_cq = iwch_resize_cq,
        INIT_RDMA_OBJ_SIZE(ib_pd, iwch_pd, ibpd),
        INIT_RDMA_OBJ_SIZE(ib_ucontext, iwch_ucontext, ibucontext),
 };