@@ -1250,19 +1250,32 @@ pport_phy_statistical_err_lanes_stats_desc[] = {
1250
1250
{ "rx_err_lane_3_phy" , PPORT_PHY_STATISTICAL_OFF (phy_corrected_bits_lane3 ) },
1251
1251
};
1252
1252
1253
+ #define PPORT_PHY_RECOVERY_OFF (c ) \
1254
+ MLX5_BYTE_OFF(ppcnt_reg, counter_set.phys_layer_recovery_cntrs.c)
1255
+ static const struct counter_desc
1256
+ pport_phy_recovery_cntrs_stats_desc [] = {
1257
+ { "total_success_recovery_phy" ,
1258
+ PPORT_PHY_RECOVERY_OFF (total_successful_recovery_events ) }
1259
+ };
1260
+
1253
1261
#define NUM_PPORT_PHY_LAYER_COUNTERS \
1254
1262
ARRAY_SIZE(pport_phy_layer_cntrs_stats_desc)
1255
1263
#define NUM_PPORT_PHY_STATISTICAL_COUNTERS \
1256
1264
ARRAY_SIZE(pport_phy_statistical_stats_desc)
1257
1265
#define NUM_PPORT_PHY_STATISTICAL_PER_LANE_COUNTERS \
1258
1266
ARRAY_SIZE(pport_phy_statistical_err_lanes_stats_desc)
1267
+ #define NUM_PPORT_PHY_RECOVERY_COUNTERS \
1268
+ ARRAY_SIZE(pport_phy_recovery_cntrs_stats_desc)
1259
1269
1260
1270
#define NUM_PPORT_PHY_STATISTICAL_LOOPBACK_COUNTERS (dev ) \
1261
1271
(MLX5_CAP_PCAM_FEATURE(dev, ppcnt_statistical_group) ? \
1262
1272
NUM_PPORT_PHY_STATISTICAL_COUNTERS : 0)
1263
1273
#define NUM_PPORT_PHY_STATISTICAL_PER_LANE_LOOPBACK_COUNTERS (dev ) \
1264
1274
(MLX5_CAP_PCAM_FEATURE(dev, per_lane_error_counters) ? \
1265
1275
NUM_PPORT_PHY_STATISTICAL_PER_LANE_COUNTERS : 0)
1276
+ #define NUM_PPORT_PHY_RECOVERY_LOOPBACK_COUNTERS (dev ) \
1277
+ (MLX5_CAP_PCAM_FEATURE(dev, ppcnt_recovery_counters) ? \
1278
+ NUM_PPORT_PHY_RECOVERY_COUNTERS : 0)
1266
1279
1267
1280
static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS (phy )
1268
1281
{
@@ -1275,6 +1288,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(phy)
1275
1288
1276
1289
num_stats += NUM_PPORT_PHY_STATISTICAL_PER_LANE_LOOPBACK_COUNTERS (mdev );
1277
1290
1291
+ num_stats += NUM_PPORT_PHY_RECOVERY_LOOPBACK_COUNTERS (mdev );
1278
1292
return num_stats ;
1279
1293
}
1280
1294
@@ -1295,6 +1309,10 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(phy)
1295
1309
ethtool_puts (data ,
1296
1310
pport_phy_statistical_err_lanes_stats_desc [i ]
1297
1311
.format );
1312
+
1313
+ for (i = 0 ; i < NUM_PPORT_PHY_RECOVERY_LOOPBACK_COUNTERS (mdev ); i ++ )
1314
+ ethtool_puts (data ,
1315
+ pport_phy_recovery_cntrs_stats_desc [i ].format );
1298
1316
}
1299
1317
1300
1318
static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS (phy )
@@ -1324,6 +1342,13 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STATS(phy)
1324
1342
MLX5E_READ_CTR64_BE (
1325
1343
& priv -> stats .pport .phy_statistical_counters ,
1326
1344
pport_phy_statistical_err_lanes_stats_desc , i ));
1345
+
1346
+ for (i = 0 ; i < NUM_PPORT_PHY_RECOVERY_LOOPBACK_COUNTERS (mdev ); i ++ )
1347
+ mlx5e_ethtool_put_stat (
1348
+ data ,
1349
+ MLX5E_READ_CTR32_BE (
1350
+ & priv -> stats .pport .phy_recovery_counters ,
1351
+ pport_phy_recovery_cntrs_stats_desc , i ));
1327
1352
}
1328
1353
1329
1354
static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS (phy )
@@ -1339,12 +1364,21 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(phy)
1339
1364
MLX5_SET (ppcnt_reg , in , grp , MLX5_PHYSICAL_LAYER_COUNTERS_GROUP );
1340
1365
mlx5_core_access_reg (mdev , in , sz , out , sz , MLX5_REG_PPCNT , 0 , 0 );
1341
1366
1342
- if (!MLX5_CAP_PCAM_FEATURE (mdev , ppcnt_statistical_group ))
1343
- return ;
1367
+ if (MLX5_CAP_PCAM_FEATURE (mdev , ppcnt_statistical_group )) {
1368
+ out = pstats -> phy_statistical_counters ;
1369
+ MLX5_SET (ppcnt_reg , in , grp ,
1370
+ MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP );
1371
+ mlx5_core_access_reg (mdev , in , sz , out , sz , MLX5_REG_PPCNT , 0 ,
1372
+ 0 );
1373
+ }
1344
1374
1345
- out = pstats -> phy_statistical_counters ;
1346
- MLX5_SET (ppcnt_reg , in , grp , MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP );
1347
- mlx5_core_access_reg (mdev , in , sz , out , sz , MLX5_REG_PPCNT , 0 , 0 );
1375
+ if (MLX5_CAP_PCAM_FEATURE (mdev , ppcnt_recovery_counters )) {
1376
+ out = pstats -> phy_recovery_counters ;
1377
+ MLX5_SET (ppcnt_reg , in , grp ,
1378
+ MLX5_PHYSICAL_LAYER_RECOVERY_GROUP );
1379
+ mlx5_core_access_reg (mdev , in , sz , out , sz , MLX5_REG_PPCNT , 0 ,
1380
+ 0 );
1381
+ }
1348
1382
}
1349
1383
1350
1384
void mlx5e_get_link_ext_stats (struct net_device * dev ,
0 commit comments