Files
eternalwrt-mt798x/target/linux/airoha/patches-6.12/158-v7.2-net-airoha-configure-QoS-channel-for-HW-accelerated-.patch
T
Christian Marangi dda777dd44 airoha: backport upstream fix for Airoha reported bug for ethernet
Airoha reported some additional bug and fixes were pushed for the ethernet
driver. Backport the additional patch merged upstream and refresh all
affected patch.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-05-16 12:11:52 +02:00

45 lines
1.7 KiB
Diff

From 286efd34d1a1ef5d83f9441b5e59421a26738169 Mon Sep 17 00:00:00 2001
From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Thu, 30 Apr 2026 10:47:38 +0200
Subject: [PATCH] net: airoha: configure QoS channel for HW accelerated
flowtable traffic
As done for the SW path, configure the QoS channel for HW accelerated
traffic according to the user port index when forwarding to a DSA port,
or rely on the GDM port identifier otherwise. This allows HTB shaping
to be applied to HW accelerated traffic.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260430-airoha-ppe-qos-channel-v1-1-5ef9221e85c1@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/airoha/airoha_ppe.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/drivers/net/ethernet/airoha/airoha_ppe.c
+++ b/drivers/net/ethernet/airoha/airoha_ppe.c
@@ -332,7 +332,7 @@ static int airoha_ppe_foe_entry_prepare(
info.wcid);
} else {
struct airoha_gdm_port *port = netdev_priv(dev);
- u8 pse_port;
+ u8 pse_port, channel;
if (!airoha_is_valid_gdm_port(eth, port))
return -EINVAL;
@@ -345,6 +345,14 @@ static int airoha_ppe_foe_entry_prepare(
* loopback
*/
+ /* For traffic forwarded to DSA devices select QoS
+ * channel according to the DSA user port index, rely
+ * on port id otherwise.
+ */
+ channel = dsa_port >= 0 ? dsa_port : port->id;
+ channel = channel % AIROHA_NUM_QOS_CHANNELS;
+ qdata |= FIELD_PREP(AIROHA_FOE_CHANNEL, channel);
+
val |= FIELD_PREP(AIROHA_FOE_IB2_PSE_PORT, pse_port) |
AIROHA_FOE_IB2_PSE_QOS;
/* For downlink traffic consume SRAM memory for hw