net: stmmac: est: Per Tx-queue error count for HLBF
authorRohan G Thomas <rohan.g.thomas@intel.com>
Sat, 27 Jan 2024 04:04:42 +0000 (12:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Jan 2024 12:24:06 +0000 (12:24 +0000)
Keep per Tx-queue error count on Head-Of-Line Blocking due to frame
size(HLBF) error. The MAC raises HLBF error on one or more queues
when none of the time Intervals of open-gates in the GCL is greater
than or equal to the duration needed for frame transmission and by
default drops those packets that causes HLBF error. EST_FRM_SZ_ERR
register provides the One Hot encoded Queue numbers that have the
Frame Size related error.

Signed-off-by: Rohan G Thomas <rohan.g.thomas@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/stmmac_est.c

index d8d2a90fd228cd7b7cd0a4043c11ac5abd984c25..70bef7811c918e4d90d5679ceaa26c244c6569c3 100644 (file)
@@ -203,6 +203,7 @@ struct stmmac_extra_stats {
        unsigned long mtl_est_btre;
        unsigned long mtl_est_btrlm;
        unsigned long max_sdu_txq_drop[MTL_MAX_TX_QUEUES];
+       unsigned long mtl_est_txq_hlbf[MTL_MAX_TX_QUEUES];
        /* per queue statistics */
        struct stmmac_txq_stats txq_stats[MTL_MAX_TX_QUEUES];
        struct stmmac_rxq_stats rxq_stats[MTL_MAX_RX_QUEUES];
index 4da6ccc17c20513a4e1367a5a6826b8a9602936c..c9693f77e1f61fe5c92f95f5e544371445626c4d 100644 (file)
@@ -81,6 +81,7 @@ static void est_irq_status(struct stmmac_priv *priv, struct net_device *dev,
        u32 status, value, feqn, hbfq, hbfs, btrl, btrl_max;
        void __iomem *est_addr = priv->estaddr;
        u32 txqcnt_mask = BIT(txqcnt) - 1;
+       int i;
 
        status = readl(est_addr + EST_STATUS);
 
@@ -125,6 +126,11 @@ static void est_irq_status(struct stmmac_priv *priv, struct net_device *dev,
 
                x->mtl_est_hlbf++;
 
+               for (i = 0; i < txqcnt; i++) {
+                       if (feqn & BIT(i))
+                               x->mtl_est_txq_hlbf[i]++;
+               }
+
                /* Clear Interrupt */
                writel(feqn, est_addr + EST_FRM_SZ_ERR);