Commit dca147b3 authored by Maxim Mikityanskiy's avatar Maxim Mikityanskiy Committed by Saeed Mahameed

net/mlx5e: Rename hw_modify to preactivate

mlx5e_safe_switch_channels accepts a callback to be called before
activating new channels. It is intended to configure some hardware
parameters in cases where channels are recreated because some
configuration has changed.

Recently, this callback has started being used to update the driver's
internal MLX5E_STATE_XDP_OPEN flag, and the following patches also
intend to use this callback for software preparations. This patch
renames the hw_modify callback to preactivate, so that the name fits
better.
Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent c2c95271
...@@ -1035,14 +1035,14 @@ int mlx5e_open_channels(struct mlx5e_priv *priv, ...@@ -1035,14 +1035,14 @@ int mlx5e_open_channels(struct mlx5e_priv *priv,
struct mlx5e_channels *chs); struct mlx5e_channels *chs);
void mlx5e_close_channels(struct mlx5e_channels *chs); void mlx5e_close_channels(struct mlx5e_channels *chs);
/* Function pointer to be used to modify WH settings while /* Function pointer to be used to modify HW or kernel settings while
* switching channels * switching channels
*/ */
typedef int (*mlx5e_fp_hw_modify)(struct mlx5e_priv *priv); typedef int (*mlx5e_fp_preactivate)(struct mlx5e_priv *priv);
int mlx5e_safe_reopen_channels(struct mlx5e_priv *priv); int mlx5e_safe_reopen_channels(struct mlx5e_priv *priv);
int mlx5e_safe_switch_channels(struct mlx5e_priv *priv, int mlx5e_safe_switch_channels(struct mlx5e_priv *priv,
struct mlx5e_channels *new_chs, struct mlx5e_channels *new_chs,
mlx5e_fp_hw_modify hw_modify); mlx5e_fp_preactivate preactivate);
void mlx5e_activate_priv_channels(struct mlx5e_priv *priv); void mlx5e_activate_priv_channels(struct mlx5e_priv *priv);
void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv); void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv);
......
...@@ -2937,7 +2937,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv) ...@@ -2937,7 +2937,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv)
static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv, static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv,
struct mlx5e_channels *new_chs, struct mlx5e_channels *new_chs,
mlx5e_fp_hw_modify hw_modify) mlx5e_fp_preactivate preactivate)
{ {
struct net_device *netdev = priv->netdev; struct net_device *netdev = priv->netdev;
int new_num_txqs; int new_num_txqs;
...@@ -2956,9 +2956,11 @@ static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv, ...@@ -2956,9 +2956,11 @@ static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv,
priv->channels = *new_chs; priv->channels = *new_chs;
/* New channels are ready to roll, modify HW settings if needed */ /* New channels are ready to roll, call the preactivate hook if needed
if (hw_modify) * to modify HW settings or update kernel parameters.
hw_modify(priv); */
if (preactivate)
preactivate(priv);
priv->profile->update_rx(priv); priv->profile->update_rx(priv);
mlx5e_activate_priv_channels(priv); mlx5e_activate_priv_channels(priv);
...@@ -2970,7 +2972,7 @@ static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv, ...@@ -2970,7 +2972,7 @@ static void mlx5e_switch_priv_channels(struct mlx5e_priv *priv,
int mlx5e_safe_switch_channels(struct mlx5e_priv *priv, int mlx5e_safe_switch_channels(struct mlx5e_priv *priv,
struct mlx5e_channels *new_chs, struct mlx5e_channels *new_chs,
mlx5e_fp_hw_modify hw_modify) mlx5e_fp_preactivate preactivate)
{ {
int err; int err;
...@@ -2978,7 +2980,7 @@ int mlx5e_safe_switch_channels(struct mlx5e_priv *priv, ...@@ -2978,7 +2980,7 @@ int mlx5e_safe_switch_channels(struct mlx5e_priv *priv,
if (err) if (err)
return err; return err;
mlx5e_switch_priv_channels(priv, new_chs, hw_modify); mlx5e_switch_priv_channels(priv, new_chs, preactivate);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment