net/mlx5e: Cleanup safe switch channels API by passing params
authorMaxim Mikityanskiy <maximmi@nvidia.com>
Tue, 16 Mar 2021 13:47:58 +0000 (15:47 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 16 Apr 2021 18:48:20 +0000 (11:48 -0700)
commit94872d4ef9c09cb0938595b473c68f4a5fb138f6
treedd39eb9dcb49ec32463cce54f9ede9acf0d3be13
parentb3b886cf965d5f8d8e51f9481ce60ee8f9548580
net/mlx5e: Cleanup safe switch channels API by passing params

mlx5e_safe_switch_channels accepts new_chs as a parameter and opens new
channels in place, then copying them to priv->channels. It requires all
the callers to allocate space for this temporary storage of the new
channels.

This commit cleans up the API by replacing new_chs with new_params, a
meaningful subset of new_chs to be filled by the caller. The temporary
space for the new channels is allocated inside mlx5e_safe_switch_params
(a new name for mlx5e_safe_switch_channels). An extra copy of params is
made, but since it's control flow, it's not critical.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c