netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net RFC] net: ethernet: mtk_eth_soc: ppe: add source port comparison
@ 2024-05-11 12:42 Elad Yifee
  0 siblings, 0 replies; only message in thread
From: Elad Yifee @ 2024-05-11 12:42 UTC (permalink / raw)
  Cc: eladwf, Sam.Shih, steven.liu, bc-bocun.chen, SkyLake.Huang,
	Henry.Yen, john, Felix Fietkau, Sean Wang, Mark Lee,
	Lorenzo Bianconi, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Matthias Brugger, AngeloGioacchino Del Regno, netdev,
	linux-kernel, linux-arm-kernel, linux-mediatek

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@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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-11 12:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-11 12:42 [PATCH net RFC] net: ethernet: mtk_eth_soc: ppe: add source port comparison Elad Yifee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).