From: Jakub Kicinski <kuba@kernel.org>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
edumazet@google.com, leon@kernel.org, saeedm@nvidia.com,
moshe@nvidia.com, jesse.brandeburg@intel.com,
anthony.l.nguyen@intel.com, tariqt@nvidia.com, idosch@nvidia.com,
petrm@nvidia.com, simon.horman@corigine.com,
ecree.xilinx@gmail.com, habetsm.xilinx@gmail.com,
michal.wilczynski@intel.com, jacob.e.keller@intel.com
Subject: Re: [patch net-next v2 14/15] devlink: move port_del() to devlink_port_ops
Date: Mon, 29 May 2023 18:41:19 -0700 [thread overview]
Message-ID: <20230529184119.414d62f3@kernel.org> (raw)
In-Reply-To: <ZHRi0qZD/Hsjn0Fq@nanopsycho>
On Mon, 29 May 2023 10:31:14 +0200 Jiri Pirko wrote:
> >One could argue logically removing a port is also an operation of
> >the parent (i.e. the devlink instance). The fact that the port gets
> >destroyed in the process is secondary. Ergo maybe we should skip
> >this patch?
>
> Well, the port_del() could differ for different port flavours. The
> embedding structure of struct devlink_port is also different.
>
> Makes sense to me to skip the flavour switch and have one port_del() for
> each port.
The asymmetry bothers me. It's hard to comment on what the best
approach is given this series shows no benefit of moving port_del().
Maybe even a loss, as mlx5 now has an ifdef in two places:
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> index e39fd85ea2f9..63635cc44479 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> @@ -320,7 +320,6 @@ static const struct devlink_ops mlx5_devlink_ops = {
> #endif
> #ifdef CONFIG_MLX5_SF_MANAGER
> .port_new = mlx5_devlink_sf_port_new,
> - .port_del = mlx5_devlink_sf_port_del,
> #endif
> .flash_update = mlx5_devlink_flash_update,
> .info_get = mlx5_devlink_info_get,
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c
> index 76c5d6e9d47f..f370f67d9e33 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c
> @@ -145,6 +145,9 @@ struct devlink_port *mlx5_esw_offloads_devlink_port(struct mlx5_eswitch *esw, u1
> }
>
> static const struct devlink_port_ops mlx5_esw_dl_sf_port_ops = {
> +#ifdef CONFIG_MLX5_SF_MANAGER
> + .port_del = mlx5_devlink_sf_port_del,
> +#endif
> .port_fn_hw_addr_get = mlx5_devlink_port_fn_hw_addr_get,
> .port_fn_hw_addr_set = mlx5_devlink_port_fn_hw_addr_set,
> .port_fn_roce_get = mlx5_devlink_port_fn_roce_get,
Is it okay if we deferred the port_del() patch until there's some
clear benefit?
next prev parent reply other threads:[~2023-05-30 1:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 10:28 [patch net-next v2 00/15] devlink: move port ops into separate structure Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 01/15] devlink: introduce port ops placeholder Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 02/15] ice: register devlink port for PF with ops Jiri Pirko
2023-05-26 10:52 ` Wilczynski, Michal
2023-05-26 11:35 ` Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 03/15] mlxsw_core: register devlink port " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 04/15] nfp: devlink: " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 05/15] devlink: move port_split/unsplit() ops into devlink_port_ops Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 06/15] mlx4: register devlink port with ops Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 07/15] devlink: move port_type_set() op into devlink_port_ops Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 08/15] sfc: register devlink port with ops Jiri Pirko
2023-05-30 8:02 ` Martin Habets
2023-05-26 10:28 ` [patch net-next v2 09/15] mlx5: register devlink ports " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 10/15] devlink: move port_fn_hw_addr_get/set() to devlink_port_ops Jiri Pirko
2023-05-30 8:03 ` Martin Habets
2023-05-26 10:28 ` [patch net-next v2 11/15] devlink: move port_fn_roce_get/set() " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 12/15] devlink: move port_fn_migratable_get/set() " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 13/15] devlink: move port_fn_state_get/set() " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 14/15] devlink: move port_del() " Jiri Pirko
2023-05-27 4:10 ` Jakub Kicinski
2023-05-27 7:42 ` Jiri Pirko
2023-05-29 6:33 ` Jakub Kicinski
2023-05-29 8:31 ` Jiri Pirko
2023-05-30 1:41 ` Jakub Kicinski [this message]
2023-05-30 6:33 ` Jiri Pirko
2023-05-30 6:58 ` Jiri Pirko
2023-05-30 17:34 ` Jakub Kicinski
2023-05-31 6:33 ` Jiri Pirko
2023-06-01 22:16 ` Jacob Keller
2023-05-26 10:28 ` [patch net-next v2 15/15] devlink: save devlink_port_ops into a variable in devlink_port_function_validate() Jiri Pirko
2023-05-30 18:00 ` [patch net-next v2 00/15] devlink: move port ops into separate structure 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=20230529184119.414d62f3@kernel.org \
--to=kuba@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=habetsm.xilinx@gmail.com \
--cc=idosch@nvidia.com \
--cc=jacob.e.keller@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=jiri@resnulli.us \
--cc=leon@kernel.org \
--cc=michal.wilczynski@intel.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=simon.horman@corigine.com \
--cc=tariqt@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 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).