From: Jakub Kicinski Date: Fri, 1 May 2026 01:53:20 +0000 (-0700) Subject: Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e37987362bcac8909f2d4b4458f3aa645e41641;p=thirdparty%2Flinux.git Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Tariq Toukan says: ==================== mlx5-next updates 2026-04-29 * 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux: net/mlx5: Extend query_esw_functions output for multi-function support net/mlx5: Remove unused host_sf_enable field net/mlx5: Add function_id_type for enable/disable_hca cmds mlx5: Rename the vport number enums for host PF and VF ==================== Link: https://patch.msgid.link/20260429212747.224411-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski --- 4e37987362bcac8909f2d4b4458f3aa645e41641 diff --cc drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 9e2ae217c2247,b859aa5062caf..69ddf56e2fc94 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@@ -3655,23 -3658,31 +3658,26 @@@ static void esw_offloads_steering_clean mutex_destroy(&esw->fdb_table.offloads.vports.lock); } -static void -esw_vfs_changed_event_handler(struct mlx5_eswitch *esw, int work_gen, - const u32 *out) +static void esw_vfs_changed_event_handler(struct mlx5_eswitch *esw) { - struct devlink *devlink; bool host_pf_disabled; + void *host_params; u16 new_num_vfs; + const u32 *out; - devlink = priv_to_devlink(esw->dev); - devl_lock(devlink); - - /* Stale work from one or more mode changes ago. Bail out. */ - if (work_gen != atomic_read(&esw->esw_funcs.generation)) - goto unlock; + out = mlx5_esw_query_functions(esw->dev); + if (IS_ERR(out)) + return; - new_num_vfs = MLX5_GET(query_esw_functions_out, out, - host_params_context.host_num_of_vfs); - host_pf_disabled = MLX5_GET(query_esw_functions_out, out, - host_params_context.host_pf_disabled); + host_params = MLX5_ADDR_OF(query_esw_functions_out, out, + net_function_params); + new_num_vfs = MLX5_GET(host_params_context, host_params, + host_num_of_vfs); + host_pf_disabled = MLX5_GET(host_params_context, host_params, + host_pf_disabled); if (new_num_vfs == esw->esw_funcs.num_vfs || host_pf_disabled) - goto unlock; + goto free; /* Number of VFs can only change from "0 to x" or "x to 0". */ if (esw->esw_funcs.num_vfs > 0) {