net: stmmac: mmc_core: Drop interrupt registers from stats
authorJesper Nilsson <jesper.nilsson@axis.com>
Fri, 23 Feb 2024 20:37:01 +0000 (21:37 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 27 Feb 2024 10:34:32 +0000 (11:34 +0100)
The MMC IPC interrupt status and interrupt mask registers are
of little use as Ethernet statistics, but incrementing counters
based on the current interrupt and interrupt mask registers
makes them actively misleading.

For example, if the interrupt mask is set to 0x08420842,
the current code will increment by that amount each iteration,
leading to the following sequence of nonsense:

mmc_rx_ipc_intr_mask: 969816526
mmc_rx_ipc_intr_mask: 1108361744

These registers have been included in the Ethernet statistics
since the first version of MMC back in 2011 (commit 1c901a46d57).
That commit also mentions the MMC interrupts as
"something to add later (if actually useful)".

If the registers are actually useful, they should probably
be part of the Ethernet register dump instead of statistics,
but for now, drop the counters for mmc_rx_ipc_intr and
mmc_rx_ipc_intr_mask completely.

Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20240223-stmmac_stats-v3-1-5d483c2a071a@axis.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/mmc.h
drivers/net/ethernet/stmicro/stmmac/mmc_core.c
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

index 14c9d2637dfe7332ff50207877037fa507a2d98e..dff02d75d519713e61ffa5db651ece91242aece0 100644 (file)
@@ -86,10 +86,6 @@ struct stmmac_counters {
        unsigned int mmc_rx_discard_octets_gb;
        unsigned int mmc_rx_align_err_frames;
 
-       /* IPC */
-       unsigned int mmc_rx_ipc_intr_mask;
-       unsigned int mmc_rx_ipc_intr;
-
        /* IPv4 */
        unsigned int mmc_rx_ipv4_gd;
        unsigned int mmc_rx_ipv4_hderr;
index 8597c6abae8d73948ed6a156b5b0922367d13f73..7eb477faa75a3853e7698e5a4aab3376d5d162e9 100644 (file)
@@ -316,9 +316,6 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
        mmc->mmc_rx_fifo_overflow += readl(mmcaddr + MMC_RX_FIFO_OVERFLOW);
        mmc->mmc_rx_vlan_frames_gb += readl(mmcaddr + MMC_RX_VLAN_FRAMES_GB);
        mmc->mmc_rx_watchdog_error += readl(mmcaddr + MMC_RX_WATCHDOG_ERROR);
-       /* IPC */
-       mmc->mmc_rx_ipc_intr_mask += readl(mmcaddr + MMC_RX_IPC_INTR_MASK);
-       mmc->mmc_rx_ipc_intr += readl(mmcaddr + MMC_RX_IPC_INTR);
        /* IPv4 */
        mmc->mmc_rx_ipv4_gd += readl(mmcaddr + MMC_RX_IPV4_GD);
        mmc->mmc_rx_ipv4_hderr += readl(mmcaddr + MMC_RX_IPV4_HDERR);
index 0e44b84fb7e7401ab5f89d267a850131908d9f58..e1537a57815f387082acdb954ee6b40d397990c0 100644 (file)
@@ -243,8 +243,6 @@ static const struct stmmac_stats stmmac_mmc[] = {
        STMMAC_MMC_STAT(mmc_rx_discard_frames_gb),
        STMMAC_MMC_STAT(mmc_rx_discard_octets_gb),
        STMMAC_MMC_STAT(mmc_rx_align_err_frames),
-       STMMAC_MMC_STAT(mmc_rx_ipc_intr_mask),
-       STMMAC_MMC_STAT(mmc_rx_ipc_intr),
        STMMAC_MMC_STAT(mmc_rx_ipv4_gd),
        STMMAC_MMC_STAT(mmc_rx_ipv4_hderr),
        STMMAC_MMC_STAT(mmc_rx_ipv4_nopay),