]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox...
authorJakub Kicinski <kuba@kernel.org>
Fri, 1 May 2026 01:53:20 +0000 (18:53 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 1 May 2026 01:53:21 +0000 (18:53 -0700)
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 <kuba@kernel.org>
1  2 
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index 9e2ae217c224779f521ebd939c2cac4d0d6a90b2,b859aa5062cafad8606eba7b0e82809543dcf776..69ddf56e2fc946ae6ddc65167a4402fb4600427b
@@@ -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) {