OSDN Git Service

net: stmmac: Enable OSP for GMAC4
authorJose Abreu <Jose.Abreu@synopsys.com>
Fri, 18 May 2018 13:55:58 +0000 (14:55 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 May 2018 15:00:14 +0000 (11:00 -0400)
This enables OSP (Operate on Second Packet) for GMAC4. The feature
allows DMA to fetch second descriptor while its still processing the
first one.

Running iperf, the performance gain is +/- 38%.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Vitor Soares <soares@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c

index 117c3a5..9aab5b3 100644 (file)
@@ -94,6 +94,10 @@ static void dwmac4_dma_init_tx_chan(void __iomem *ioaddr,
 
        value = readl(ioaddr + DMA_CHAN_TX_CONTROL(chan));
        value = value | (txpbl << DMA_BUS_MODE_PBL_SHIFT);
+
+       /* Enable OSP to get best performance */
+       value |= DMA_CONTROL_OSP;
+
        writel(value, ioaddr + DMA_CHAN_TX_CONTROL(chan));
 
        writel(dma_tx_phy, ioaddr + DMA_CHAN_TX_BASE_ADDR(chan));