Message ID | 20230526102841.2226553-1-jiri@resnulli.us (mailing list archive) |
---|---|
Headers | show |
Series | devlink: move port ops into separate structure | expand |
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Fri, 26 May 2023 12:28:26 +0200 you wrote: > From: Jiri Pirko <jiri@nvidia.com> > > In devlink, some of the objects have separate ops registered alongside > with the object itself. Port however have ops in devlink_ops structure. > For drivers what register multiple kinds of ports with different ops > this is not convenient. > > [...] Here is the summary with links: - [net-next,v2,01/15] devlink: introduce port ops placeholder https://git.kernel.org/netdev/net-next/c/6acdf43d8abe - [net-next,v2,02/15] ice: register devlink port for PF with ops https://git.kernel.org/netdev/net-next/c/b2857685372b - [net-next,v2,03/15] mlxsw_core: register devlink port with ops https://git.kernel.org/netdev/net-next/c/865a1a1b97b6 - [net-next,v2,04/15] nfp: devlink: register devlink port with ops https://git.kernel.org/netdev/net-next/c/ab8ccc6c1347 - [net-next,v2,05/15] devlink: move port_split/unsplit() ops into devlink_port_ops https://git.kernel.org/netdev/net-next/c/f58a3e4dfe24 - [net-next,v2,06/15] mlx4: register devlink port with ops https://git.kernel.org/netdev/net-next/c/8a756d91d26c - [net-next,v2,07/15] devlink: move port_type_set() op into devlink_port_ops https://git.kernel.org/netdev/net-next/c/65a4c44bf937 - [net-next,v2,08/15] sfc: register devlink port with ops https://git.kernel.org/netdev/net-next/c/7bfb3d0a83b6 - [net-next,v2,09/15] mlx5: register devlink ports with ops https://git.kernel.org/netdev/net-next/c/aa3aff8264f2 - [net-next,v2,10/15] devlink: move port_fn_hw_addr_get/set() to devlink_port_ops https://git.kernel.org/netdev/net-next/c/71c93e37cf3d - [net-next,v2,11/15] devlink: move port_fn_roce_get/set() to devlink_port_ops https://git.kernel.org/netdev/net-next/c/933c13275c49 - [net-next,v2,12/15] devlink: move port_fn_migratable_get/set() to devlink_port_ops https://git.kernel.org/netdev/net-next/c/4a490d7154b3 - [net-next,v2,13/15] devlink: move port_fn_state_get/set() to devlink_port_ops https://git.kernel.org/netdev/net-next/c/216aa67f3e98 - [net-next,v2,14/15] devlink: move port_del() to devlink_port_ops https://git.kernel.org/netdev/net-next/c/216ba9f4adc8 - [net-next,v2,15/15] devlink: save devlink_port_ops into a variable in devlink_port_function_validate() https://git.kernel.org/netdev/net-next/c/4b5ed2b5a145 You are awesome, thank you!
From: Jiri Pirko <jiri@nvidia.com> In devlink, some of the objects have separate ops registered alongside with the object itself. Port however have ops in devlink_ops structure. For drivers what register multiple kinds of ports with different ops this is not convenient. This patchset changes does following changes: 1) Introduces devlink_port_ops with functions that allow devlink port to be registered passing a pointer to driver port ops. (patch #1) 2) Converts drivers to define port_ops and register ports passing the ops pointer. (patches #2, #3, #4, #6, #8, and #9) 3) Moves ops from devlink_ops struct to devlink_port_ops. (patches #5, #7, #10-15) No functional changes. --- v1->v2: - see individual patches, there are 2 cosmetical changes basically: - fixed function names in kdoc comments - use dummy empty ops in case ops is null Jiri Pirko (15): devlink: introduce port ops placeholder ice: register devlink port for PF with ops mlxsw_core: register devlink port with ops nfp: devlink: register devlink port with ops devlink: move port_split/unsplit() ops into devlink_port_ops mlx4: register devlink port with ops devlink: move port_type_set() op into devlink_port_ops sfc: register devlink port with ops mlx5: register devlink ports with ops devlink: move port_fn_hw_addr_get/set() to devlink_port_ops devlink: move port_fn_roce_get/set() to devlink_port_ops devlink: move port_fn_migratable_get/set() to devlink_port_ops devlink: move port_fn_state_get/set() to devlink_port_ops devlink: move port_del() to devlink_port_ops devlink: save devlink_port_ops into a variable in devlink_port_function_validate() drivers/net/ethernet/intel/ice/ice_devlink.c | 10 +- drivers/net/ethernet/mellanox/mlx4/main.c | 58 ++--- .../net/ethernet/mellanox/mlx5/core/devlink.c | 9 - .../mellanox/mlx5/core/esw/devlink_port.c | 29 ++- .../net/ethernet/mellanox/mlx5/core/eswitch.h | 12 +- .../mellanox/mlx5/core/eswitch_offloads.c | 12 +- drivers/net/ethernet/mellanox/mlxsw/core.c | 10 +- .../net/ethernet/netronome/nfp/nfp_devlink.c | 10 +- drivers/net/ethernet/sfc/efx_devlink.c | 80 +++--- include/net/devlink.h | 228 +++++++++--------- net/devlink/leftover.c | 119 +++++---- 11 files changed, 298 insertions(+), 279 deletions(-)