The "threshold" ethtool statistic reports a single TX DMA threshold for the whole device. However, since commit d62a107a4f15 ("net: stmmac: prepare dma interrupt treatment for multiple queues"), a single TX DMA threshold per device doesn't make sense anymore, as each individual queue that underflows gets its threshold increased, so the queues are out of sync. To make the reporting accurate, remove it and report the threshold of each TX queue instead, as "qN_tx_threshold". Signed-off-by: Ovidiu Panait --- drivers/net/ethernet/stmicro/stmmac/common.h | 1 - drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index 1729fb29ece3..c74bc7c9750e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h @@ -158,7 +158,6 @@ struct stmmac_extra_stats { unsigned long fatal_bus_error_irq; /* Tx/Rx IRQ Events */ unsigned long rx_early_irq; - unsigned long threshold; unsigned long irq_receive_pmt_irq_n; /* MMC info */ unsigned long mmc_tx_irq_n; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 30e0d499326d..c616a1c95e5d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -89,7 +89,6 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { STMMAC_STAT(fatal_bus_error_irq), /* Tx/Rx IRQ Events */ STMMAC_STAT(rx_early_irq), - STMMAC_STAT(threshold), STMMAC_STAT(irq_receive_pmt_irq_n), /* MMC info */ STMMAC_STAT(mmc_tx_irq_n), @@ -289,6 +288,7 @@ static const struct stmmac_stats stmmac_mmc[] = { static const char stmmac_qstats_tx_string[][ETH_GSTRING_LEN] = { "tx_pkt_n", "tx_irq_n", + "tx_threshold", #define STMMAC_TXQ_STATS ARRAY_SIZE(stmmac_qstats_tx_string) }; @@ -496,6 +496,7 @@ static void stmmac_get_per_qstats(struct stmmac_priv *priv, u64 *data) *data++ = pkt_n; *data++ = stmmac_get_tx_normal_irq_n(priv, q); + *data++ = priv->tx_threshold[q]; } for (q = 0; q < rx_cnt; q++) { diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b5ee0f297df6..2fed7713e376 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2633,7 +2633,6 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) */ txmode = SF_DMA_MODE; rxmode = SF_DMA_MODE; - priv->xstats.threshold = SF_DMA_MODE; } else { rxmode = SF_DMA_MODE; } @@ -2836,7 +2835,6 @@ static void stmmac_bump_dma_threshold(struct stmmac_priv *priv, u32 chan) stmmac_set_dma_operation_mode(priv, thresh, SF_DMA_MODE, chan); priv->tx_threshold[chan] = thresh; - priv->xstats.threshold = thresh; } /** @@ -8135,8 +8133,6 @@ static int __stmmac_dvr_probe(struct device *device, #endif priv->msg_enable = netif_msg_init(debug, default_msg_level); - priv->xstats.threshold = tc; - for (i = 0; i < MTL_MAX_TX_QUEUES; i++) priv->tx_threshold[i] = tc; -- 2.34.1