From 6706a3b94f890145ca09797f748d2b30e1414fd3 Mon Sep 17 00:00:00 2001 From: Vu Pham Date: Wed, 29 May 2019 22:50:37 +0000 Subject: net/mlx5: E-Switch, Honor eswitch functions changed event cap Whenever device supports eswitch functions changed event, honor such device setting. Do not limit it to ECPF. Signed-off-by: Parav Pandit Signed-off-by: Vu Pham Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c') diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 83689678b400..05cb2fffd887 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -1836,7 +1836,7 @@ static int esw_functions_changed_event(struct notifier_block *nb, static void esw_functions_changed_event_init(struct mlx5_eswitch *esw, u16 vf_nvports) { - if (!mlx5_core_is_ecpf_esw_manager(esw->dev)) + if (!mlx5_eswitch_is_funcs_handler(esw->dev)) return; MLX5_NB_INIT(&esw->esw_funcs.nb, esw_functions_changed_event, @@ -1847,7 +1847,7 @@ static void esw_functions_changed_event_init(struct mlx5_eswitch *esw, static void esw_functions_changed_event_cleanup(struct mlx5_eswitch *esw) { - if (!mlx5_core_is_ecpf_esw_manager(esw->dev)) + if (!mlx5_eswitch_is_funcs_handler(esw->dev)) return; mlx5_eq_notifier_unregister(esw->dev, &esw->esw_funcs.nb); @@ -1905,7 +1905,7 @@ void esw_offloads_cleanup(struct mlx5_eswitch *esw) esw_functions_changed_event_cleanup(esw); - if (mlx5_core_is_ecpf_esw_manager(esw->dev)) + if (mlx5_eswitch_is_funcs_handler(esw->dev)) num_vfs = esw->esw_funcs.num_vfs; else num_vfs = esw->dev->priv.sriov.num_vfs; -- cgit v1.2.3