From 52dc458dcd4372f9dd9f24f90d2ece1698ffeccd Mon Sep 17 00:00:00 2001 From: Gennaro Cimmino Date: Thu, 15 Oct 2026 13:29:53 +0200 Subject: [PATCH] realtek: dsa: rtl839x: share the first L3 row of the PIE The ethernet driver is about to tell a frame that a tc rule sent to the CPU from one that an L3 rule sent there, and only the PIE row in the CPU tag tells them apart. Move RTL839X_PIE_L3_FIRST to a new shared header, include/linux/soc/realtek/otto_common.h, and derive the number of L3 rows from it. Both values stay as they were, 640 and 512. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Gennaro Cimmino Link: https://github.com/openwrt/openwrt/pull/25919 Signed-off-by: Markus Stockhausen --- .../realtek/files-6.18/drivers/net/dsa/rtl83xx/pie.h | 4 ++-- .../files-6.18/include/linux/soc/realtek/otto_common.h | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 target/linux/realtek/files-6.18/include/linux/soc/realtek/otto_common.h diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/pie.h b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/pie.h index 9a5f077db3b..b425455638f 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/pie.h +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/pie.h @@ -2,6 +2,7 @@ #ifndef _OTTO_PIE_H #define _OTTO_PIE_H +#include #include /* PIE actions */ @@ -19,8 +20,7 @@ * ingress comes before routing. */ #define RTL839X_PIE_CUTLINE 9 -#define RTL839X_PIE_L3_RULES (4 * PIE_BLOCK_SIZE) -#define RTL839X_PIE_L3_FIRST (RTL839X_PIE_CUTLINE * PIE_BLOCK_SIZE - RTL839X_PIE_L3_RULES) +#define RTL839X_PIE_L3_RULES (RTL839X_PIE_CUTLINE * PIE_BLOCK_SIZE - RTL839X_PIE_L3_FIRST) struct pie_rule; struct otto_dsa_priv; diff --git a/target/linux/realtek/files-6.18/include/linux/soc/realtek/otto_common.h b/target/linux/realtek/files-6.18/include/linux/soc/realtek/otto_common.h new file mode 100644 index 00000000000..fe7fc83c382 --- /dev/null +++ b/target/linux/realtek/files-6.18/include/linux/soc/realtek/otto_common.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _OTTO_COMMON_H +#define _OTTO_COMMON_H + +#define RTL839X_PIE_L3_FIRST 640 + +#endif /* _OTTO_COMMON_H */