File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
drivers/net/ethernet/mellanox/mlx5/core Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1038,6 +1038,25 @@ const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev)
1038
1038
return ERR_PTR (err );
1039
1039
}
1040
1040
1041
+ static int mlx5_esw_host_functions_enabled_query (struct mlx5_eswitch * esw )
1042
+ {
1043
+ const u32 * query_host_out ;
1044
+
1045
+ if (!mlx5_core_is_ecpf_esw_manager (esw -> dev ))
1046
+ return 0 ;
1047
+
1048
+ query_host_out = mlx5_esw_query_functions (esw -> dev );
1049
+ if (IS_ERR (query_host_out ))
1050
+ return PTR_ERR (query_host_out );
1051
+
1052
+ esw -> esw_funcs .host_funcs_disabled =
1053
+ MLX5_GET (query_esw_functions_out , query_host_out ,
1054
+ host_params_context .host_pf_not_exist );
1055
+
1056
+ kvfree (query_host_out );
1057
+ return 0 ;
1058
+ }
1059
+
1041
1060
static void mlx5_eswitch_event_handler_register (struct mlx5_eswitch * esw )
1042
1061
{
1043
1062
if (esw -> mode == MLX5_ESWITCH_OFFLOADS && mlx5_eswitch_is_funcs_handler (esw -> dev )) {
@@ -1874,6 +1893,10 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
1874
1893
goto abort ;
1875
1894
}
1876
1895
1896
+ err = mlx5_esw_host_functions_enabled_query (esw );
1897
+ if (err )
1898
+ goto abort ;
1899
+
1877
1900
err = mlx5_esw_vports_init (esw );
1878
1901
if (err )
1879
1902
goto abort ;
Original file line number Diff line number Diff line change @@ -323,6 +323,7 @@ struct mlx5_host_work {
323
323
324
324
struct mlx5_esw_functions {
325
325
struct mlx5_nb nb ;
326
+ bool host_funcs_disabled ;
326
327
u16 num_vfs ;
327
328
u16 num_ec_vfs ;
328
329
};
You can’t perform that action at this time.
0 commit comments