aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/sfc/ef10.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 605cc8948594..b1a4ea21c91c 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -1282,7 +1282,12 @@ static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats,
1282 } 1282 }
1283 } 1283 }
1284 1284
1285 if (core_stats) { 1285 if (!core_stats)
1286 return stats_count;
1287
1288 if (nic_data->datapath_caps &
1289 1 << MC_CMD_GET_CAPABILITIES_OUT_EVB_LBN) {
1290 /* Use vadaptor stats. */
1286 core_stats->rx_packets = stats[EF10_STAT_rx_unicast] + 1291 core_stats->rx_packets = stats[EF10_STAT_rx_unicast] +
1287 stats[EF10_STAT_rx_multicast] + 1292 stats[EF10_STAT_rx_multicast] +
1288 stats[EF10_STAT_rx_broadcast]; 1293 stats[EF10_STAT_rx_broadcast];
@@ -1302,6 +1307,26 @@ static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats,
1302 core_stats->rx_fifo_errors = stats[EF10_STAT_rx_overflow]; 1307 core_stats->rx_fifo_errors = stats[EF10_STAT_rx_overflow];
1303 core_stats->rx_errors = core_stats->rx_crc_errors; 1308 core_stats->rx_errors = core_stats->rx_crc_errors;
1304 core_stats->tx_errors = stats[EF10_STAT_tx_bad]; 1309 core_stats->tx_errors = stats[EF10_STAT_tx_bad];
1310 } else {
1311 /* Use port stats. */
1312 core_stats->rx_packets = stats[EF10_STAT_port_rx_packets];
1313 core_stats->tx_packets = stats[EF10_STAT_port_tx_packets];
1314 core_stats->rx_bytes = stats[EF10_STAT_port_rx_bytes];
1315 core_stats->tx_bytes = stats[EF10_STAT_port_tx_bytes];
1316 core_stats->rx_dropped = stats[EF10_STAT_port_rx_nodesc_drops] +
1317 stats[GENERIC_STAT_rx_nodesc_trunc] +
1318 stats[GENERIC_STAT_rx_noskb_drops];
1319 core_stats->multicast = stats[EF10_STAT_port_rx_multicast];
1320 core_stats->rx_length_errors =
1321 stats[EF10_STAT_port_rx_gtjumbo] +
1322 stats[EF10_STAT_port_rx_length_error];
1323 core_stats->rx_crc_errors = stats[EF10_STAT_port_rx_bad];
1324 core_stats->rx_frame_errors =
1325 stats[EF10_STAT_port_rx_align_error];
1326 core_stats->rx_fifo_errors = stats[EF10_STAT_port_rx_overflow];
1327 core_stats->rx_errors = (core_stats->rx_length_errors +
1328 core_stats->rx_crc_errors +
1329 core_stats->rx_frame_errors);
1305 } 1330 }
1306 1331
1307 return stats_count; 1332 return stats_count;