net: stmmac: xgmac: Remove uneeded computation for RFA/RFD
authorJose Abreu <Jose.Abreu@synopsys.com>
Thu, 14 Nov 2019 11:42:48 +0000 (12:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Nov 2019 20:25:41 +0000 (12:25 -0800)
RFA and RFD should not be dependent on FIFO size. In fact, the more FIFO
space we have, the later we can activate Flow Control. Let's use
hard-coded values for RFA and RFD for all FIFO sizes with the exception
of 4k, which is a special case.

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

index f148cb2061d8ea9ecd4f212514b4cbd2519a94a8..22a7f0cc1b904cf2b7bf197762d674f250fdfdec 100644 (file)
@@ -183,19 +183,9 @@ static void dwxgmac2_dma_rx_mode(void __iomem *ioaddr, int mode,
                        rfa = 0x01; /* Full-1.5K */
                        break;
 
-               case 8192:
-                       rfd = 0x06; /* Full-4K */
-                       rfa = 0x0a; /* Full-6K */
-                       break;
-
-               case 16384:
-                       rfd = 0x06; /* Full-4K */
-                       rfa = 0x12; /* Full-10K */
-                       break;
-
                default:
-                       rfd = 0x06; /* Full-4K */
-                       rfa = 0x1e; /* Full-16K */
+                       rfd = 0x07; /* Full-4.5K */
+                       rfa = 0x04; /* Full-3K */
                        break;
                }