On Tue, Jun 18, 2019 at 08:15:36PM +0300, Leon Romanovsky wrote: > From: Yishai Hadas <yishaih@xxxxxxxxxxxx> > > Introduce MLX5_IB_OBJECT_DEVX_ASYNC_EVENT_FD and its initial > implementation. > > This object is from type class FD and will be used to read DEVX > async events. > > Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > drivers/infiniband/hw/mlx5/devx.c | 112 ++++++++++++++++++++-- > include/uapi/rdma/mlx5_user_ioctl_cmds.h | 10 ++ > include/uapi/rdma/mlx5_user_ioctl_verbs.h | 4 + > 3 files changed, 116 insertions(+), 10 deletions(-) > > diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c > index 80b42d069328..1815ce0f8daf 100644 > +++ b/drivers/infiniband/hw/mlx5/devx.c > @@ -33,6 +33,24 @@ struct devx_async_data { > struct mlx5_ib_uapi_devx_async_cmd_hdr hdr; > }; > > +struct devx_async_event_queue { It seems to be a mistake to try and re-use the async_event_queue for both cmd and event, as they use it very differently and don't even store the same things in the event_list. I think it is bettter to just inline this into devx_async_event_file (and inline the old struct in the cmd file > + spinlock_t lock; > + wait_queue_head_t poll_wait; > + struct list_head event_list; > + atomic_t bytes_in_use; > + u8 is_destroyed:1; > + u32 flags; > +}; All the flags testing is ugly, why not just add another bitfield? > + > +struct devx_async_event_file { > + struct ib_uobject uobj; > + struct list_head subscribed_events_list; /* Head of events that are > + * subscribed to this FD > + */ > + struct devx_async_event_queue ev_queue; > + struct mlx5_ib_dev *dev; > +}; > + Crazy indenting > diff --git a/include/uapi/rdma/mlx5_user_ioctl_verbs.h b/include/uapi/rdma/mlx5_user_ioctl_verbs.h > index a8f34c237458..57beea4589e4 100644 > +++ b/include/uapi/rdma/mlx5_user_ioctl_verbs.h > @@ -63,5 +63,9 @@ enum mlx5_ib_uapi_dm_type { > MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_SW_ICM, > }; > > +enum mlx5_ib_uapi_devx_create_event_channel_flags { > + MLX5_IB_UAPI_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA = 1 > << 0, Maybe this name is too long Jason