net: stmmac: add ethtool per-queue irq statistic support
authorVijayakannan Ayyathurai <vijayakannan.ayyathurai@intel.com>
Mon, 16 Aug 2021 06:16:00 +0000 (14:16 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Aug 2021 10:36:04 +0000 (11:36 +0100)
Adding ethtool per-queue statistics support to show number of interrupts
generated at DMA tx and DMA rx. All the counters are incremented at
dwmac4_dma_interrupt function.

Signed-off-by: Vijayakannan Ayyathurai <vijayakannan.ayyathurai@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

index 79333deef2e23dae964d7d1d9807a8b9118288ab..b6d945ea903d4425e6f4ce2f4c70a48f3b2d9bf8 100644 (file)
 
 struct stmmac_txq_stats {
        unsigned long tx_pkt_n;
+       unsigned long tx_normal_irq_n;
 };
 
 struct stmmac_rxq_stats {
        unsigned long rx_pkt_n;
+       unsigned long rx_normal_irq_n;
 };
 
 /* Extra statistic and debug information exposed by ethtool */
index f83db62938dd1b0e7d24021cfe0c3c6e446b22a5..9292a1fab7d32006cec8f4068ec79ef7dcfaa264 100644 (file)
@@ -170,10 +170,12 @@ int dwmac4_dma_interrupt(void __iomem *ioaddr,
                x->normal_irq_n++;
        if (likely(intr_status & DMA_CHAN_STATUS_RI)) {
                x->rx_normal_irq_n++;
+               x->rxq_stats[chan].rx_normal_irq_n++;
                ret |= handle_rx;
        }
        if (likely(intr_status & DMA_CHAN_STATUS_TI)) {
                x->tx_normal_irq_n++;
+               x->txq_stats[chan].tx_normal_irq_n++;
                ret |= handle_tx;
        }
        if (unlikely(intr_status & DMA_CHAN_STATUS_TBU))
index 10c0895d0b4334865c1b5c722b2e07e8d4569e6f..595c3ccdcbb7331c24bc3bd50dc418af6591e91b 100644 (file)
@@ -263,11 +263,13 @@ static const struct stmmac_stats stmmac_mmc[] = {
 
 static const char stmmac_qstats_tx_string[][ETH_GSTRING_LEN] = {
        "tx_pkt_n",
+       "tx_irq_n",
 #define STMMAC_TXQ_STATS ARRAY_SIZE(stmmac_qstats_tx_string)
 };
 
 static const char stmmac_qstats_rx_string[][ETH_GSTRING_LEN] = {
        "rx_pkt_n",
+       "rx_irq_n",
 #define STMMAC_RXQ_STATS ARRAY_SIZE(stmmac_qstats_rx_string)
 };