mediatek/ramips: remove an ethernet optimization patch that was reported to cause a regression

In some tests, crashes were observed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2020-09-09 11:51:21 +02:00
parent d717343c85
commit 668c988fc5
6 changed files with 18 additions and 52 deletions

View File

@@ -1,34 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 26 Aug 2020 17:48:14 +0200
Subject: [PATCH] net: ethernet: mtk_eth_soc: drop descriptor cpu-own bit check
in qdma tx cleanup
mtk_poll_tx_qdma already checks the MTK_QTX_DRX_PTR register, which points
at the last completed descriptor.
To slightly improve performance, also remove the register bit which forces
the hardware to write back this bit earlier.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1368,9 +1368,6 @@ static int mtk_poll_tx_qdma(struct mtk_e
int mac = 0;
desc = mtk_qdma_phys_to_virt(ring, desc->txd2);
- if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0)
- break;
-
tx_buf = mtk_desc_to_tx_buf(ring, desc);
if (tx_buf->flags & MTK_TX_FLAGS_FPORT1)
mac = 1;
@@ -2203,7 +2200,7 @@ static int mtk_start_dma(struct mtk_eth
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
mtk_w32(eth,
- MTK_TX_WB_DDONE | MTK_TX_DMA_EN |
+ MTK_TX_DMA_EN |
MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
MTK_RX_BT_32DWORDS,

View File

@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
dma = mtk_r32(eth, MTK_QTX_DRX_PTR);
desc = mtk_qdma_phys_to_virt(ring, cpu);
@@ -1389,6 +1389,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
@@ -1392,6 +1392,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
cpu = next_cpu;
}
@@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
mtk_w32(eth, cpu, MTK_QTX_CRX_PTR);
return budget;
@@ -1589,6 +1590,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1592,6 +1593,7 @@ static int mtk_tx_alloc(struct mtk_eth *
atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
ring->next_free = &ring->dma[0];
ring->last_free = &ring->dma[MTK_DMA_SIZE - 1];
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ring->thresh = MAX_SKB_FRAGS;
/* make sure that all changes to the dma ring are flushed before we
@@ -1602,9 +1604,7 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -1605,9 +1607,7 @@ static int mtk_tx_alloc(struct mtk_eth *
mtk_w32(eth,
ring->phys + ((MTK_DMA_SIZE - 1) * sz),
MTK_QTX_CRX_PTR);

View File

@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1512,8 +1512,8 @@ static int mtk_napi_tx(struct napi_struc
@@ -1515,8 +1515,8 @@ static int mtk_napi_tx(struct napi_struc
if (status & MTK_TX_DONE_INT)
return budget;
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return tx_done;
}
@@ -1546,8 +1546,9 @@ poll_again:
@@ -1549,8 +1549,9 @@ poll_again:
remain_budget -= rx_done;
goto poll_again;
}