From: Leon Romanovsky <leon@kernel.org>
To: Petr Pavlu <petr.pavlu@suse.com>
Cc: tariqt@nvidia.com, yishaih@nvidia.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
jgg@ziepe.ca, netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 03/11] mlx4: Use 'void *' as the event param of mlx4_dispatch_event()
Date: Tue, 22 Aug 2023 17:03:42 +0300 [thread overview]
Message-ID: <20230822140342.GE6029@unreal> (raw)
In-Reply-To: <20230821131225.11290-4-petr.pavlu@suse.com>
On Mon, Aug 21, 2023 at 03:12:17PM +0200, Petr Pavlu wrote:
> Function mlx4_dispatch_event() takes an 'unsigned long' as its event
> parameter. The actual value is none (MLX4_DEV_EVENT_CATASTROPHIC_ERROR),
> a pointer to mlx4_eqe (MLX4_DEV_EVENT_PORT_MGMT_CHANGE), or a 32-bit
> integer (remaining events).
>
> In preparation to switch mlx4_en and mlx4_ib to be an auxiliary device,
> the mlx4_interface.event callback is replaced with a notifier and
> function mlx4_dispatch_event() gets updated to invoke
> atomic_notifier_call_chain(). This requires forwarding the input 'param'
> value from the former function to the latter. A problem is that the
> notifier call takes 'void *' as its 'param' value, compared to
> 'unsigned long' used by mlx4_dispatch_event(). Re-passing the value
> would need either punning it to 'void *' or passing down the address of
> the input 'param'. Both approaches create a number of unnecessary casts.
>
> Change instead the input 'param' of mlx4_dispatch_event() from
> 'unsigned long' to 'void *'. A mlx4_eqe pointer can be passed directly,
> callers using an int value are adjusted to pass its address.
>
> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> ---
> drivers/infiniband/hw/mlx4/main.c | 14 ++++++++++----
> drivers/net/ethernet/mellanox/mlx4/catas.c | 2 +-
> drivers/net/ethernet/mellanox/mlx4/cmd.c | 4 ++--
> drivers/net/ethernet/mellanox/mlx4/en_main.c | 17 +++++++++++++++--
> drivers/net/ethernet/mellanox/mlx4/eq.c | 15 ++++++++-------
> drivers/net/ethernet/mellanox/mlx4/intf.c | 2 +-
> drivers/net/ethernet/mellanox/mlx4/mlx4.h | 2 +-
> include/linux/mlx4/driver.h | 2 +-
> 8 files changed, 39 insertions(+), 19 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
next prev parent reply other threads:[~2023-08-22 14:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 13:12 [PATCH net-next v3 00/11] Convert mlx4 to use auxiliary bus Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 01/11] mlx4: Get rid of the mlx4_interface.get_dev callback Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 02/11] mlx4: Rename member mlx4_en_dev.nb to netdev_nb Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 03/11] mlx4: Use 'void *' as the event param of mlx4_dispatch_event() Petr Pavlu
2023-08-22 14:03 ` Leon Romanovsky [this message]
2023-08-21 13:12 ` [PATCH net-next v3 04/11] mlx4: Replace the mlx4_interface.event callback with a notifier Petr Pavlu
2023-08-22 14:04 ` Leon Romanovsky
2023-08-21 13:12 ` [PATCH net-next v3 05/11] mlx4: Get rid of the mlx4_interface.activate callback Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 06/11] mlx4: Move the bond work to the core driver Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 07/11] mlx4: Avoid resetting MLX4_INTFF_BONDING per driver Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 08/11] mlx4: Register mlx4 devices to an auxiliary virtual bus Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 09/11] mlx4: Connect the ethernet part to the auxiliary bus Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 10/11] mlx4: Connect the infiniband " Petr Pavlu
2023-08-21 13:12 ` [PATCH net-next v3 11/11] mlx4: Delete custom device management logic Petr Pavlu
2023-08-23 7:30 ` [PATCH net-next v3 00/11] Convert mlx4 to use auxiliary bus patchwork-bot+netdevbpf
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=20230822140342.GE6029@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jgg@ziepe.ca \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petr.pavlu@suse.com \
--cc=tariqt@nvidia.com \
--cc=yishaih@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.