net: stmmac: Setup a default RX Coalesce value instead of the minimum
authorJose Abreu <Jose.Abreu@synopsys.com>
Thu, 14 Nov 2019 11:42:46 +0000 (12:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Nov 2019 20:25:41 +0000 (12:25 -0800)
For performance reasons, sometimes using the minimum RX Coalesce value
is not optimal. Lets setup a default value that is optimal in most of
the use cases.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 912bbb6515b23e34a2ce4ee24f352cde96264a13..309ea12ea61fc5866447c91424e2c96837e63bbd 100644 (file)
@@ -248,6 +248,7 @@ struct stmmac_safety_stats {
 /* Max/Min RI Watchdog Timer count value */
 #define MAX_DMA_RIWT           0xff
 #define MIN_DMA_RIWT           0x10
+#define DEF_DMA_RIWT           0xa0
 /* Tx coalesce parameters */
 #define STMMAC_COAL_TX_TIMER   1000
 #define STMMAC_MAX_COAL_TX_TICK        100000
index 7939ef7e23b7dffede439ccf822d4a0c32e85579..400fbb727fd5f3f04cb9ac38e42ddaaa91247aad 100644 (file)
@@ -2605,9 +2605,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
        priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS;
 
        if (priv->use_riwt) {
-               ret = stmmac_rx_watchdog(priv, priv->ioaddr, MIN_DMA_RIWT, rx_cnt);
-               if (!ret)
-                       priv->rx_riwt = MIN_DMA_RIWT;
+               if (!priv->rx_riwt)
+                       priv->rx_riwt = DEF_DMA_RIWT;
+
+               ret = stmmac_rx_watchdog(priv, priv->ioaddr, priv->rx_riwt, rx_cnt);
        }
 
        if (priv->hw->pcs)