diff options
Diffstat (limited to 'target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch')
-rw-r--r-- | target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch index 36a52bbc06..9ef675dcd1 100644 --- a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch +++ b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch @@ -18,14 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> #include "mtk_eth_soc.h" -@@ -1240,12 +1241,14 @@ static int mtk_poll_rx(struct napi_struc - u8 *data, *new_data; - struct mtk_rx_dma *rxd, trxd; - int done = 0, bytes = 0; -+ bool uses_dsa = eth->netdev[0] && netdev_uses_dsa(eth->netdev[0]); - - while (done < budget) { - struct net_device *netdev; +@@ -1246,6 +1247,7 @@ static int mtk_poll_rx(struct napi_struc unsigned int pktlen; dma_addr_t dma_addr; int mac; @@ -33,27 +26,26 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> ring = mtk_get_rx_ring(eth); if (unlikely(!ring)) -@@ -1259,13 +1262,13 @@ static int mtk_poll_rx(struct napi_struc +@@ -1259,13 +1261,12 @@ static int mtk_poll_rx(struct napi_struc break; /* find out which mac the packet come from. values start at 1 */ - if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { -+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) ++ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) || ++ (trxd.rxd4 & RX_DMA_SPECIAL_TAG)) mac = 0; - } else { - mac = (trxd.rxd4 >> RX_DMA_FPORT_SHIFT) & - RX_DMA_FPORT_MASK; - mac--; - } -+ else if (uses_dsa) -+ mac = !(trxd.rxd4 >> 22); + else + mac = ((trxd.rxd4 >> RX_DMA_FPORT_SHIFT) & + RX_DMA_FPORT_MASK) - 1; if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT || !eth->netdev[mac])) -@@ -2247,6 +2250,9 @@ static void mtk_gdm_config(struct mtk_et +@@ -2247,6 +2248,9 @@ static void mtk_gdm_config(struct mtk_et val |= config; @@ -73,3 +65,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> #define MTK_GDMA_ICS_EN BIT(22) #define MTK_GDMA_TCS_EN BIT(21) #define MTK_GDMA_UCS_EN BIT(20) +@@ -311,6 +312,7 @@ + #define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */ + #define RX_DMA_FPORT_SHIFT 19 + #define RX_DMA_FPORT_MASK 0x7 ++#define RX_DMA_SPECIAL_TAG BIT(22) + + /* PHY Indirect Access Control registers */ + #define MTK_PHY_IAC 0x10004 |