Skip to content

Commit

Permalink
dpaa_eth: add dropped frames to percpu ethtool stats
Browse files Browse the repository at this point in the history
Prior to this change, the frames dropped on receive or transmit
were not displayed in the ethtool statistics, leaving the dropped
frames unaccounted for.

Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Madalin Bucur authored and David S. Miller committed Oct 31, 2019
1 parent 84d06c6 commit 46e93e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ static const char dpaa_stats_percpu[][ETH_GSTRING_LEN] = {
"tx S/G",
"tx error",
"rx error",
"rx dropped",
"tx dropped",
};

static char dpaa_stats_global[][ETH_GSTRING_LEN] = {
Expand Down Expand Up @@ -262,6 +264,12 @@ static void copy_stats(struct dpaa_percpu_priv *percpu_priv, int num_cpus,
data[crr * num_values + crr_cpu] = percpu_priv->stats.rx_errors;
data[crr++ * num_values + num_cpus] += percpu_priv->stats.rx_errors;

data[crr * num_values + crr_cpu] = percpu_priv->stats.rx_dropped;
data[crr++ * num_values + num_cpus] += percpu_priv->stats.rx_dropped;

data[crr * num_values + crr_cpu] = percpu_priv->stats.tx_dropped;
data[crr++ * num_values + num_cpus] += percpu_priv->stats.tx_dropped;

data[crr * num_values + crr_cpu] = bp_count;
data[crr++ * num_values + num_cpus] += bp_count;
}
Expand Down

0 comments on commit 46e93e5

Please sign in to comment.