Skip to contentSkip to conversation

net: dsa: motorcomm: Extend ACL with UDF

PATCH Applied David Yang 2 participants 2 messages Oct 17 – Oct 21

Subsystems (4)
lore
Share & tools
lore

David Yang

author maintainer
#0 lore raw

PATCH 1/1 net: dsa: motorcomm: Extend ACL with UDF

The native ACL key set cannot express IP TTL or ICMP type/code. Use the User Defined Filter windows to match them in the tc flower offload.

---
 drivers/net/dsa/motorcomm/chip.h |   2 +-
 drivers/net/dsa/motorcomm/tc.c   | 140 +++++++++++++++++++++++++++++--
 drivers/net/dsa/motorcomm/tc.h   |  12 ++-
 3 files changed, 144 insertions(+), 10 deletions(-)
drivers/net/dsa/motorcomm/chip.h +1 -1
index 7047ad98f431..fc315f1d8f87 100644
@@ -440,7 +440,7 @@ enum yt921x_fdb_entry_status {
 #define YT921X_TAG_LEN	8
 
 #define YT921X_ACL_BLK_NUM	48
-#define YT921X_UDF_NUM		8
+#define YT921X_UDF_NUM		16
 
 #define YT921X_LED_GROUP_NUM	3
 #define YT921X_LED_PORT_NUM	10
drivers/net/dsa/motorcomm/tc.c +134 -6

203 lines not on this page · raw message

drivers/net/dsa/motorcomm/tc.h +9 -3
index f11136a1c5e2..cc53f148d690 100644
@@ -118,6 +118,9 @@ enum yt921x_acl_type {
 	YT921X_ACL_TYPE_IPV6_SA3,
 	YT921X_ACL_TYPE_MISC,
 	YT921X_ACL_TYPE_L4,
+	/* Each User Defined Filter entry contains 2 UDF windows (UDF_CTRL 2i
+	 * and 2i+1)
+	 */
 	YT921X_ACL_TYPE_UDF0,
 	YT921X_ACL_TYPE_UDF1,
 	YT921X_ACL_TYPE_UDF2,
@@ -255,12 +258,15 @@ enum yt921x_l4_type {
 #define YT921X_UDFn_CTRL(x)		(0x210094 + 4 * (x))
 #define  YT921X_UDF_CTRL_UDF_TYPE_M		GENMASK(8, 7)
 #define   YT921X_UDF_CTRL_UDF_TYPE(x)			FIELD_PREP(YT921X_UDF_CTRL_UDF_TYPE_M, (x))
-#define   YT921X_UDF_CTRL_UDF_TYPE_ETH			YT921X_UDF_CTRL_UDF_TYPE(0)
-#define   YT921X_UDF_CTRL_UDF_TYPE_L3			YT921X_UDF_CTRL_UDF_TYPE(1)
-#define   YT921X_UDF_CTRL_UDF_TYPE_L4			YT921X_UDF_CTRL_UDF_TYPE(2)
 #define  YT921X_UDF_CTRL_UDF_OFFSET_M		GENMASK(6, 0)
 #define   YT921X_UDF_CTRL_UDF_OFFSET(x)			FIELD_PREP(YT921X_UDF_CTRL_UDF_OFFSET_M, (x))
 
+enum yt921x_udf_type {
+	YT921X_UDF_TYPE_L2,
+	YT921X_UDF_TYPE_L3,
+	YT921X_UDF_TYPE_L4,
+};
+
 #define YT921X_PORTn_RATE(port)		(0x220000 + 4 * (port))
 #define  YT921X_PORT_RATE_GAP_VALUE		GENMASK(4, 0)	/* default 20 */
 #define YT921X_METER_SLOT		0x220104
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 9 lines · On Sat, 17 Oct 2026 10:31:32 +0800 you wrote:

The native ACL key set cannot express IP TTL or ICMP type/code. Use the User Defined Filter windows to match them in the tc flower offload.

---
 drivers/net/dsa/motorcomm/chip.h |   2 +-
 drivers/net/dsa/motorcomm/tc.c   | 140 +++++++++++++++++++++++++++++--
 drivers/net/dsa/motorcomm/tc.h   |  12 ++-
 3 files changed, 144 insertions(+), 10 deletions(-)

Here is the summary with links:
- [net-next] net: dsa: motorcomm: Extend ACL with UDF

    https://git.kernel.org/netdev/net-next/c/279d5c8afcd3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html