Re: [PATCH rdma-next 01/10] RDMA: Restore ability to fail on PD deallocate

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

 



On 24/08/2020 13:32, Leon Romanovsky wrote:
> diff --git a/drivers/infiniband/hw/efa/efa.h b/drivers/infiniband/hw/efa/efa.h
> index 1889dd172a25..8547f9d543df 100644
> --- a/drivers/infiniband/hw/efa/efa.h
> +++ b/drivers/infiniband/hw/efa/efa.h
> @@ -134,7 +134,7 @@ int efa_query_gid(struct ib_device *ibdev, u8 port, int index,
>  int efa_query_pkey(struct ib_device *ibdev, u8 port, u16 index,
>  		   u16 *pkey);
>  int efa_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata);
> -void efa_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata);
> +int efa_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata);
>  int efa_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata);
>  struct ib_qp *efa_create_qp(struct ib_pd *ibpd,
>  			    struct ib_qp_init_attr *init_attr,
> diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
> index 3f7f19b9f463..660a69943e02 100644
> --- a/drivers/infiniband/hw/efa/efa_verbs.c
> +++ b/drivers/infiniband/hw/efa/efa_verbs.c
> @@ -383,13 +383,14 @@ int efa_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
>  	return err;
>  }
> 
> -void efa_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
> +int efa_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
>  {
>  	struct efa_dev *dev = to_edev(ibpd->device);
>  	struct efa_pd *pd = to_epd(ibpd);
> 
>  	ibdev_dbg(&dev->ibdev, "Dealloc pd[%d]\n", pd->pdn);
>  	efa_pd_dealloc(dev, pd->pdn);
> +	return 0;
>  }

Nice change, thanks Leon.
At least for EFA, I prefer to return the return value of the destroy command
instead of silently ignoring it (same for the other patches).



[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