70
70
#include "qos.h"
71
71
#include "en/trap.h"
72
72
#include "lib/devcom.h"
73
+ #include "lib/sd.h"
73
74
74
75
bool mlx5e_check_fragmented_striding_rq_cap (struct mlx5_core_dev * mdev , u8 page_shift ,
75
76
enum mlx5e_mpwrq_umr_mode umr_mode )
@@ -5980,7 +5981,7 @@ void mlx5e_destroy_netdev(struct mlx5e_priv *priv)
5980
5981
free_netdev (netdev );
5981
5982
}
5982
5983
5983
- static int mlx5e_resume (struct auxiliary_device * adev )
5984
+ static int _mlx5e_resume (struct auxiliary_device * adev )
5984
5985
{
5985
5986
struct mlx5_adev * edev = container_of (adev , struct mlx5_adev , adev );
5986
5987
struct mlx5e_dev * mlx5e_dev = auxiliary_get_drvdata (adev );
@@ -6005,6 +6006,23 @@ static int mlx5e_resume(struct auxiliary_device *adev)
6005
6006
return 0 ;
6006
6007
}
6007
6008
6009
+ static int mlx5e_resume (struct auxiliary_device * adev )
6010
+ {
6011
+ struct mlx5_adev * edev = container_of (adev , struct mlx5_adev , adev );
6012
+ struct mlx5_core_dev * mdev = edev -> mdev ;
6013
+ struct auxiliary_device * actual_adev ;
6014
+ int err ;
6015
+
6016
+ err = mlx5_sd_init (mdev );
6017
+ if (err )
6018
+ return err ;
6019
+
6020
+ actual_adev = mlx5_sd_get_adev (mdev , adev , edev -> idx );
6021
+ if (actual_adev )
6022
+ return _mlx5e_resume (actual_adev );
6023
+ return 0 ;
6024
+ }
6025
+
6008
6026
static int _mlx5e_suspend (struct auxiliary_device * adev )
6009
6027
{
6010
6028
struct mlx5e_dev * mlx5e_dev = auxiliary_get_drvdata (adev );
@@ -6025,7 +6043,17 @@ static int _mlx5e_suspend(struct auxiliary_device *adev)
6025
6043
6026
6044
static int mlx5e_suspend (struct auxiliary_device * adev , pm_message_t state )
6027
6045
{
6028
- return _mlx5e_suspend (adev );
6046
+ struct mlx5_adev * edev = container_of (adev , struct mlx5_adev , adev );
6047
+ struct mlx5_core_dev * mdev = edev -> mdev ;
6048
+ struct auxiliary_device * actual_adev ;
6049
+ int err = 0 ;
6050
+
6051
+ actual_adev = mlx5_sd_get_adev (mdev , adev , edev -> idx );
6052
+ if (actual_adev )
6053
+ err = _mlx5e_suspend (actual_adev );
6054
+
6055
+ mlx5_sd_cleanup (mdev );
6056
+ return err ;
6029
6057
}
6030
6058
6031
6059
static int _mlx5e_probe (struct auxiliary_device * adev )
@@ -6071,9 +6099,9 @@ static int _mlx5e_probe(struct auxiliary_device *adev)
6071
6099
goto err_destroy_netdev ;
6072
6100
}
6073
6101
6074
- err = mlx5e_resume (adev );
6102
+ err = _mlx5e_resume (adev );
6075
6103
if (err ) {
6076
- mlx5_core_err (mdev , "mlx5e_resume failed, %d\n" , err );
6104
+ mlx5_core_err (mdev , "_mlx5e_resume failed, %d\n" , err );
6077
6105
goto err_profile_cleanup ;
6078
6106
}
6079
6107
@@ -6104,15 +6132,29 @@ static int _mlx5e_probe(struct auxiliary_device *adev)
6104
6132
static int mlx5e_probe (struct auxiliary_device * adev ,
6105
6133
const struct auxiliary_device_id * id )
6106
6134
{
6107
- return _mlx5e_probe (adev );
6135
+ struct mlx5_adev * edev = container_of (adev , struct mlx5_adev , adev );
6136
+ struct mlx5_core_dev * mdev = edev -> mdev ;
6137
+ struct auxiliary_device * actual_adev ;
6138
+ int err ;
6139
+
6140
+ err = mlx5_sd_init (mdev );
6141
+ if (err )
6142
+ return err ;
6143
+
6144
+ actual_adev = mlx5_sd_get_adev (mdev , adev , edev -> idx );
6145
+ if (actual_adev )
6146
+ return _mlx5e_probe (actual_adev );
6147
+ return 0 ;
6108
6148
}
6109
6149
6110
- static void mlx5e_remove (struct auxiliary_device * adev )
6150
+ static void _mlx5e_remove (struct auxiliary_device * adev )
6111
6151
{
6152
+ struct mlx5_adev * edev = container_of (adev , struct mlx5_adev , adev );
6112
6153
struct mlx5e_dev * mlx5e_dev = auxiliary_get_drvdata (adev );
6113
6154
struct mlx5e_priv * priv = mlx5e_dev -> priv ;
6155
+ struct mlx5_core_dev * mdev = edev -> mdev ;
6114
6156
6115
- mlx5_core_uplink_netdev_set (priv -> mdev , NULL );
6157
+ mlx5_core_uplink_netdev_set (mdev , NULL );
6116
6158
mlx5e_dcbnl_delete_app (priv );
6117
6159
unregister_netdev (priv -> netdev );
6118
6160
_mlx5e_suspend (adev );
@@ -6122,6 +6164,19 @@ static void mlx5e_remove(struct auxiliary_device *adev)
6122
6164
mlx5e_destroy_devlink (mlx5e_dev );
6123
6165
}
6124
6166
6167
+ static void mlx5e_remove (struct auxiliary_device * adev )
6168
+ {
6169
+ struct mlx5_adev * edev = container_of (adev , struct mlx5_adev , adev );
6170
+ struct mlx5_core_dev * mdev = edev -> mdev ;
6171
+ struct auxiliary_device * actual_adev ;
6172
+
6173
+ actual_adev = mlx5_sd_get_adev (mdev , adev , edev -> idx );
6174
+ if (actual_adev )
6175
+ _mlx5e_remove (actual_adev );
6176
+
6177
+ mlx5_sd_cleanup (mdev );
6178
+ }
6179
+
6125
6180
static const struct auxiliary_device_id mlx5e_id_table [] = {
6126
6181
{ .name = MLX5_ADEV_NAME ".eth" , },
6127
6182
{},
0 commit comments