Re: [PATCH 15/32] cxgb4: Convert cqidr to XArray

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 20, 2019 at 04:20:50PM -0800, Matthew Wilcox wrote:
> Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>
>  drivers/infiniband/hw/cxgb4/cq.c       | 6 +++---
>  drivers/infiniband/hw/cxgb4/device.c   | 4 +---
>  drivers/infiniband/hw/cxgb4/ev.c       | 8 ++++----
>  drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 4 ++--
>  4 files changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
> index 1fd8798d91a7..1fa5f6445be3 100644
> +++ b/drivers/infiniband/hw/cxgb4/cq.c
> @@ -976,7 +976,7 @@ int c4iw_destroy_cq(struct ib_cq *ib_cq)
>  	pr_debug("ib_cq %p\n", ib_cq);
>  	chp = to_c4iw_cq(ib_cq);
>  
> -	remove_handle(chp->rhp, &chp->rhp->cqidr, chp->cq.cqid);
> +	xa_erase_irq(&chp->rhp->cqs, chp->cq.cqid);
>  	atomic_dec(&chp->refcnt);
>  	wait_event(chp->wait, !atomic_read(&chp->refcnt));
>  
> @@ -1088,7 +1088,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev,
>  	spin_lock_init(&chp->comp_handler_lock);
>  	atomic_set(&chp->refcnt, 1);
>  	init_waitqueue_head(&chp->wait);
> -	ret = insert_handle(rhp, &rhp->cqidr, chp, chp->cq.cqid);
> +	ret = xa_insert_irq(&rhp->cqs, chp->cq.cqid, chp, GFP_KERNEL);
>  	if (ret)
>  		goto err_destroy_cq;
>  
> @@ -1143,7 +1143,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev,
>  err_free_mm:
>  	kfree(mm);
>  err_remove_handle:
> -	remove_handle(rhp, &rhp->cqidr, chp->cq.cqid);
> +	xa_erase_irq(&rhp->cqs, chp->cq.cqid);
>  err_destroy_cq:
>  	destroy_cq(&chp->rhp->rdev, &chp->cq,
>  		   ucontext ? &ucontext->uctx : &rhp->rdev.uctx,
> diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
> index c13c0ba30f63..d78039043c55 100644
> +++ b/drivers/infiniband/hw/cxgb4/device.c
> @@ -924,8 +924,6 @@ static void c4iw_rdev_close(struct c4iw_rdev *rdev)
>  void c4iw_dealloc(struct uld_ctx *ctx)
>  {
>  	c4iw_rdev_close(&ctx->dev->rdev);
> -	WARN_ON_ONCE(!idr_is_empty(&ctx->dev->cqidr));
> -	idr_destroy(&ctx->dev->cqidr);

I'd like to apply the patches Steve Ack'd but I want to keep the
WARN_ONs. It just doesn't make sense in our syzkaller-testing world to
remove deterministic and reliable assertions on the slow path.

Are you OK with that Matt?

Thanks,
Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux