mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-21 03:55:06 +00:00
35985454a6
Removed because already in upstream: target/linux/bcm53xx/patches-5.10/030-v5.11-0002-ARM-dts-BCM5301X-Harmonize-EHCI-OHCI-DT-nodes-name.patch target/linux/bcm53xx/patches-5.10/033-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch target/linux/bcm53xx/patches-5.10/040-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch target/linux/bcm53xx/patches-5.10/040-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch target/linux/bcm53xx/patches-5.10/040-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch target/linux/bcm53xx/patches-5.10/040-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch All other patches automatically rebased. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
69 lines
2.1 KiB
Diff
69 lines
2.1 KiB
Diff
From: Felix Fietkau <nbd@nbd.name>
|
|
Date: Wed, 24 Mar 2021 02:30:52 +0100
|
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix parsing packets in GDM
|
|
|
|
When using DSA, set the special tag in GDM ingress control to allow the MAC
|
|
to parse packets properly earlier. This affects rx DMA source port reporting.
|
|
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
---
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
@@ -19,6 +19,7 @@
|
|
#include <linux/interrupt.h>
|
|
#include <linux/pinctrl/devinfo.h>
|
|
#include <linux/phylink.h>
|
|
+#include <net/dsa.h>
|
|
|
|
#include "mtk_eth_soc.h"
|
|
|
|
@@ -1297,13 +1298,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) ||
|
|
+ (trxd.rxd4 & RX_DMA_SPECIAL_TAG))
|
|
mac = 0;
|
|
- } else {
|
|
- mac = (trxd.rxd4 >> RX_DMA_FPORT_SHIFT) &
|
|
- RX_DMA_FPORT_MASK;
|
|
- mac--;
|
|
- }
|
|
+ else
|
|
+ mac = ((trxd.rxd4 >> RX_DMA_FPORT_SHIFT) &
|
|
+ RX_DMA_FPORT_MASK) - 1;
|
|
|
|
if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
|
|
!eth->netdev[mac]))
|
|
@@ -2278,6 +2278,9 @@ static void mtk_gdm_config(struct mtk_et
|
|
|
|
val |= config;
|
|
|
|
+ if (!i && eth->netdev[0] && netdev_uses_dsa(eth->netdev[0]))
|
|
+ val |= MTK_GDMA_SPECIAL_TAG;
|
|
+
|
|
mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
|
|
}
|
|
/* Reset and enable PSE */
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
@@ -81,6 +81,7 @@
|
|
|
|
/* GDM Exgress Control Register */
|
|
#define MTK_GDMA_FWD_CFG(x) (0x500 + (x * 0x1000))
|
|
+#define MTK_GDMA_SPECIAL_TAG BIT(24)
|
|
#define MTK_GDMA_ICS_EN BIT(22)
|
|
#define MTK_GDMA_TCS_EN BIT(21)
|
|
#define MTK_GDMA_UCS_EN BIT(20)
|
|
@@ -318,6 +319,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
|