Skip to content

Commit ccd143e

Browse files
ShayAgrosdavem330
authored andcommitted
net: ena: Make missed_tx stat incremental
Most statistics in ena driver are incremented, meaning that a stat's value is a sum of all increases done to it since driver/queue initialization. This patch makes all statistics this way, effectively making missed_tx statistic incremental. Also added a comment regarding rx_drops and tx_drops to make it clearer how these counters are calculated. Fixes: 11095fd ("net: ena: add statistics for missed tx packets") Signed-off-by: Shay Agroskin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8b147f6 commit ccd143e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/amazon/ena/ena_netdev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3687,7 +3687,7 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter,
36873687
}
36883688

36893689
u64_stats_update_begin(&tx_ring->syncp);
3690-
tx_ring->tx_stats.missed_tx = missed_tx;
3690+
tx_ring->tx_stats.missed_tx += missed_tx;
36913691
u64_stats_update_end(&tx_ring->syncp);
36923692

36933693
return rc;
@@ -4556,6 +4556,9 @@ static void ena_keep_alive_wd(void *adapter_data,
45564556
tx_drops = ((u64)desc->tx_drops_high << 32) | desc->tx_drops_low;
45574557

45584558
u64_stats_update_begin(&adapter->syncp);
4559+
/* These stats are accumulated by the device, so the counters indicate
4560+
* all drops since last reset.
4561+
*/
45594562
adapter->dev_stats.rx_drops = rx_drops;
45604563
adapter->dev_stats.tx_drops = tx_drops;
45614564
u64_stats_update_end(&adapter->syncp);

0 commit comments

Comments
 (0)