Re: [PATCH rdma-next v1 03/10] IB/uverbs: Extend CQ to get its own asynchronous event FD

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

 



On Wed, May 06, 2020 at 11:24:37AM +0300, Leon Romanovsky wrote:
> From: Yishai Hadas <yishaih@xxxxxxxxxxxx>
> 
> Extend CQ to get its own asynchronous event FD.
> The event FD is an optional attribute, in case wasn't given the ufile
> event FD will be used.
> 
> Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
>  drivers/infiniband/core/uverbs.h              | 18 ++++++++++++++++++
>  drivers/infiniband/core/uverbs_std_types_cq.c |  9 ++++++---
>  include/uapi/rdma/ib_user_ioctl_cmds.h        |  1 +
>  3 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h
> index 55b47f110183..7241009045a5 100644
> +++ b/drivers/infiniband/core/uverbs.h
> @@ -293,6 +293,24 @@ static inline u32 make_port_cap_flags(const struct ib_port_attr *attr)
>  	return res;
>  }
>  
> +static inline struct ib_uverbs_async_event_file *
> +ib_uverbs_get_async_event(struct uverbs_attr_bundle *attrs,
> +			  u16 id)
> +{
> +	struct ib_uobject *async_ev_file_uobj;
> +	struct ib_uverbs_async_event_file *async_ev_file;
> +
> +	async_ev_file_uobj = uverbs_attr_get_uobject(attrs, id);
> +	if (IS_ERR(async_ev_file_uobj))
> +		async_ev_file = attrs->ufile->default_async_file;

READ_ONCE here too

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