[PATCH net RFC] net: ethernet: mtk_eth_soc: ppe: add source port comparison

Elad Yifee eladwf at gmail.com
Sat May 11 05:42:26 PDT 2024


Resolve packet loss issue on the following conditions:
	- utilizing multiple GMACs
	- device has more than 4GB DRAM
	- using PPE

Signed-off-by: Elad Yifee <eladwf at gmail.com>
---
 drivers/net/ethernet/mediatek/mtk_ppe.c      | 4 ++++
 drivers/net/ethernet/mediatek/mtk_ppe_regs.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
index 6ce0db3a1a92..6415ba618ebf 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -1053,6 +1053,10 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
 	      MTK_PPE_GLO_CFG_IP4_L4_CS_DROP |
 	      MTK_PPE_GLO_CFG_IP4_CS_DROP |
 	      MTK_PPE_GLO_CFG_FLOW_DROP_UPDATE;
+
+	if (mtk_is_netsys_v2_or_greater(ppe->eth))
+		val |= MTK_PPE_GLO_CFG_SP_CMP_EN;
+
 	ppe_w32(ppe, MTK_PPE_GLO_CFG, val);
 
 	ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT, 0);
diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
index 3ce088eef0ef..61fea4b4b65b 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
@@ -18,6 +18,7 @@
 #define MTK_PPE_GLO_CFG_UDP_LITE_EN		BIT(10)
 #define MTK_PPE_GLO_CFG_UDP_LEN_DROP		BIT(11)
 #define MTK_PPE_GLO_CFG_MCAST_ENTRIES		GNEMASK(13, 12)
+#define MTK_PPE_GLO_CFG_SP_CMP_EN		BIT(25)
 #define MTK_PPE_GLO_CFG_BUSY			BIT(31)
 
 #define MTK_PPE_FLOW_CFG			0x204
-- 
2.44.0




More information about the linux-arm-kernel mailing list