File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
drivers/net/ethernet/mellanox/mlx5/core Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -5194,11 +5194,12 @@ void mlx5e_tc_ht_cleanup(struct rhashtable *tc_ht)
51945194int mlx5e_tc_esw_init (struct mlx5_rep_uplink_priv * uplink_priv )
51955195{
51965196 const size_t sz_enc_opts = sizeof (struct tunnel_match_enc_opts );
5197+ struct netdev_phys_item_id ppid ;
51975198 struct mlx5e_rep_priv * rpriv ;
51985199 struct mapping_ctx * mapping ;
51995200 struct mlx5_eswitch * esw ;
52005201 struct mlx5e_priv * priv ;
5201- u64 mapping_id ;
5202+ u64 mapping_id , key ;
52025203 int err = 0 ;
52035204
52045205 rpriv = container_of (uplink_priv , struct mlx5e_rep_priv , uplink_priv );
@@ -5252,7 +5253,11 @@ int mlx5e_tc_esw_init(struct mlx5_rep_uplink_priv *uplink_priv)
52525253 goto err_action_counter ;
52535254 }
52545255
5255- mlx5_esw_offloads_devcom_init (esw );
5256+ err = dev_get_port_parent_id (priv -> netdev , & ppid , false);
5257+ if (!err ) {
5258+ memcpy (& key , & ppid .id , sizeof (key ));
5259+ mlx5_esw_offloads_devcom_init (esw , key );
5260+ }
52565261
52575262 return 0 ;
52585263
Original file line number Diff line number Diff line change @@ -382,7 +382,7 @@ int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int num_vfs);
382382void mlx5_eswitch_disable_sriov (struct mlx5_eswitch * esw , bool clear_vf );
383383void mlx5_eswitch_disable_locked (struct mlx5_eswitch * esw );
384384void mlx5_eswitch_disable (struct mlx5_eswitch * esw );
385- void mlx5_esw_offloads_devcom_init (struct mlx5_eswitch * esw );
385+ void mlx5_esw_offloads_devcom_init (struct mlx5_eswitch * esw , u64 key );
386386void mlx5_esw_offloads_devcom_cleanup (struct mlx5_eswitch * esw );
387387bool mlx5_esw_offloads_devcom_is_ready (struct mlx5_eswitch * esw );
388388int mlx5_eswitch_set_vport_mac (struct mlx5_eswitch * esw ,
@@ -818,7 +818,7 @@ static inline void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw) {}
818818static inline int mlx5_eswitch_enable (struct mlx5_eswitch * esw , int num_vfs ) { return 0 ; }
819819static inline void mlx5_eswitch_disable_sriov (struct mlx5_eswitch * esw , bool clear_vf ) {}
820820static inline void mlx5_eswitch_disable (struct mlx5_eswitch * esw ) {}
821- static inline void mlx5_esw_offloads_devcom_init (struct mlx5_eswitch * esw ) {}
821+ static inline void mlx5_esw_offloads_devcom_init (struct mlx5_eswitch * esw , u64 key ) {}
822822static inline void mlx5_esw_offloads_devcom_cleanup (struct mlx5_eswitch * esw ) {}
823823static inline bool mlx5_esw_offloads_devcom_is_ready (struct mlx5_eswitch * esw ) { return false; }
824824static inline bool mlx5_eswitch_is_funcs_handler (struct mlx5_core_dev * dev ) { return false; }
Original file line number Diff line number Diff line change @@ -2886,9 +2886,8 @@ static int mlx5_esw_offloads_devcom_event(int event,
28862886 return err ;
28872887}
28882888
2889- void mlx5_esw_offloads_devcom_init (struct mlx5_eswitch * esw )
2889+ void mlx5_esw_offloads_devcom_init (struct mlx5_eswitch * esw , u64 key )
28902890{
2891- u64 guid ;
28922891 int i ;
28932892
28942893 for (i = 0 ; i < MLX5_MAX_PORTS ; i ++ )
@@ -2902,12 +2901,10 @@ void mlx5_esw_offloads_devcom_init(struct mlx5_eswitch *esw)
29022901 return ;
29032902
29042903 xa_init (& esw -> paired );
2905- guid = mlx5_query_nic_system_image_guid (esw -> dev );
2906-
29072904 esw -> num_peers = 0 ;
29082905 esw -> devcom = mlx5_devcom_register_component (esw -> dev -> priv .devc ,
29092906 MLX5_DEVCOM_ESW_OFFLOADS ,
2910- guid ,
2907+ key ,
29112908 mlx5_esw_offloads_devcom_event ,
29122909 esw );
29132910 if (IS_ERR_OR_NULL (esw -> devcom ))
You can’t perform that action at this time.
0 commit comments