From: Yishai Hadas <yishaih@dev.mellanox.co.il>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: Doug Ledford <dledford@redhat.com>,
Leon Romanovsky <leonro@mellanox.com>,
RDMA mailing list <linux-rdma@vger.kernel.org>,
Yishai Hadas <yishaih@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>,
linux-netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH rdma-next v1 08/12] IB/mlx5: Introduce MLX5_IB_OBJECT_DEVX_ASYNC_EVENT_FD
Date: Mon, 24 Jun 2019 16:25:37 +0300 [thread overview]
Message-ID: <baae74b9-94ff-9f5a-0992-c1eec5049306@dev.mellanox.co.il> (raw)
In-Reply-To: <20190624115059.GA5479@mellanox.com>
On 6/24/2019 2:51 PM, Jason Gunthorpe wrote:
> On Tue, Jun 18, 2019 at 08:15:36PM +0300, Leon Romanovsky wrote:
>> From: Yishai Hadas <yishaih@mellanox.com>
>>
>> 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@mellanox.com>
>> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>> 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
>
How about having another struct with all the event's queue fields
together ? this has the benefit of having all those related fields in
one place and leave the cmd as is.
Alternatively,
We can inline the event stuff under devx_async_event_file and leave the
cmd for now under a struct as it's not directly related to this series.
What do you think ?
>> + 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?
The flags are coming from user space and have their different name
space, I prefer to not mix with kernel ones. (i.e. is_destroyed).
Makes sense ?
>
>> +
>> +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
>
OK, will handle.
>> 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
Quite long but follows the name scheme having the UAPI prefix.
Any shorter suggestion ?
next prev parent reply other threads:[~2019-06-24 13:25 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 17:15 [PATCH rdma-next v1 00/12] DEVX asynchronous events Leon Romanovsky
2019-06-18 17:15 ` [PATCH mlx5-next v1 01/12] net/mlx5: Fix mlx5_core_destroy_cq() error flow Leon Romanovsky
2019-06-18 17:15 ` [PATCH mlx5-next v1 02/12] net/mlx5: Use event mask based on device capabilities Leon Romanovsky
2019-06-27 0:23 ` Saeed Mahameed
2019-06-18 17:15 ` [PATCH mlx5-next v1 03/12] net/mlx5: Expose the API to register for ANY event Leon Romanovsky
2019-06-18 17:15 ` [PATCH mlx5-next v1 04/12] net/mlx5: mlx5_core_create_cq() enhancements Leon Romanovsky
2019-06-18 17:15 ` [PATCH mlx5-next v1 05/12] net/mlx5: Report a CQ error event only when a handler was set Leon Romanovsky
2019-06-18 17:15 ` [PATCH mlx5-next v1 06/12] net/mlx5: Report EQE data upon CQ completion Leon Romanovsky
2019-06-18 17:15 ` [PATCH mlx5-next v1 07/12] net/mlx5: Expose device definitions for object events Leon Romanovsky
2019-06-18 17:15 ` [PATCH rdma-next v1 08/12] IB/mlx5: Introduce MLX5_IB_OBJECT_DEVX_ASYNC_EVENT_FD Leon Romanovsky
2019-06-24 11:51 ` Jason Gunthorpe
2019-06-24 13:25 ` Yishai Hadas [this message]
2019-06-24 14:30 ` Jason Gunthorpe
2019-06-18 17:15 ` [PATCH rdma-next v1 09/12] IB/mlx5: Register DEVX with mlx5_core to get async events Leon Romanovsky
2019-06-24 11:52 ` Jason Gunthorpe
2019-06-24 13:36 ` Yishai Hadas
2019-06-24 14:30 ` Jason Gunthorpe
2019-06-18 17:15 ` [PATCH rdma-next v1 10/12] IB/mlx5: Enable subscription for device events over DEVX Leon Romanovsky
2019-06-24 11:57 ` Jason Gunthorpe
2019-06-24 16:13 ` Yishai Hadas
2019-06-24 17:56 ` Jason Gunthorpe
2019-06-18 17:15 ` [PATCH rdma-next v1 11/12] IB/mlx5: Implement DEVX dispatching event Leon Romanovsky
2019-06-24 12:03 ` Jason Gunthorpe
2019-06-24 16:55 ` Yishai Hadas
2019-06-24 18:06 ` Jason Gunthorpe
2019-06-25 14:41 ` Yishai Hadas
2019-06-25 20:23 ` Jason Gunthorpe
2019-06-18 17:15 ` [PATCH rdma-next v1 12/12] IB/mlx5: Add DEVX support for CQ events Leon Romanovsky
2019-06-24 12:04 ` Jason Gunthorpe
2019-06-24 17:03 ` Yishai Hadas
2019-06-24 18:06 ` Jason Gunthorpe
2019-06-18 18:51 ` [PATCH rdma-next v1 00/12] DEVX asynchronous events Saeed Mahameed
2019-06-19 4:45 ` Leon Romanovsky
2019-06-24 21:57 ` Saeed Mahameed
2019-06-30 8:53 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=baae74b9-94ff-9f5a-0992-c1eec5049306@dev.mellanox.co.il \
--to=yishaih@dev.mellanox.co.il \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=yishaih@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).